Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console error #28

Open
zephyr111 opened this issue Aug 31, 2021 · 0 comments
Open

Console error #28

zephyr111 opened this issue Aug 31, 2021 · 0 comments

Comments

@zephyr111
Copy link

zephyr111 commented Aug 31, 2021

Hello,

I just tried the plugin but it does not work with a relatively recent version of sublime text on my machine.
The sublime text console show the following error:

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text\Lib\python33\sublime_plugin.py", line 948, in on_deactivated
    run_view_callbacks('on_deactivated', view_id)
  File "C:\Program Files\Sublime Text\Lib\python33\sublime_plugin.py", line 708, in run_view_callbacks
    callback(v, *args)
  File "C:\Program Files\Sublime Text\Lib\python33\sublime_plugin.py", line 152, in profiler
    return event_handler(*args)
  File "C:\Users\jrichard3\AppData\Roaming\Sublime Text\Installed Packages\Subforce - Perforce for Sublime.sublime-package\Subforce.py", line 352, in on_deactivated
    self.updateStatus(view)
  File "C:\Users\jrichard3\AppData\Roaming\Sublime Text\Installed Packages\Subforce - Perforce for Sublime.sublime-package\Subforce.py", line 362, in updateStatus
    with PerforceWrapper(squelchErrorAndWarninMessages=True) as p4:
  File "C:\Users\jrichard3\AppData\Roaming\Sublime Text\Installed Packages\Subforce - Perforce for Sublime.sublime-package\Subforce.py", line 66, in __init__
    projectPath = sublime.active_window().extract_variables()['folder']
KeyError: 'folder'

The key does not exist. I guess it has been deleted recently.
This cause the plugin not to be able to do a command on any file.

How to fix this:

sublime.active_window().extract_variables()['file_path'] can be used to get the file path of the current window and the containing folder can be extracted using os.path.dirname. This works on my machine with that.
It looks like the code Perforce.py on master is different and does not contains this line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant