• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python sublime.arch函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中sublime.arch函数的典型用法代码示例。如果您正苦于以下问题:Python arch函数的具体用法?Python arch怎么用?Python arch使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了arch函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: run

    def run(self, edit, encoding, file_name):
        self.view.set_name("ConvertToUTF8 Instructions")
        self.view.set_scratch(True)
        self.view.settings().set("word_wrap", True)
        msg = "Oops! The file {0} is detected as {1} which is not supported by your Sublime Text.\n\nPlease check whether it is in the list of Python's Standard Encodings (http://docs.python.org/library/codecs.html#standard-encodings) or not.\n\nIf yes, ".format(
            file_name, encoding
        )
        branch = self.get_branch(sublime.platform(), sublime.arch())
        if branch:
            ver = "33" if ST3 else "26"
            msg = (
                msg
                + "please install Codecs{0} (https://github.com/seanliang/Codecs{0}/tree/{1}) and restart Sublime Text to make ConvertToUTF8 work properly. If it is still not working, ".format(
                    ver, branch
                )
            )

        import platform

        msg = (
            msg
            + "please kindly send the following information to sunlxy#yahoo.com:\n====== Debug Information ======\nVersion: {0}-{1}\nPlatform: {2}\nPath: {3}\nEncoding: {4}\n".format(
                sublime.version(), sublime.arch(), platform.platform(), sys.path, encoding
            )
        )
        self.view.insert(edit, 0, msg)
        self.view.set_read_only(True)
        self.view.window().focus_view(self.view)
开发者ID:dingdada,项目名称:tain335,代码行数:28,代码来源:ConvertToUTF8.py


示例2: run

    def run(self):
        if int(self.getLatestVersion()) == int(sublime.version()):
            print ("currently on latest version")
        else:
            print ("new version available")
            if sublime.platform() == "windows":
                #download the latest installer
                s = sublime.load_settings("Preferences.sublime-settings") #get the install path from preferences
                install_path = s.get("install_path", "")

                f = urllib2.urlopen("http://www.sublimetext.com/2")
                format = formatter.NullFormatter()
                parser = LinksParser(format)
                html = f.read() 
                parser.feed(html) #get the list of latest installer urls
                parser.close()
                urls = parser.get_links()
                if sublime.arch() == "x32":
                    download_link = urls[1]

                elif sublime.arch() == "x64":
                    download_link = urls[3]

                download_link = quote(download_link, safe="%/:=&?~#+!$,;'@()*[]")
                sublime.status_message('SublimeUpdater is downloading update')
                thr = BackgroundDownloader(download_link, install_path, download_link) #start the download thread
                threads = []
                threads.append(thr)
                thr.start()

            elif sublime.platform() == "linux":
                print "linux detected"
        
            elif sublime.platform() == "osx":
                print "mac detected"
开发者ID:Kaizhi,项目名称:SublimeUpdater,代码行数:35,代码来源:SublimeUpdater.py


示例3: get_cache

def get_cache():
    import platform
    import os
    if cindex.conf == None:
        try:
            cindex.conf = cindex.Config()
            cindex.arch = sublime.arch()
            cindex.register_enumerations()
            print(cindex.conf.library_file)
        except OSError as err:
            print(err)
            library = cindex.conf.library_file
            if os.system == 'Linux':
                common.error_message(
"""It looks like '%s' couldn't be loaded. On Linux use your package manager to install clang-3.7.1\n\n \
or alternatively download a pre-built binary from http://www.llvm.org and put it in your ~/bin/\n\n \
Visit https://github.com/ensisoft/SublimeClang for more information.""" % (library))
            else:
                common.error_message(
"""It looks like '%s' couldn't be loaded.\n\n \
Download a pre-built binary from http://www.llvm.org and install it in your system.\n\n \
Note that the architecture needs to match your SublimeText 2 architecture.\n\n \
Visit https://github.com/ensisoft/SublimeClang for more information.""" % (library))
            raise err

    if tulib.cachelib == None:
        libcache = ""
        packages = sublime.packages_path()
        package  = os.path.join(packages, "SublimeClang")
        arch     = sublime.arch()
        try:
            libname  = tulib.get_cache_library(arch)
            libcache = os.path.join(package, libname)

            tulib.init_cache_lib(libcache)
            print("Loaded: '%s'" % (libcache))
        except OSError as err:
            print(err)
            if os.system == 'Linux':
                common.error_message(
"""It looks like '%s' couldn't be loaded. On Linux you have to compile it yourself.\n\n \
Go to into your ~/.config/sublime-text-2/Packages/SublimeClang and run make.\n\n \
Visit https://github.com/ensisoft/SublimeClang for more information.""" % (libcache))
            else:
                common.error_message(
"""It looks like '%s' couldn't be loaded.\n\n \
Visit https://github.com/ensisoft/SublimeClang for more information.""" % (libcache))
            raise err

    if cache.tuCache == None:
        number_threads = 4
        cache.tuCache = TUCache(number_threads)

    return cache.tuCache
