根据这里和生活黑客的一些建议,我开始使用自动键。
工作了一周,但到今天为止
和
我添加了一些短语,并重新启动,因为我上次成功尝试使用它。
另一个用户报告了gtk版本的自动密钥的类似问题。
从命令行运行它的结果似乎显示了一些异常错误:
Exception in thread KeypressHandler-thread:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 808, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/dist-packages/autokey/iomediator.py", line 202, in run
target.handle_keypress(rawKey, modifiers, key, windowName, windowClass)
File "/usr/lib/python2.7/dist-packages/autokey/service.py", line 179, in handle_keypress
currentInput, windowInfo, True)
File "/usr/lib/python2.7/dist-packages/autokey/service.py", line 304, in __checkTextMatches
if item.check_input(buffer, windowInfo):
File "/usr/lib/python2.7/dist-packages/autokey/model.py", line 732, in check_input
abbr = self._should_trigger_abbreviation(buffer)
File "/usr/lib/python2.7/dist-packages/autokey/model.py", line 131, in _should_trigger_abbreviation
if self.__checkInput(buffer, abbr):
File "/usr/lib/python2.7/dist-packages/autokey/model.py", line 144, in __checkInput
stringBefore, typedAbbr, stringAfter = self._partition_input(buffer, abbr)
File "/usr/lib/python2.7/dist-packages/autokey/model.py", line 191, in _partition_input
stringBefore, typedAbbr, stringAfter = currentString.rpartition(abbr)
ValueError: empty separator原木在这里
任何帮助都将不胜感激。
发布于 2014-01-15 09:00:15
在玩了一些自动键之后,我注意到我的“缩写”中有一个附加了逗号,并用括号括起来:[<myabbreviation>,]。
经过进一步的检查,这条“短语”规则有第二个额外的空白“缩写”,当删除时会导致括号消失。
由于删除这个额外的空白‘缩写’自动键似乎现在运行,运行完美。
发布于 2015-11-12 12:25:25
这是我对违规代码的更改:
/usr/lib/python2.7/dist-packages/autokey/model.py
def _should_trigger_abbreviation(self, buffer):
"""
Checks whether, based on the settings for the abbreviation and the given input,
the abbreviation should trigger.
@param buffer Input buffer to be checked (as string)
"""
for abbr in self.abbreviations:
if abbr == "":
continue
if self.__checkInput(buffer, abbr):
return Truehttps://askubuntu.com/questions/405354
复制相似问题