[issue28498] tk busy command

2018-02-21 Thread Ned Deily
Change by Ned Deily : -- versions: +Python 3.8 -Python 3.7 ___ Python tracker ___ ___

[issue28498] tk busy command

2018-02-21 Thread Cheryl Sabella
Cheryl Sabella added the comment: There was a lot of work put into this patch, but I don't think it's been committed yet. Are any of the original authors interested in converting this to a Github pull request on the master branch? Thanks! -- nosy: +csabella

[issue28498] tk busy command

2016-11-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated patch skips tests with the cursor option on OSX/Aqua. -- Added file: http://bugs.python.org/file45337/tk_busy_6.diff ___ Python tracker

[issue28498] tk busy command

2016-10-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ah, yes, this feature is not supported on OSX/Aqua. -- ___ Python tracker ___

[issue28498] tk busy command

2016-10-30 Thread Ned Deily
Ned Deily added the comment: With ActiveState 8.6.4.1 (the most recent version available) on macOS: == ERROR: test_tk_busy (tkinter.test.test_tkinter.test_misc.MiscTest)

[issue28498] tk busy command

2016-10-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added a number of style comments on Rietveld. I believe klappnase could address them, but since there are too little time to beta3 and I have a weak hope to push this in 3.6, I addressed them myself. Rewritten docstrings and test. Ned, is it good to add

[issue28498] tk busy command

2016-10-29 Thread Miguel
Miguel added the comment: Why dont we do the job well from the beginning and refactor _configure() and adapt other dependent code? It's not so complicated to change the dependent code. Many people around the world use Tkinter. -- ___ Python tracker

[issue28498] tk busy command

2016-10-26 Thread klappnase
klappnase added the comment: This is something entirely different, since the commands you list here in tk do not accept keyword arguments at all. -- ___ Python tracker

[issue28498] tk busy command

2016-10-26 Thread Miguel
Miguel added the comment: Using the same reasoning applied to tk_busy_hold(), we have to change also these methods: selection_set(self, first, last=None) -> selection_set(self, **kw) coords(self, value=None) -> coords(self, **kw) identify(self, x, y) -> identity(self, **kw)

[issue28498] tk busy command

2016-10-26 Thread klappnase
klappnase added the comment: Oops, I guess I violated PEP257 again, sorry, corrected version #4 attached. -- Added file: http://bugs.python.org/file45231/tk_busy_4.diff ___ Python tracker

[issue28498] tk busy command

2016-10-26 Thread klappnase
klappnase added the comment: Ok, I hope I applied all the required changes now. The tests seemed to me to belong to test_misc, so I just added another function to the MiscTest class, I hope that is ok. The test runs well here, so I hope I did everything correctly. Thanks for your patience!

[issue28498] tk busy command

2016-10-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Shouldn't it be just an alias to tk_busy_hold?" > > Not sure, I figured since it is a separate command in tk I would make it a > separate command in Python, too. place is just an alias to place_configure despites the fact that in Tk "place" and "place

[issue28498] tk busy command

2016-10-24 Thread klappnase
klappnase added the comment: Hi Serhiy, thanks for the feedback. "+def tk_busy(self, **kw): Shouldn't it be just an alias to tk_busy_hold?" Not sure, I figured since it is a separate command in tk I would make it a separate command in Python, too. "+def tk_busy_hold(self, **kw):

[issue28498] tk busy command

2016-10-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: First, thank you Miguel and klappnase for your patches. But they should be provided in different way, as described in Python Developer’s Guide [1]. > I totally disagree of this change on your patch: This is not my patch. This is regenerated klappnase's. I

[issue28498] tk busy command

2016-10-24 Thread klappnase
klappnase added the comment: At least with python 3.4 here wantobjects still is valid, and personally I really hope that it remains this way, because I use to set wantobjects=False in my own code to avoid having to deal with errors because of some method or other unexpectedly returning

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: In the C source code that I am reading of tkinter: _tkinter.c. It seems that these parameters are not used: - wantobjects - useTk - syn - use It seems that it's dead code. I hope that somebody can tell me whether I am right. I suppose that now Python returns always

