当前位置: 首页>>代码示例>>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;未经允许,请勿转载。