开发者ID:ensisoft,项目名称:SublimeClang,代码行数:54,代码来源:clang-complete.py


示例4: setup

def setup():
    if int(sublime.version()) < 3000:
        # Sublime Text 2 & Python 2.6
        messagehook.setup(callback)
    else:
        # Sublime Text 3 & Python 3.3
        globalhook.setup(sublime.arch() == 'x64')
开发者ID:edith-tky,项目名称:sublimetext2_env,代码行数:7,代码来源:imesupportplugin.py


示例5: plugin_loaded

def plugin_loaded():
    if DEBUG:
        UTC_TIME = datetime.utcnow()
        PYTHON = sys.version_info[:3]
        VERSION = sublime.version()
        PLATFORM = sublime.platform()
        ARCH = sublime.arch()
        PACKAGE = sublime.packages_path()
        INSTALL = sublime.installed_packages_path()

        message = (
            'Jekyll debugging mode enabled...\n'
            '\tUTC Time: {time}\n'
            '\tSystem Python: {python}\n'
            '\tSystem Platform: {plat}\n'
            '\tSystem Architecture: {arch}\n'
            '\tSublime Version: {ver}\n'
            '\tSublime Packages Path: {package}\n'
            '\tSublime Installed Packages Path: {install}\n'
        ).format(time=UTC_TIME, python=PYTHON, plat=PLATFORM, arch=ARCH,
                 ver=VERSION, package=PACKAGE, install=INSTALL)

        sublime.status_message('Jekyll: Debugging enabled...')
        debug('Plugin successfully loaded.', prefix='\n\nJekyll', level='info')
        debug(message, prefix='Jekyll', level='info')
开发者ID:nighthawk,项目名称:sublime-jekyll,代码行数:25,代码来源:jekyll.py


示例6: run

    def run(self, message):
        v = OutputPanel('dart.config.check')
        text = HEADING + '\n'
        text += ('=' * 80) + '\n'
        text += 'MESSAGE:\n'
        text += message + '\n'
        text += '\n'
        text += 'CONFIGURATION:\n'
        text += ('-' * 80) + '\n'
        text += "editor version: {} ({})".format(sublime.version(),
                                               sublime.channel())
        text += '\n'
        text += ('-' * 80) + '\n'
        text += "os: {} ({})".format(sublime.platform(),
                                   sublime.arch())
        text += '\n'
        text += ('-' * 80) + '\n'

        setts = sublime.load_settings('Dart - Plugin Settings.sublime-settings')
        text += "dart_sdk_path: {}".format(setts.get('dart_sdk_path'))
        text += '\n'

        text += '=' * 80

        v.write(text)
        v.show()
开发者ID:lgunsch,项目名称:config,代码行数:26,代码来源:AAA.py


示例7: setup

def setup():
    if int(sublime.version()) < 3000:
        # Sublime Text 2 & Python 2.6
        pass
    else:
        # Sublime Text 3 & Python 3.3
        globalhook.setup(sublime.arch() == 'x64')
开发者ID:Mondego,项目名称:pyreco,代码行数:7,代码来源:allPythonContent.py


示例8: _PrintDebugInfo

