Skip to content

Commit

Permalink
Normalized command names and their prefixing
Browse files Browse the repository at this point in the history
  • Loading branch information
NoxArt committed Jun 26, 2012
1 parent c882393 commit b221fd0
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
12 changes: 8 additions & 4 deletions Context.sublime-menu
@@ -1,12 +1,16 @@
[ [
{ "caption": "-" }, { "caption": "-" },
{ {
"caption": "Check this file",
"command": "ftp_sync_check_current"
},
{
"caption": "Upload this file", "caption": "Upload this file",
"command": "sync_current" "command": "ftp_sync_current"
}, },
{ {
"caption": "Download this file", "caption": "Download this file",
"command": "sync_down_current" "command": "ftp_sync_down_current"
}, },
{ "caption": "-" } { "caption": "-" }
] ]
2 changes: 1 addition & 1 deletion Default.sublime-commands
@@ -1,7 +1,7 @@
[ [
{ {
"caption": "FTPSync: Setup FTPSync in this folder", "caption": "FTPSync: Setup FTPSync in this folder",
"command": "new_ftp_sync", "command": "ftp_sync_new_settings",
"args": {"dirs": []} "args": {"dirs": []}
}, },
{ {
Expand Down
11 changes: 9 additions & 2 deletions FTPSync.py
Expand Up @@ -914,6 +914,8 @@ def sync(index):






# ==== Watching ===========================================================================

# File watching # File watching
class RemoteSync(sublime_plugin.EventListener): class RemoteSync(sublime_plugin.EventListener):
def on_post_save(self, view): def on_post_save(self, view):
Expand All @@ -933,6 +935,8 @@ def on_load(self, view):






# ==== Threading ===========================================================================

# Remote handling # Remote handling
class RemoteSyncCall(threading.Thread): class RemoteSyncCall(threading.Thread):
def __init__(self, file_path, config, onSave, disregardIgnore=False, whitelistConnections=[]): def __init__(self, file_path, config, onSave, disregardIgnore=False, whitelistConnections=[]):
Expand Down Expand Up @@ -1000,8 +1004,11 @@ def run(self):
performSyncRename(self.file_path, self.config, self.new_name) performSyncRename(self.file_path, self.config, self.new_name)





# ==== Commands ===========================================================================

# Sets up a config file in a directory # Sets up a config file in a directory
class NewFtpSyncCommand(sublime_plugin.TextCommand): class FtpSyncNewSettings(sublime_plugin.TextCommand):
def run(self, edit, dirs): def run(self, edit, dirs):
if len(dirs) == 0: if len(dirs) == 0:
dirs = [os.path.dirname(self.view.file_name())] dirs = [os.path.dirname(self.view.file_name())]
Expand Down Expand Up @@ -1086,6 +1093,6 @@ def rename(self, new_name):




# Removes given file(s) or folders # Removes given file(s) or folders
class SyncDelete(sublime_plugin.TextCommand): class FtpSyncDelete(sublime_plugin.TextCommand):
def run(self, edit, paths): def run(self, edit, paths):
pass pass
2 changes: 1 addition & 1 deletion Main.sublime-menu
Expand Up @@ -26,7 +26,7 @@
"caption": "Settings – User" "caption": "Settings – User"
}, },
{ {
"command": "new_ftp_sync", "command": "ftp_sync_new_settings",
"caption": "Setup FTPSync in this folder", "caption": "Setup FTPSync in this folder",
"args": {"dirs": []} "args": {"dirs": []}
}, },
Expand Down
2 changes: 1 addition & 1 deletion Side Bar.sublime-menu
Expand Up @@ -8,7 +8,7 @@
{ "caption": "Download", "command": "ftp_sync_down_target", "args": {"paths": []} }, { "caption": "Download", "command": "ftp_sync_down_target", "args": {"paths": []} },
{ "caption": "Download Forced", "command": "ftp_sync_down_target", "args": {"paths": [], "forced": true} }, { "caption": "Download Forced", "command": "ftp_sync_down_target", "args": {"paths": [], "forced": true} },
{ "caption": "-" }, { "caption": "-" },
{ "caption": "Setup FTPSync in this folder", "command": "new_ftp_sync", "args": {"dirs": []} } { "caption": "Setup FTPSync in this folder", "command": "ftp_sync_new_settings", "args": {"dirs": []} }
] ]
} }
] ]

0 comments on commit b221fd0

Please sign in to comment.