fix remarks

This commit is contained in:
Felix Van der Jeugt 2016-01-05 22:45:52 +01:00
parent 8873aba09f
commit 362db3d986
2 changed files with 6 additions and 9 deletions

View File

@ -683,7 +683,7 @@ class HintManager(QObject):
keyparsers = objreg.get('keyparsers', scope='window',
window=self._win_id)
keyparser = keyparsers[usertypes.KeyMode.hint]
keyparser.update_bindings(strings)
keyparser.update_bindings(hints)
def follow_prevnext(self, frame, baseurl, prev=False, tab=False,
background=False, window=False):
@ -981,14 +981,11 @@ class WordHinter:
"""Generator for word hints.
Class attributes:
Attributes:
words: A set of words to be used when no "smart hint" can be
derived from the hinted element.
"""
FIRST_ALPHABETIC = re.compile('[A-Za-z]{3,}')
def __init__(self):
# will be initialized on first use.
self.words = set()
@ -1007,8 +1004,10 @@ class WordHinter:
# contains none-alphabetic chars
continue
if len(word) > 4:
# we don't need words longer than 4
continue
for i in range(len(word)):
# remove all prefixes of this word
hints.discard(word[:i + 1])
hints.add(word)
self.words.update(hints)
@ -1044,7 +1043,7 @@ class WordHinter:
for candidate in words:
if not candidate:
continue
match = self.FIRST_ALPHABETIC.search(candidate)
match = re.search('[A-Za-z]{3,}', candidate)
if not match:
continue
if match.end() - match.start() < 4:

View File

@ -904,8 +904,6 @@ class File(BaseType):
cfgdir = standarddir.config()
assert cfgdir is not None
value = os.path.join(cfgdir, value)
#if not self.required and not os.access(value, os.F_OK | os.R_OK):
# return None
return value
def validate(self, value):