def _PrintDebugInfo():
    """Prints debug info into the sublime console."""
    if not is_debug():
        return
    message = (
        'AutoPEP8:'
        '\n\tsublime: version=%(subl_version)s, platform=%(subl_platform)s,'
        ' arch=%(subl_arch)s,'
        ' packages_path=%(subl_packages)s\n,'
        ' installed_packages_path=%(subl_installed_packages)s'
        '\n\tplugin: version=%(plugin_version)s'
        '\n\tconfig: %(config)s'
    )
    config_keys = (
        'max-line-length', 'list-fixes', 'ignore', 'select', 'aggressive',
        'indent-size', 'format_on_save', 'syntax_list',
        'file_menu_search_depth', 'avoid_new_line_in_select_mode', 'debug',
    )
    config = {}
    for key in config_keys:
        config[key] = Settings(key, None)

    message_values = {
        'plugin_version': VERSION,
        'subl_version': sublime.version(),
        'subl_platform': sublime.platform(),
        'subl_arch': sublime.arch(),
        'subl_packages': sublime.packages_path(),
        'subl_installed_packages': sublime.installed_packages_path(),
        'config': config
    }
    get_logger().debug(message, message_values)
开发者ID:Noxeus,项目名称:SublimeAutoPEP8,代码行数:32,代码来源:sublautopep8.py


示例9: collect

    def collect(self):
        self.elements.clear()

        db0 = DataBlock('Version and architecture')
        db0.items.append(DataItem('name', 'Sublime Text'))
        db0.items.append(DataItem('version', sublime.version()))
        db0.items.append(DataItem('architecture', sublime.arch()))
        db0.items.append(DataItem('channel', sublime.channel()))
        db0.items.append(DataItem('platform', sublime.platform()))

        view = sublime.active_window().active_view()
        view_settings = view.settings()

        db1 = DataBlock('View settings')
        for setting_name in ('syntax', 'tab_size', 'translate_tabs_to_spaces'):
            db1.items.append(DataItem(setting_name, view_settings.get(setting_name)))

        db2 = DataBlock('View state')
        db2.items.append(DataItem('is view dirty', view.is_dirty()))
        db2.items.append(DataItem('is view readonly', view.is_read_only()))
        db1.items.append(DataItem('encoding', view.encoding()))
        db1.items.append(DataItem('em width', view.em_width()))
        db1.items.append(DataItem('selection count', len(view.sel())))
        db1.items.append(DataItem('has non empty selections', view.has_non_empty_selection_region()))

        self.elements.append(db0)

        # TODO: Split the rest up into methods.
        self.collect_package_data()

        self.elements.append(db1)
        self.elements.append(db2)

        self.collect_profiling_data()
开发者ID:guillermooo,项目名称:sublime-troubleshooting,代码行数:34,代码来源:editor_info.py


示例10: generate_dependency_paths

def generate_dependency_paths(name):
    """
    Accepts a dependency name and generates a dict containing the three standard
    import paths that are valid for the current machine.

    :param name:
        A unicode string name of the dependency

    :return:
        A dict with the following keys:
         - 'ver'
         - 'plat'
         - 'arch'
    """

    packages_dir = os.path.join(st_dir, u'Packages')
    dependency_dir = os.path.join(packages_dir, name)

    ver = u'st%s' % st_version
    plat = sublime.platform()
    arch = sublime.arch()

    return {
        'all': os.path.join(dependency_dir, 'all'),
        'ver': os.path.join(dependency_dir, ver),
        'plat': os.path.join(dependency_dir, u'%s_%s' % (ver, plat)),
        'arch': os.path.join(dependency_dir, u'%s_%s_%s' % (ver, plat, arch))
    }
开发者ID:Nielingluo,项目名称:Sublime-Text-2,代码行数:28,代码来源:sys_path.py


