本文整理汇总了Python中sublime.arch方法的典型用法代码示例。如果您正苦于以下问题:Python sublime.arch方法的具体用法?Python sublime.arch怎么用?Python sublime.arch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sublime
的用法示例。
在下文中一共展示了sublime.arch方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_tabnine_path
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import arch [as 别名]
def get_tabnine_path(binary_dir):
def join_path(*args):
return os.path.join(binary_dir, *args)
translation = {
("linux", "x32"): "i686-unknown-linux-musl/TabNine",
("linux", "x64"): "x86_64-unknown-linux-musl/TabNine",
("osx", "x32"): "i686-apple-darwin/TabNine",
("osx", "x64"): "x86_64-apple-darwin/TabNine",
("windows", "x32"): "i686-pc-windows-gnu/TabNine.exe",
("windows", "x64"): "x86_64-pc-windows-gnu/TabNine.exe",
}
versions = os.listdir(binary_dir)
versions.sort(key=parse_semver, reverse=True)
for version in versions:
key = sublime.platform(), sublime.arch()
path = join_path(version, translation[key])
if os.path.isfile(path):
add_execute_permission(path)
print("TabNine: starting version", version)
return path
示例2: setLocale
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import arch [as 别名]
def setLocale(locale, force = False):
if not locale:
return
if (not force) and locale == getSetting('locale'):
return
link = getLink(locale)
if link:
locale = link
m = {}
d = os.path.join(mDir, v, locale)
m.update(findMenu(d))
sDir = ''
d = os.path.join(mDir, version)
ld = os.path.join(d, locale)
if (not os.path.isdir(ld)) and getSetting('findSimilarVer', True):
sDir = findSimilarVer(locale)
if not sDir:
return
d = os.path.join(mDir, sDir)
d = os.path.join(d, locale)
if not os.path.isdir(d):
return
m.update(findMenu(d))
d = os.path.join(d, p)
m.update(findMenu(d))
d = os.path.join(d, sublime.arch())
m.update(findMenu(d))
updateMenu(m)
if getSetting('updateTopMenu', True):
updateTopMenu(locale)
sublime.status_message('Locale ' + locale + ' has loaded.')
示例3: has_libclang
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import arch [as 别名]
def has_libclang():
"""Ensure libclang tests will run only on platforms that support this.
Returns:
str: row contents
"""
# Older version of Sublime Text x64 have ctypes crash bug.
if platform.system() == "Windows" and sublime.arch() == "x64" and \
int(sublime.version()) < 3123:
return False
return True
# TODO(@kjteske): For now the tests seem to not be working for binary completer
示例4: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import arch [as 别名]
def run(self):
info = {}
info['platform'] = sublime.platform()
info['version'] = sublime.version()
info['arch'] = sublime.arch()
info['boxy_version'] = __version__
info['pc_install'] = is_installed_by_package_control()
try:
import mdpopups
info['mdpopups_version'] = format_version(mdpopups, 'version',
call=True)
except Exception:
info['mdpopups_version'] = 'Version could not be acquired!'
try:
import markdown
info['markdown_version'] = format_version(markdown, 'version')
except Exception:
info['markdown_version'] = 'Version could not be acquired!'
try:
import jinja2
info['jinja_version'] = format_version(jinja2, '__version__')
except Exception:
info['jinja_version'] = 'Version could not be acquired!'
try:
import pygments
info['pygments_version'] = format_version(pygments, '__version__')
except Exception:
info['pygments_version'] = 'Version could not be acquired!'
msg = textwrap.dedent(
'''\
- Boxy Theme: %(boxy_version)s
- Sublime Text: %(version)s
- Platform: %(platform)s
- Package Control: %(pc_install)s
- Dependencies:
* mdpopups: %(mdpopups_version)s
* markdown: %(markdown_version)s
* pygments: %(pygments_version)s
* jinja2: %(jinja_version)s
''' % info
)
view = sublime.active_window().active_view()
def copy_and_hide(msg):
sublime.set_clipboard(msg)
view.hide_popup()
view.show_popup(msg.replace('\n', '<br>') +
'<br><a href="' + msg + '">Copy</a>',
on_navigate=copy_and_hide)
示例5: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import arch [as 别名]
def run(self):
"""Run command."""
info = {}
info["platform"] = sublime.platform()
info["version"] = sublime.version()
info["arch"] = sublime.arch()
info["plugin_version"] = __version__
info["pc_install"] = is_installed_by_package_control()
try:
import mdpopups
info["mdpopups_version"] = format_version(mdpopups, 'version', call=True)
except Exception:
info["mdpopups_version"] = 'Version could not be acquired!'
try:
import markdown
info["markdown_version"] = format_version(markdown, 'version')
except Exception:
info["markdown_version"] = 'Version could not be acquired!'
try:
import jinja2
info["jinja_version"] = format_version(jinja2, '__version__')
except Exception:
info["jinja_version"] = 'Version could not be acquired!'
try:
import pygments
info["pygments_version"] = format_version(pygments, '__version__')
except Exception:
info["pygments_version"] = 'Version could not be acquired!'
msg = textwrap.dedent(
"""\
- ST ver.: %(version)s
- Platform: %(platform)s
- Arch: %(arch)s
- Plugin ver.: %(plugin_version)s
- Install via PC: %(pc_install)s
- mdpopups ver.: %(mdpopups_version)s
- markdown ver.: %(markdown_version)s
- pygments ver.: %(pygments_version)s
- jinja2 ver.: %(jinja_version)s
""" % info
)
sublime.message_dialog(msg + '\nInfo has been copied to the clipboard.')
sublime.set_clipboard(msg)