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


Python sublime.arch方法代碼示例

本文整理匯總了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 
開發者ID:codota,項目名稱:tabnine-sublime,代碼行數:22,代碼來源:TabNine.py

示例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.') 
開發者ID:zam1024t,項目名稱:LocalizedMenu,代碼行數:41,代碼來源:Localize.py

示例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 
開發者ID:niosus,項目名稱:EasyClangComplete,代碼行數:16,代碼來源:test_complete.py

示例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) 
開發者ID:bofm,項目名稱:sublime-boxy-theme,代碼行數:57,代碼來源:environment.py

示例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) 
開發者ID:facelessuser,項目名稱:ColorHelper,代碼行數:52,代碼來源:support.py


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