示例11: get_predefined_param

 def get_predefined_param(self, match):
     '''{%%}'''
     key = match.group(1)
     if key == 'filename':
         return os.path.basename(self.view.file_name() or '')
     elif key == 'filepath':
         return self.view.file_name() or ''
     elif key == 'dirname':
         return os.path.dirname(self.view.file_name() or '')
     elif key == 'platform':
         return sublime.platform()
     elif key == 'arch':
         return sublime.arch()
     elif key == 'encoding':
         encoding = self.view.encoding()
         return encoding if 'Undefined' != encoding else self.settings.get('default_encoding')
     elif key == 'ip':
         return get_local_ip()
     elif key == 'user':
         user = os.getlogin() if 'windows' != sublime.platform() else ''
         if user:
             return user
             #windows?
         user = os.popen('whoami').read()
         p = re.compile('[\r\n]', re.M)
         return re.sub(p, '', user)
     elif key == 'ext':
         return get_ext(self.view.file_name())
     elif key == 'year':
         t = datetime.datetime.today()
         return t.strftime('%Y')
     elif key == 'datetime':
         t = datetime.datetime.today()
         return t.strftime(self.get_action_param('datetime_format', '%Y-%m-%d %H:%M:%S'))
     return match.group(1)
开发者ID:yanni4night,项目名称:sublime-custominsert,代码行数:35,代码来源:Custominsert.py


示例12: is_compatible

    def is_compatible(self, metadata):
        """
        Detects if a package is compatible with the current Sublime Text install

        :param metadata:
            A dict from a metadata file

        :return:
            If the package is compatible
        """

        sublime_text = metadata.get("sublime_text")
        platforms = metadata.get("platforms", [])

        # This indicates the metadata is old, so we assume a match
        if not sublime_text and not platforms:
            return True

        if not is_compatible_version(sublime_text):
            return False

        if not isinstance(platforms, list):
            platforms = [platforms]

        platform_selectors = [sublime.platform() + "-" + sublime.arch(), sublime.platform(), "*"]

        for selector in platform_selectors:
            if selector in platforms:
                return True

        return False
开发者ID:Nielingluo,项目名称:Sublime-Text-2,代码行数:31,代码来源:package_cleanup.py


示例13: get_dict_arch_path

def get_dict_arch_path():
    """Return Dict_arch.zip path."""
    arch = sublime.arch()
    if arch == "x32":
        return os.path.join(BASE_PATH, "Dict32.zip")
    elif arch == "x64":
        return os.path.join(BASE_PATH, "Dict64.zip")
开发者ID:rexdf,项目名称:SublimeChineseConvert,代码行数:7,代码来源:SublimeChineseConvert.py


示例14: get_support_info

def get_support_info():
    pc_settings = sublime.load_settings('Package Control.sublime-settings')
    is_installed_by_pc = str(PACKAGE_NAME in set(pc_settings.get('installed_packages', [])))
    info = {}
    info['channel'] = sublime.channel()
    info['version'] = sublime.version()
    info['platform'] = sublime.platform()
    info['arch'] = sublime.arch()
    info['package_name'] = PACKAGE_NAME
    info['package_version'] = PACKAGE_VERSION
    info['pc_install'] = is_installed_by_pc
    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!'
    return '''%(package_name)s:\n\n* version: %(package_version)s\n* installed via Package Control: %(pc_install)s\n\nSublime Text:\n\n* channel: %(channel)s\n* version: %(version)s\n* platform: %(platform)s\n* architecture: %(arch)s\n\nDependency versions:\n\n* mdpopups: %(mdpopups_version)s\n* markdown: %(markdown_version)s\n* pygments: %(pygments_version)s\n* jinja2: %(jinja_version)s''' % info
开发者ID:Briles,项目名称:gruvbox,代码行数:32,代码来源:support.py


