我正在尝试修复一个名为 reported bug 的插件的 ThemeAutomator ,但我不确定我得到了什么问题。
如果我print
我加载的插件的sublime设置只能在首次运行安装时工作,或者当我保存ThemeAutomator.py时,基本上是sublime重新加载它然后它工作。方法load_settings
无法加载正确的数据,为什么?
首先安装
print(sublime.load_settings('ThemeAutomator.sublime-settings').get('schemes')
返回[]
,一个准备填充的空数组,如果我使用插件,我会看到ThemeAutomator.sublime-settings
正确填充{'extension': '.md', 'color_scheme': 'Packages/...
重新加载Sublime后
返回NoneType
这是完整的堆栈:
Traceback (most recent call last):
File "/Applications/Coding/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 303, in on_activated
callback.on_activated(v)
File "ThemeAutomator in /Users/coop/Library/Application Support/Sublime Text 3/Installed Packages/ThemeAutomator.sublime-package", line 64, in on_activated
File "ThemeAutomator in /Users/coop/Library/Application Support/Sublime Text 3/Installed Packages/ThemeAutomator.sublime-package", line 41, in add_scheme
AttributeError: 'NoneType' object has no attribute 'append'
found 12 files for base name Main.sublime-menu
Traceback (most recent call last):
File "/Applications/Coding/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 319, in on_deactivated
callback.on_deactivated(v)
File "ThemeAutomator in /Users/coop/Library/Application Support/Sublime Text 3/Installed Packages/ThemeAutomator.sublime-package", line 69, in on_deactivated
File "ThemeAutomator in /Users/coop/Library/Application Support/Sublime Text 3/Installed Packages/ThemeAutomator.sublime-package", line 51, in set_scheme_for_extension
File "ThemeAutomator in /Users/coop/Library/Application Support/Sublime Text 3/Installed Packages/ThemeAutomator.sublime-package", line 41, in add_scheme
AttributeError: 'NoneType' object has no attribute 'append'
插件有什么问题?