Esempio n. 1
0
 def run(self, edit):
     self.view.insert(edit, 0, "Hello, World!")
     tf_path = 'c:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\IDE\\TF.exe'
     try:
         subprocess.check_call([tf_path, "out", self.view.file_name()], stderr=subprocess.STDOUT)
     except subprocess.CalledProcessError as e:
         sublime.messageBox(e.output)
def displayResults(Results, Mode, view):
	if(Mode == "Window"):
		if(Results[1] != None and Results[1] != ""):
			createWindowWithText(view, "An error or warning occurred:\n\n" + str(Results[1]))
		elif(Results[0] != None and Results[0] != ""):
			createWindowWithText(view, str(Results[0]))			
	# Message Box
	elif(Mode == "MessageBox"):
		if(Results[1] != None and Results != ""):
			sublime.messageBox("An error or warning occurred:\n\n" + str(Results[1]))
		elif(Results[0] != None and Results[0] != ""):
			sublime.statusMessage(str(Results[0]))
 def run(self, view, args):
     window = sublime.activeWindow()
     project_file = window.project().fileName()
     os.chdir(os.path.dirname(project_file))
     if args[0] == "status" or args[0] == "add":
         if args[0] == "status":
             svn_cmd = "svn status"
         elif args[0] == "add":
             svn_cmd = 'svn add "' + view.fileName() + '"'
         svn_output = getOutputOfSysCommand(svn_cmd)
         sublime.messageBox(svn_output)
     elif args[0] == "commit":
         svn_diff = getOutputOfSysCommand("svn diff")
         if svn_diff == "":
             sublime.messageBox("No changes to commit")
         else:
             createWindowWithText(view, svn_diff)
             window.showInputPanel("svn commit", "message here", self.commit, None, self.commitCancelled)
Esempio n. 4
0
 def run(self, view, args):
     window = sublime.activeWindow()
     project_file = window.project().fileName()
     os.chdir(os.path.dirname(project_file))
     if (args[0] == "status" or args[0] == "add"):
         if (args[0] == "status"):
             svn_cmd = "svn status"
         elif (args[0] == "add"):
             svn_cmd = "svn add \"" + view.fileName() + "\""
         svn_output = getOutputOfSysCommand(svn_cmd)
         sublime.messageBox(svn_output)
     elif (args[0] == "commit"):
         svn_diff = getOutputOfSysCommand("svn diff")
         if (svn_diff == ""):
             sublime.messageBox("No changes to commit")
         else:
             createWindowWithText(view, svn_diff)
             window.showInputPanel("svn commit", "message here",
                                   self.commit, None, self.commitCancelled)
    def run(self, view, args):
        if len(args) == 0:
            sublime.messageBox("You didn't select anything.")
        else:
            name = args[0]
            url = packagedownloader.packageRoot() + name + ".sublime-package"
            answer = sublime.questionBox("Download '%s'?" % url)
            if answer:
                localPackageRoot = packagedownloader.packageDir()
                if localPackageRoot == None:
                    sublime.messageBox("Could not find package folder. Sorry.")
                    return
                destination = "c:/downloaded-by-sublime-text-package-downloader.sublime-package"
                packagedownloader.downloadSinglePackage(url, destination)

                packageFolder = os.path.join(localPackageRoot, name)

                existsAlready = ""
                if os.path.exists(packageFolder):
                    existsAlready = " This folder already exists and will be replaced."

                unpackAnswer = sublime.questionBox(
                    "Download succeeded. Do you wish to install in '%s'?%s " % (packageFolder, existsAlready)
                )
                if not unpackAnswer:
                    os.remove(destination)
                    return

                self.expandPackage(destination, packageFolder)
                os.remove(destination)
                sublime.messageBox("Unpacked to %s" % packageFolder)
Esempio n. 6
0
 def commit(self, message):
     svn_output = getOutputOfSysCommand("svn commit -m \"" + message + "\"")
     sublime.runCommand("close")
     sublime.messageBox("Commit successful")
Esempio n. 7
0
 def commitCancelled(self):
     sublime.messageBox("Commit cancelled")
 def commit(self, message):
     svn_output = getOutputOfSysCommand('svn commit -m "' + message + '"')
     sublime.runCommand("close")
     sublime.messageBox("Commit successful")
 def commitCancelled(self):
     sublime.messageBox("Commit cancelled")
    def run(self, view, args):
        sublime.messageBox(`dir(P4)`)

################################################################################