示例15: send_to_api

    def send_to_api(self):
        """
        Send archive file to API
        """
        self.set_message("Sending archive...")
        f = open(self.archive_filename, 'rb')

        files = {
            'package': f.read(),
            'version': sublime.version()[:1],
            'platform': sublime.platform(),
            'arch': sublime.arch(),
            'email': self.email,
            'api_key': self.api_key,
        }

        # Send data and delete temporary file
        try:
            r = requests.post(
                url=self.api_upload_url, files=files, timeout=50)
        except requests.exceptions.ConnectionError as err:
            self.set_timed_message(
                "Error while sending archive: server not available, try later",
                clear=True)
            self.running = False
            logger.error(
                'Server (%s) not available, try later.\n'
                '==========[EXCEPTION]==========\n'
                '%s\n'
                '===============================' % (
                    self.api_upload_url, err))
            return

        f.close()
        os.unlink(self.archive_filename)

        if r.status_code == 201:
            self.set_timed_message("Successfully sent archive", clear=True)
            logger.info('HTTP [%s] Successfully sent archive' % r.status_code)
        elif r.status_code == 403:
            self.set_timed_message(
                "Error while sending archive: wrong credentials", clear=True)
            logger.info('HTTP [%s] Bad credentials' % r.status_code)
        elif r.status_code == 413:
            self.set_timed_message(
                "Error while sending archive: filesize too large (>20MB)", clear=True)
            logger.error("HTTP [%s] %s" % (r.status_code, r.content))
        else:
            msg = "Unexpected error (HTTP STATUS: %s)" % r.status_code
            try:
                j = r.json()
                for error in j.get('errors'):
                    msg += " - %s" % error
            except:
                pass
            self.set_timed_message(msg, clear=True, time=10)
            logger.error('HTTP [%s] %s' % (r.status_code, r.content))

        self.post_send()
开发者ID:cybernetics,项目名称:Sublimall,代码行数:59,代码来源:upload_command.py


示例16: _color_picker_file

def _color_picker_file():
    executable_suffix = None
    platform = sublime.platform()
    if platform == "windows":
        executable_suffix = "win.exe"
    else:
        executable_suffix = "%s_%s" % (platform, sublime.arch())
    return "ColorPicker_" + executable_suffix
开发者ID:DavidPesta,项目名称:ColorHighlighter,代码行数:8,代码来源:path.py


示例17: run

	def run(self, selector=None, action=""):
		if self.action != "":
			action = self.action
			self.action = ""
		if action == "additional_packages":
			view = self.window.new_file()
			view.set_name("Javatar - Additional Packages")
			view.set_scratch(True)
			view.run_command("javatar_util", {"type": "insert", "text": "==== This section is under development ====\n\nAdditional packages\n========\n   To reduce plugin size, Javatar provides additional packages for different version of Java you are working.\n\nHere are all available packages:\n\nJavaSE7: http://\nJavaSE8: http://\nJavaFX8: http://\n\n==== This section is under development ===="})
		if action == "actions_history":
			if not getSettings("enable_actions_history"):
				sublime.message_dialog("Actions History is disabled. Please enable them first.")
				return
			self.action = action
			if selector is not None:
				report = "## Javatar Report\n### System Informations\n* Javatar Version: `%javatar_version%`\n* Sublime Version: `%sublime_version%`\n* Package Path: `%packages_path%`\n* Javatar Channel: `%javatar_channel%`\n* Sublime Channel: `%sublime_channel%`\n* Platform: `%platform%`\n* As Packages: `%is_package%`\n* Package Control: `%package_control%`\n* Architecture: `%arch%`\n* Javatar's Parent Folder: `%parent_folder%`\n* Is Project: `%is_project%`\n* Is File: `%is_file%`\n* Is Java: `%is_java%`\n\n### Action List\n%actions%"
				report = report.replace("%javatar_version%", getVersion())
				report = report.replace("%javatar_channel%", str.lower(getSettings("package_channel")))
				report = report.replace("%is_package%", str(getPath("exist", getPath("join", sublime.installed_packages_path(), "Javatar.sublime-package"))))
				report = report.replace("%parent_folder%", getPath("javatar_parent"))

				report = report.replace("%sublime_version%", str(sublime.version()))
				report = report.replace("%sublime_channel%", sublime.channel())
				report = report.replace("%package_control%", str(getPath("exist", getPath("join", sublime.packages_path(), "Package Control")) or getPath("exist", getPath("join", sublime.installed_packages_path(), "Package Control.sublime-package"))))
				report = report.replace("%is_project%", str(isProject()))
				report = report.replace("%is_file%", str(isFile()))
				report = report.replace("%is_java%", str(isJava()))

				report = report.replace("%packages_path%", sublime.packages_path())
				report = report.replace("%platform%", sublime.platform())
				report = report.replace("%arch%", sublime.arch())

				selectors = selector.split("|")
				if len(selectors) > 1:
					include = selectors[0].split(",")
					exclude = selectors[1].split(",")
				else:
					include = selectors[0].split(",")
					exclude = []

				actionText = ""
				actions = getAction().getAction(include, exclude)
				c = 1
				for action in actions:
					if c > 1:
						actionText += "\n"
					actionText += str(c) + ". " + action
					c += 1
				report = report.replace("%actions%", actionText)

				view = self.window.new_file()
				view.set_name("Javatar Actions History Report")
				view.set_scratch(True)
				view.run_command("javatar_util", {"type": "add", "text": report, "dest": "Actions History"})
				view.run_command("javatar_util", {"type": "set_read_only"})
			else:
				self.window.show_input_panel("Selector: ", "", self.run, "", "")
