Exemplo n.º 1
0
    def run(self, mode=["pull", "push"], override=False):
        log.debug("pkg_sync %s %s", mode, override)

        # Load settings
        settings = sublime.load_settings("Package Syncing.sublime-settings")

        # Check for valid sync_folder
        if not os.path.isdir(settings.get("sync_folder")):
            sublime.error_message("Invalid sync folder \"%s\", sync disabled! Please adjust your sync folder." % settings.get("sync_folder"))
            settings.set("sync", False)
            sublime.save_settings("Package Syncing.sublime-settings")
            return

        # Check if sync is already running
        if not q.has("sync"):
            t = thread.Sync(tools.load_settings(), mode, override)
            q.add(t, "sync")
        else:
            print("Package Syncing: Already running")
Exemplo n.º 2
0
    def run(self, item):
        log.debug("pkg_sync_push_item %s", item)

        # Start a thread to push the current item
        t = thread.Sync(tools.load_settings(), mode=["push"], item=item)
        q.add(t)