pazz / urwidtrees

tree widgets for urwid
GNU General Public License v3.0
52 stars 18 forks source link

Some small fixes #31

Closed lucc closed 7 years ago

lucc commented 7 years ago

It looks rather hard to me to fix more things reported by pylint quickly because I have the feeling that I need a much deeper inside in the code and logic to clean this things up. Many are about unused parameters but I assume they are there to have a common interface on all super and sub classes.

And the "unused variable" with "w" I assume to be intensional (you could use "_" as a variable to remove the warning).

lucc commented 7 years ago

Sorry I forgot to ask: did you check e0ac3be that is actually correct?

pazz commented 7 years ago

Sorry: originally copy&pasted this line, so I'm no expert. I expected you had a good reason for the change

pazz commented 7 years ago

no, this was not safe after urwidtrees & alot from master give me the trace below, once I try to open a mail.

INFO:search:open thread view for thread:00000000000097f1: Februar 2017
ERROR:ui:Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 317, in addCallback
    callbackKeywords=kw)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 306, in addCallbacks
    self._runCallbacks()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 587, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/home/pazz/.local/lib/python2.7/site-packages/alot-0.4.dev0-py2.7.egg/alot/ui.py", line 640, in call_apply
    return defer.maybeDeferred(cmd.apply, self)
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 149, in maybeDeferred
    result = f(*args, **kw)
  File "/home/pazz/.local/lib/python2.7/site-packages/alot-0.4.dev0-py2.7.egg/alot/commands/search.py", line 40, in apply
    sb.unfold_matching(query)
  File "/home/pazz/.local/lib/python2.7/site-packages/alot-0.4.dev0-py2.7.egg/alot/buffers.py", line 613, in unfold_matching
    self.body.refresh()
  File "/home/pazz/.local/lib/python2.7/site-packages/urwidtrees/widgets.py", line 126, in refresh
    self._walker.clear_cache()
  File "/home/pazz/.local/lib/python2.7/site-packages/urwidtrees/widgets.py", line 61, in clear_cache
    self.__getitem__().cache_clear()
  File "/home/pazz/.local/lib/python2.7/site-packages/urwidtrees/lru_cache.py", line 102, in wrapper
    result = user_function(*args, **kwds)
exceptions.TypeError: __getitem__() takes exactly 2 arguments (1 given)
pazz commented 7 years ago

sorry for this. I also accidentally pushed these commits that spuriously bump the version number. This was unintended and is now reverted

lucc commented 7 years ago

Do we need tests here as well ;)

(Sorry for the wrong change, it was reported by pylint and made sense to me)

pazz commented 7 years ago

we could introduce those, but honestly: I think the code here is rather ad hoc and difficult to debug. So unless something breaks I'd rather not touch anything at all :P