[issue28498] tk busy command

2016-10-23 Thread klappnase
klappnase added the comment: The bug is that tk_strictMotif (which uses self.tk.getboolean() itself) returns 0 instead of False. I used the "nested" command to point out, that self.tk.getboolean() is broken when used with wantobjects=True, because it does *not* return proper boolean values ,

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: It's not defined the semantics for things different than strings. -- ___ Python tracker ___

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Hi, I think that it's behaving well. Where is the bug here? root.tk.getboolean(root.tk_strictMotif()) getboolean() converts Tcl strings to Boolean Python values according to the definition of True and False in Tcl. getboolean is only used for converting strings to

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Yes, its true. The semantics of configure() is affected then if I ommit _flaten. I like elegancy and to dont repeat myself for this reason I made that suggestion. But the drawback is that maybe other external code that shouldn't rely on internal methods like

[issue28498] tk busy command

2016-10-23 Thread klappnase
klappnase added the comment: And another thing: "There is no test that shows that self.tk.getboolean is buggy." Well... $ python3 Python 3.4.2 (default, Oct 8 2014, 10:45:20) [GCC 4.9.1] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import tkinter >>>

[issue28498] tk busy command

2016-10-23 Thread klappnase
klappnase added the comment: "This is my point of view: These functions are easy to change: itemconfigure(), entryconfigure(), image_configure(), tag_configure() and window_configure() It's only to add self._w in the proper place. Only one line per method" At least Tix would have to be

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Hi Serhiy, I totally disagree of this change on your patch: +def tk_busy_status(self): +'''Returns the busy status of this window. +If the window presently can not receive user interactions, +True is returned, otherwise False.''' +

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: This is my point of view: These functions are easy to change: itemconfigure(), entryconfigure(), image_configure(), tag_configure() and window_configure() It's only to add self._w in the proper place. Only one line per method Other third party extensions should not

[issue28498] tk busy command

2016-10-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file45200/tk_busy.patch ___ Python tracker ___

[issue28498] tk busy command

2016-10-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Use "hg diff" command for creating a patch. -- stage: needs patch -> patch review Added file: http://bugs.python.org/file45199/tk_busy.patch ___ Python tracker

[issue28498] tk busy command

2016-10-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- Removed message: http://bugs.python.org/msg279271 ___ Python tracker ___

[issue28498] tk busy command

2016-10-23 Thread klappnase
klappnase added the comment: "Also it's more efficient to use this than the function _flaten() in that situation: if not self._w in cmd: cmd = (self._w,) + cmd " The construct with _flatten() was not my invention, it's probably something to discuss with Guido ;) The advantage of

[issue28498] tk busy command

2016-10-23 Thread klappnase
klappnase added the comment: Your changed _configure() will also break Canvas/Listbox.itemconfigure(), Menu.entryconfigure() and a number of other methods, Tix is also affected. It will also break third party extensions that use _configure(), like pybwidget. As another python motto says

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Your proposal also makes an extra computation: an item (not) belongs to a list if not self._w in cmd: cmd = _flatten((self._w, cmd)) Also it's more efficient to use this than the function _flaten() in that situation: if not self._w in cmd: cmd =

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: It's also necessary in the same way to adapt these functions: itemconfigure(), entryconfigure(), image_configure(), tag_configure() and window_configure(). -- ___ Python tracker

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Yes, sure. It will break code. Maybe it's better to be explicit than implicit (another Python motto). It's also necessary to change configure(). This is the code for my version of _configure() and configure(): def _configure(self, cmd, cnf, kw):

[issue28498] tk busy command

2016-10-23 Thread GNJ
GNJ added the comment: http://www.gnjmotorsport.com/search-by-car/vauxhall/ -- nosy: +GNJ ___ Python tracker ___

[issue28498] tk busy command

2016-10-23 Thread klappnase
klappnase added the comment: Hi Miguel, about _configure() : the code you suggest: def _configure(self, cmd, cnf, kw): """Internal function.""" if kw: cnf = _cnfmerge((cnf, kw)) elif cnf: cnf = _cnfmerge(cnf) if cnf is None:

