Example #1
0
    def run(self):
        s = sublime.load_settings("Package Syncing.sublime-settings")
        s.set("sync", False)
        sublime.save_settings("Package Syncing.sublime-settings")

        # Stop watcher
        tools.stop_watcher()
	def run(self):
		s = sublime.load_settings("Package Syncing.sublime-settings")
		s.set("sync", False)
		sublime.save_settings("Package Syncing.sublime-settings")

		# Stop watcher
		tools.stop_watcher()
Example #3
0
def plugin_unloaded():
    s = sublime.load_settings("Package Syncing.sublime-settings")
    s.clear_on_change("package_syncing")
    sublime.save_settings("Package Syncing.sublime-settings")

    # Stop folder watcher
    tools.stop_watcher()
Example #4
0
def plugin_unloaded():
    s = sublime.load_settings("Package Syncing.sublime-settings")
    s.clear_on_change("package_syncing")
    sublime.save_settings("Package Syncing.sublime-settings")

    # Stop folder watcher
    tools.stop_watcher()
Example #5
0
        def on_done(path):
            if not os.path.isdir(path):
                os.makedirs(path)

            if os.path.isdir(path):
                if os.listdir(path):
                    if sublime.ok_cancel_dialog(
                            "The selected folder is not empty, would you like to continue and override your local settings?",
                            "Continue"):
                        override = True
                    else:
                        self.window.show_input_panel("Sync Folder", path,
                                                     on_done, None, None)
                        return
                else:
                    override = False

                # Adjust settings
                settings.set("sync", True)
                settings.set("sync_folder", path)

                # Reset last-run file
                file_path = os.path.join(sublime.packages_path(), "User",
                                         "Package Control.last-run")
                if os.path.isfile(file_path):
                    os.remove(file_path)

                # Reset last-run file
                file_path = os.path.join(sublime.packages_path(), "User",
                                         "Package Syncing.last-run")
                if os.path.isfile(file_path):
                    os.remove(file_path)

                sublime.save_settings("Package Syncing.sublime-settings")
                sublime.status_message(
                    "sync_folder successfully set to \"%s\"" % path)

                # Restart watcher
                tools.pause_watcher(local=False)
                tools.stop_watcher(local=False)
                tools.start_watcher(tools.load_settings(), local=False)

                # Run pkg_sync
                sublime.set_timeout(
                    lambda: sublime.run_command("pkg_sync", {
                        "mode": ["pull", "push"],
                        "override": override
                    }), 1000)

            else:
                sublime.error_message("Invalid Path %s" % path)

            # Add on on_change listener
            sublime.set_timeout(
                lambda: settings.add_on_change("package_syncing", tools.
                                               restart_watcher), 500)
Example #6
0
        def on_done(path):
            if not os.path.isdir(path):
                os.makedirs(path)

            if os.path.isdir(path):
                if os.listdir(path):
                    if sublime.ok_cancel_dialog("The selected folder is not empty, would you like to continue and override your local settings?", "Continue"):
                        override = True
                    else:
                        self.window.show_input_panel("Sync Folder", path, on_done, None, None)
                        return
                else:
                    override = False

                # Adjust settings
                settings.set("sync", True)
                settings.set("sync_folder", path)

                # Reset last-run file
                file_path = os.path.join(sublime.packages_path(), "User", "Package Control.last-run")
                if os.path.isfile(file_path):
                    os.remove(file_path)

                # Reset last-run file
                file_path = os.path.join(sublime.packages_path(), "User", "Package Syncing.last-run")
                if os.path.isfile(file_path):
                    os.remove(file_path)

                sublime.save_settings("Package Syncing.sublime-settings")
                sublime.status_message("sync_folder successfully set to \"%s\"" % path)

                # Restart watcher
                tools.pause_watcher(local=False)
                tools.stop_watcher(local=False)
                tools.start_watcher(tools.load_settings(), local=False)

                # Run pkg_sync
                sublime.set_timeout(lambda: sublime.run_command("pkg_sync", {"mode": ["pull", "push"], "override": override}), 1000)

            else:
                sublime.error_message("Invalid Path %s" % path)

            # Add on on_change listener
            sublime.set_timeout(lambda: settings.add_on_change("package_syncing", tools.restart_watcher), 500)
def plugin_unloaded():
	tools.stop_watcher()
Example #8
0
def plugin_unloaded():
    tools.stop_watcher()