本文整理汇总了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)
示例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)
示例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)
示例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)
示例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)
示例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
示例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