-
-
Save greggb/6066286 to your computer and use it in GitHub Desktop.
Perforce Plugin for Sublime Text. In ST3 this goes directly in the Packages directory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
[ | |
{ "keys": ["f8"], "command": "p4_edit" } | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin, os, subprocess | |
class P4EditCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
if self.view.file_name(): | |
folder_name, file_name = os.path.split(self.view.file_name()) | |
command = 'export P4CONFIG=.perforce; p4 edit '+file_name | |
p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=folder_name, shell=True) | |
result, err = p.communicate() | |
self.view.set_status('p4',result+err) | |
sublime.set_timeout(self.clear,2000) | |
def clear(self): | |
self.view.erase_status('p4') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment