motatoes / preech

speech based programming project
9 stars 4 forks source link

The "start dictation" item is gray #2

Open Kosskak opened 4 years ago

Kosskak commented 4 years ago

Thanks for your work! I discovered a problem though, which is that the "start dictation" items under "preech" in "file" menu in sublime2 is grayed and cannot be clicked. Only the item "reload config files" could be clicked while an error occured: Traceback (most recent call last): File ".\sublimeplugin.py", line 362, in run return self.run(edit) File ".\Config.py", line 14, in run IOError: [Errno 2] No such file or directory: u'C:\Users\zyb32\AppData\Roaming\Sublime Text 2\Packages\preech\config\python.gram.json'

Where is the problem? Thank u.

Kosskak commented 4 years ago

Sorry, I had't renamed the file to "preech", but after renaming, the "start dictation" and "stop dictation" still cannot work. There is no IOEerror above though. However, the following error occurs: Traceback (most recent call last): File ".\sublime_plugin.py", line 62, in reload_plugin File ".\Controller.py", line 7, in from speech import speechCommand File ".\speech.py", line 4, in from Controller import Controller ImportError: cannot import name Controller Reloading plugin C:\Users\zyb32\AppData\Roaming\Sublime Text 2\Packages\preech\inputProcessor.py Reloading plugin C:\Users\zyb32\AppData\Roaming\Sublime Text 2\Packages\preech\speech.py Traceback (most recent call last): File ".\sublime_plugin.py", line 62, in reload_plugin File ".\speech.py", line 4, in from Controller import Controller File ".\Controller.py", line 7, in from speech import speechCommand ImportError: cannot import name speechCommand

Why such packages can't be imported successfully? thanks.

motatoes commented 4 years ago

Hey, thanks for reporting the issue, it has been a long time since I used this package so let me review the codebase and get back to you regarding your issue, thanks

Kosskak commented 4 years ago

I've already solved the problem. The error occurs because that Controller.py and speech.py are importing each other, and python (my version is 3.6) doesn't allow such mutual import. To solve the problem, you could just delete line from speech import speechCommand in Controller.py because speech.py doesn't actually appear in Controller.py . And then preech could work normally. Thanks again for your contribution and quick reply! It does help me a lot.

motatoes commented 4 years ago

Great :) Do you want so submit a Pull Request with this change ?