當前位置: 首頁>>代碼示例>>Python>>正文


Python sublime.executable_path方法代碼示例

本文整理匯總了Python中sublime.executable_path方法的典型用法代碼示例。如果您正苦於以下問題:Python sublime.executable_path方法的具體用法?Python sublime.executable_path怎麽用?Python sublime.executable_path使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sublime的用法示例。


在下文中一共展示了sublime.executable_path方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: subl

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import executable_path [as 別名]
def subl(*args):
    executable_path = sublime.executable_path()
    if sublime.platform() == 'osx':
        app_path = executable_path[:executable_path.rfind('.app/') + 5]
        executable_path = app_path + 'Contents/SharedSupport/bin/subl'

    subprocess.Popen([executable_path] + list(args))

    def on_activated():
        window = sublime.active_window()
        view = window.active_view()

        if sublime.platform() == 'windows':
            # fix focus on windows
            window.run_command('focus_neighboring_group')
            window.focus_view(view)

        sublime_plugin.on_activated(view.id())
        sublime.set_timeout_async(lambda: sublime_plugin.on_activated_async(view.id()))

    sublime.set_timeout(on_activated, 300) 
開發者ID:randy3k,項目名稱:ProjectManager,代碼行數:23,代碼來源:project_manager.py

示例2: subl

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import executable_path [as 別名]
def subl(args):
  
  executable_path = sublime_executable_path()
  args = [executable_path] + args
  args_list = list()

  if sublime.platform() == 'windows' :
    for arg in args :
      args_list.append(json.dumps(arg, ensure_ascii=False))
  else :
    for arg in args :
      args_list.append(shlex.quote(arg))
  
  args = " ".join(args_list)

  return subprocess.Popen(args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
開發者ID:pichillilorenzo,項目名稱:JavaScriptEnhancements,代碼行數:18,代碼來源:util.py

示例3: launch_ST3

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import executable_path [as 別名]
def launch_ST3(self, files):
        executable_path = sublime.executable_path()
        if OSX:
            app_path = executable_path[:executable_path.rfind(".app/")+5]
            executable_path = app_path+"Contents/SharedSupport/bin/subl"
        items = [executable_path, "-n"] + files
        subprocess.Popen(items, cwd=None if NT else self.path) 
開發者ID:aziz,項目名稱:SublimeFileBrowser,代碼行數:9,代碼來源:dired_misc.py

示例4: open_project

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import executable_path [as 別名]
def open_project(self, open_path):
        executable_path = sublime.executable_path()
        if sublime.platform() == 'osx':
            app_path = executable_path[:executable_path.rfind(".app/") + 5]
            executable_path = app_path + "Contents/SharedSupport/bin/subl"

        if sublime.platform() == "windows":
            subprocess.Popen('"{0}" --project "{1}"'.format(executable_path, open_path), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
        else:
            process = subprocess.Popen([executable_path, '--project', open_path], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
            stdout, stderr = process.communicate()
            self.debug(stdout)
            self.showlog(stderr) 
開發者ID:exiahuang,項目名稱:SalesforceXyTools,代碼行數:15,代碼來源:uiutil.py

示例5: init

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import executable_path [as 別名]
def init():
	absDir = os.path.dirname(os.path.abspath(__file__))
	if v == '3' and os.path.isfile(absDir):
		pkgDir = os.path.join(sublime.packages_path(), pName);
		if not os.path.isdir(pkgDir):
			unpackSelf(absDir, pkgDir)
		return
	locale = ''
	firstRun = False
	fFile = os.path.join(pDir, '.firstRun')
	if not os.path.isfile(fFile):
		firstRun = True
		backupMenu()
		open(fFile, 'wt').write('')
		locale = getSetting('locale', '')
	eDir = os.path.join(mDir, version, 'en');
	if v == '3' and not os.path.isdir(eDir):
		eFile = sublime.executable_path();
		dFile = os.path.join(os.path.dirname(eFile), 'Packages', 'Default.sublime-package');
		unpackMenu(dFile, eDir);
	makeMenu(locale, firstRun)
	makeCommand(locale, firstRun)
	setLocale(locale, firstRun)

	s = sublime.load_settings(sFile)
	s.add_on_change('locale', updateLocale) 
開發者ID:zam1024t,項目名稱:LocalizedMenu,代碼行數:28,代碼來源:Localize.py

示例6: sublime_executable_path

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import executable_path [as 別名]
def sublime_executable_path():
  executable_path = sublime.executable_path()

  if sublime.platform() == 'osx':
    app_path = executable_path[:executable_path.rfind(".app/") + 5]
    executable_path = app_path + "Contents/SharedSupport/bin/subl"

  elif sublime.platform() == 'windows':
    executable_path = os.path.join(os.path.dirname(executable_path), "subl.exe")

  return executable_path 
開發者ID:pichillilorenzo,項目名稱:JavaScriptEnhancements,代碼行數:13,代碼來源:util.py

示例7: get_builtin_pkg_path

# 需要導入模塊: import sublime [as 別名]
# 或者: from sublime import executable_path [as 別名]
def get_builtin_pkg_path():
    base_path = os.path.dirname(sublime.executable_path())
    ret = os.path.join(base_path, 'Packages')
    return ret 
開發者ID:rexdf,項目名稱:Chinese-Localization,代碼行數:6,代碼來源:Localization.py


注:本文中的sublime.executable_path方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。