[issue28498] tk busy command

2016-10-23 Thread klappnase
klappnase added the comment: As far as I can see, most internal Tkinter methods use _getboolean(), which currently looks like: def _getboolean(self, string): """Internal function.""" if string: return self.tk.getboolean(string) I am not 100% sure about this,

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Ok. Maybe the bug is here: Misc.getboolean() This is the required change: def getboolean(self, s): """Return a boolean value for Tcl boolean values true and false given as parameter.""" return bool(self.tk.getboolean(s)) --

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Tcl_GetBoolean() converts a boolean string to an integer 0 or 1: https://www.tcl.tk/man/tcl8.6/TclLib/GetInt.htm and then Py_BuildValue() converts the integer to a Python object: https://docs.python.org/2/c-api/arg.html --

[issue28498] tk busy command

2016-10-23 Thread Miguel
Miguel added the comment: Hi klappnase, you are right with the function tk_busy_configure(). Maybe there is a little bit of code duplicated. I think that it's better to directly change the Tkinter function _configure() to make it more general: def _configure(self, cmd, cnf, kw):

[issue28498] tk busy command

2016-10-22 Thread klappnase
klappnase added the comment: @Miguel About tk_busy_configure(): I strongly suggest that my version of tk_busy_configure() is better, since it behaves exactly like the usual configure() methods in Tkinter (which includes e.g. Canvas.itemconfigure() or Text.tag_configure()), i.e. you can not

[issue28498] tk busy command

2016-10-22 Thread Miguel
Miguel added the comment: Misc._configure is only used when the first Tcl command is the name of the widget. Very probably my proposal for tk_busy_configure is a better candidate because it follows the conventions used in tkinter (it's similar to pack_configure and place_configure): def

[issue28498] tk busy command

2016-10-22 Thread Miguel
Miguel added the comment: Thanks klappnase for your collaboration. I dont understand this function: def busy_status(self): '''Returns the busy status of this window. If the window presently can not receive user interactions, True is returned, otherwise False.'''

[issue28498] tk busy command

2016-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you provide a patch against the default branch? See https://docs.python.org/devguide/ for help. The patch should include not just changes to the tkinter module, but tests for new methods (add new class in

[issue28498] tk busy command

2016-10-22 Thread klappnase
klappnase added the comment: Ok, I investigated this a little further. First I noticed another bug with the code from my first post, the "self._w" must be omitted from the call to busy_current(), so the func should look like: def busy_current(self, pattern=None):

[issue28498] tk busy command

2016-10-22 Thread Miguel
Miguel added the comment: Maybe it's better to add also these methods: busy = tk_busy busy_cget = tk_busy_cget busy_configure = tk_busy_configure busy_current = tk_busy_current busy_forget = tk_busy_forget busy_hold = tk_busy_hold busy_status = tk_busy_status Many

[issue28498] tk busy command

2016-10-21 Thread klappnase
klappnase added the comment: Oops, just made a quick test with Python3, and found that I had missed that types.StringType is no longer present. So to be compatible with Python3 the busy_configure() func ought to look like: def busy_configure(self, cnf=None, **kw): if kw:

[issue28498] tk busy command

2016-10-21 Thread klappnase
klappnase added the comment: Funny thing, just today I came across the same issue. So far I came up with an a little bit refined version of the OP's suggestions. Until now I have tested this with Python-2.7.9 and tk-8.6.0 on debian Jessie, I think the same code should work for Python-3 , too.

[issue28498] tk busy command

2016-10-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka components: +Library (Lib) nosy: +serhiy.storchaka stage: -> needs patch type: -> enhancement versions: -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6

[issue28498] tk busy command

2016-10-21 Thread Miguel
New submission from Miguel: tcl tk 8.6.6 has a new busy command. The new tkinter library doesn't provide an interface for this command. https://www.tcl.tk/man/tcl/TkCmd/busy.htm The solution is to add to the class Misc of tkinter these methods: def tk_busy(self, *args, **kw):