开发者ID:jontyq,项目名称:Javatar,代码行数:57,代码来源:javatar_help.py


示例18: run

    def run(self):
        """Run command."""

        info = {}

        info["platform"] = sublime.platform()
        info["version"] = sublime.version()
        info["arch"] = sublime.arch()
        info["bh_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(
            """\
            - Sublime Text:   %(version)s
            - Platform:   %(platform)s
            - Arch:   %(arch)s
            - Theme:   %(bh_version)s
            - Install via PC:   %(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, max_height = 340)
开发者ID:themycode,项目名称:material-theme,代码行数:56,代码来源:info.py


示例19: collect_all_options

def collect_all_options(view, filename, language):
    assert view is not None
    assert filename is not None
    assert language is not None
    assert language.is_supported()
    assert cindex.conf is not None

    global SystemIncludes

    # use clang to figure out the magical -isystem paths
    # todo: ObjC and ObjCPP ??
    if SystemIncludes == None:
        packages = sublime.packages_path()
        package  = os.path.join(packages, "SublimeClang")
        source = ""
        compiler = ""
        cindex.conf.arch = sublime.arch()
        if language.kind == Language.C:
            source = "test.c"
            compiler = cindex.conf.locate_clang()
        elif language.kind == Language.CPP:
            source = "test.cpp"
            compiler = cindex.conf.locate_clang_cpp()
        else:
            raise Error("Unsupported language.")

        source = os.path.join(package, source)
        info = common.ClangInfo.collect(compiler, source)
        SystemIncludes = info.internal_isystem
        print("Found system includes:")
        print(SystemIncludes)

    # this is how we got it from the settings before...
    #sys_includes = common.get_setting("system_include_paths", [])

    opt = CompileOptions(language, SystemIncludes)

    # This is the bitmask sent to index.parse.
    # For example, to be able to go to the definition of
    # preprocessed macros, set it to 1, for using an implicit
    # precompiled header set it to 4 and for caching completion
    # results, set it to 8. Or all together 1+4+8=13.
    # See http://clang.llvm.org/doxygen/group__CINDEX__TRANSLATION__UNIT.html#gab1e4965c1ebe8e41d71e90203a723fe9
    # and http://clang.llvm.org/doxygen/Index_8h_source.html
    # for more details
    opt.index_parse_type = 13

    language_options = common.get_setting("language_options", {})
    if language_options.has_key(language.key()):
        opt.language_options = language_options[language.key()]

    project_file, project_options = common.get_project_settings(filename)
    if project_file != None:
        opt.project_file = project_file
        opt.project_options  = project_options
    return opt
开发者ID:ensisoft,项目名称:SublimeClang,代码行数:56,代码来源:clang-complete.py


示例20: run

    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:trongthanh,项目名称:dotfiles,代码行数:55,代码来源:environment.py



注:本文中的sublime.arch函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python sublime.cache_path函数代码示例发布时间:2022-05-27
下一篇:
Python sublime.active_window函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap