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

Python sublime.save_settings函数代码示例

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

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



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

示例1: on_panel_close

			def on_panel_close(i):
				if i == 1 or i == 2:
					view = win.open_file(changelog_fn)
					if i == 1:
						run_go_get(view)
						settings.set('tracking_rev', new_rev)
						sublime.save_settings(settings_fn)
开发者ID:feidianbo,项目名称:GoSublime,代码行数:7,代码来源:gsdepends.py


示例2: on_done_filename

    def on_done_filename(self, value):
        self.filename = value
        # get selected text, or the whole file if nothing selected
        if all([region.empty() for region in self.view.sel()]):
            text = self.view.substr(sublime.Region(0, self.view.size()))
        else:
            text = "\n".join([self.view.substr(region) for region in self.view.sel()])

        try:
            gist = self.gistapi.create_gist(description=self.description,
                                            filename=self.filename,
                                            content=text,
                                            public=self.public)
            self.view.settings().set('gist', gist)
            sublime.set_clipboard(gist["html_url"])
            sublime.status_message(self.MSG_SUCCESS)
        except GitHubApi.UnauthorizedException:
            # clear out the bad token so we can reset it
            self.settings.set("github_token", "")
            sublime.save_settings("GitHub.sublime-settings")
            sublime.error_message(self.ERR_UNAUTHORIZED_TOKEN)
            sublime.set_timeout(self.get_username, 50)
        except GitHubApi.UnknownException as e:
            sublime.error_message(e.message)
        except GitHubApi.ConnectionException as e:
            sublime.error_message(e.message)
开发者ID:Mikerobenics,项目名称:sublime-github,代码行数:26,代码来源:sublime_github.py


示例3: on_done_password

 def on_done_password(self, value):
     "Callback for the password show_input_panel"
     self.github_password = value
     try:
         api = GitHubApi(self.base_uri, debug=self.debug)
         self.github_token = api.get_token(self.github_user,
                                           self.github_password,
                                           self.github_one_time_password)
         self.github_password = self.github_one_time_password = None  # don't keep these around
         self.accounts[self.active_account]["github_token"] = self.github_token
         self.settings.set("accounts", self.accounts)
         sublime.save_settings("GitHub.sublime-settings")
         self.gistapi = GitHubApi(self.base_uri, self.github_token, debug=self.debug)
         try:
             if self.callback:
                 sublime.error_message(self.MSG_TOKEN_SUCCESS)
                 callback = self.callback
                 self.callback = None
                 sublime.set_timeout(callback, 50)
         except AttributeError:
             pass
     except GitHubApi.OTPNeededException:
         sublime.set_timeout(self.get_one_time_password, 50)
     except GitHubApi.UnauthorizedException:
         sublime.error_message(self.ERR_UNAUTHORIZED)
         sublime.set_timeout(self.get_username, 50)
     except GitHubApi.UnknownException as e:
         sublime.error_message(e.message)
开发者ID:Mikerobenics,项目名称:sublime-github,代码行数:28,代码来源:sublime_github.py


示例4: _save_test_run

    def _save_test_run(self, command: str) -> None:
        """Save the last ran test
        """

        s = sublime.load_settings('PythonTestRunner.last-run')
        s.set('last_test_run', command)
        sublime.save_settings('PythonTestRunner.last-run')
开发者ID:Cesar456,项目名称:Sublime_Text3_Properties-Pacage,代码行数:7,代码来源:test_runner.py


示例5: generate

    def generate(self, sourcePath):
        if not sourcePath:
            return

        if not os.path.isdir(sourcePath):
            sublime.error_message("'{0}' is not a valid path to a directory.".format(sourcePath))
            return

        appKitPath = join(sourcePath, "AppKit")
        foundationPath = join(sourcePath, "Foundation")

        if not os.path.isdir(appKitPath) or not os.path.isdir(foundationPath):
            sublime.error_message("'{0}' does not appear to be a Cappuccino source directory.".format(sourcePath))
            return

        self.parse_source_directory(appKitPath)
        self.parse_source_directory(foundationPath)
        self.write_instance_methods()
        self.write_class_methods()
        self.write_classes()
        self.write_functions()
        self.write_constants()

        # If we make it this far, save the path so next time the user does not have to enter it
        settings = sublime.load_settings(self.OBJECTIVEJ_SETTINGS)
        settings.set(self.CAPPUCCINO_SOURCE_PATH_SETTING, sourcePath)
        sublime.save_settings(self.OBJECTIVEJ_SETTINGS)

        sublime.error_message("Cappuccino completions successfully generated.")
开发者ID:anddam,项目名称:Cappuccino-Sublime,代码行数:29,代码来源:Plugin-generate_capp_completions.py


示例6: on_select_done

    def on_select_done(self, picked):
        entry = GetSearchEngineEntry(picked)

        settings = sublime.load_settings(__name__ + '.sublime-settings')
        settings.set('searchanywhere_searchengine', entry.get('name'))
        settings.set('searchanywhere_searchurl', entry.get('searchurl'))
        sublime.save_settings(__name__ + '.sublime-settings')
开发者ID:MeterSoft,项目名称:sublime-text-2,代码行数:7,代码来源:searchanywhere.py


示例7: modify_and_save_settings

    def modify_and_save_settings(self):
        settings = sublime.load_settings("Preferences.sublime-settings")

        settings.set("color_scheme", self.colors)
        settings.set("theme", self.theme)

        sublime.save_settings("Preferences.sublime-settings")
开发者ID:schnittchen,项目名称:sublime-helios,代码行数:7,代码来源:helios.py


示例8: save_config

	def save_config(self, filezilla_db_path):
		settings = sublime.load_settings("SublimeZilla.sublime-settings")
		settings.set("filezilla_db_path", filezilla_db_path)
		sublime.save_settings("SublimeZilla.sublime-settings")

		# Now, show the quick panel
		self.quick_panel()
开发者ID:carlwhittick,项目名称:SublimeZilla,代码行数:7,代码来源:SublimeZilla.py


示例9: handle_thread

    def handle_thread(thread, timeout):
        if thread.is_alive():
            sublime.set_timeout(lambda: handle_thread(thread, timeout), timeout)
            return
        
        # If succeed, something may happen,
        # for example, user password is expired
        result = api.result
        if result == None: return
        if "status_code" in result and result["status_code"] > 399: return

        # Load COMPONENT_METADATA_SETTINGS Settings and put all result into it
        # Every org has one local repository
        component_metadata = result
        component_settings = sublime.load_settings(COMPONENT_METADATA_SETTINGS)
        component_settings.set(toolingapi_settings["username"], component_metadata)
        sublime.save_settings(COMPONENT_METADATA_SETTINGS)
        print (message.SEPRATE.format('All code are Downloaded.'))
        sublime.status_message(message.DOWNLOAD_ALL_SUCCESSFULLY)

        # After Refresh all succeed, start initiate sobject completions
        handle_initiate_sobjects_completions(120)

        # If get_static_resource_body is true, 
        # start to get all binary body of static resource
        if toolingapi_settings["get_static_resource_body"]:
            handle_get_static_resource_body(toolingapi_settings)
开发者ID:cbforte,项目名称:Rpida,代码行数:27,代码来源:processor.py


示例10: on_done

	def on_done(self, index):
		saved_layouts = self.settings.get('saved_layouts')

		if index != -1:
			saved_layouts.pop(index)
			self.settings.set('saved_layouts', saved_layouts)
			sublime.save_settings('Origami.sublime-settings')
开发者ID:antstorm,项目名称:Origami,代码行数:7,代码来源:origami.py


示例11: save_config

 def save_config(self, value=None, type=None):
     self.settings.set('font_size', self.size)
     self.settings.set('font_face', self.face)
     self.update_options()
     sublime.save_settings(self.settings_id)
     if type:
         sublime.status_message("Fontafeelya: %s set to %s" % (type,value))
开发者ID:eibbors,项目名称:Fontofeelya,代码行数:7,代码来源:Fontofeelya.py


示例12: init

    def init(self):
        if self.inited:
            return

        sets = sublime.load_settings(settings_file)
        if get_version() < 3000:
            if sets.get("ha_style").startswith("underlined"):
                sets.set("ha_style", "outlined")
            if sets.get("icons"):
                sets.set("icons", False)
            if sets.get("icons_all"):
                sets.set("icons_all", False)
            sublime.save_settings(settings_file)

        for k in ["enabled", "style", "ha_style", "icons_all", "icons", "color_formats"]:
            self.settings[k] = sets.get(k)

        self.settings["color_fmts"] = list(map(get_format, self.settings["color_formats"]))

        sets.clear_on_change("ColorHighlighter")
        sets.add_on_change("ColorHighlighter", lambda: self.on_ch_settings_change())

        sets = sublime.load_settings("Preferences.sublime-settings")

        self.settings["color_scheme"] = sets.get("color_scheme")

        sets.clear_on_change("ColorHighlighter")
        sets.add_on_change("ColorHighlighter", lambda: self.on_g_settings_change())

        self.inited = True

        for w in sublime.windows():
            for v in w.views():
                self.init_view(v)
开发者ID:rocknrollMarc,项目名称:Sublime-Text-2,代码行数:34,代码来源:ColorHighlighter.py


示例13: cycle_scheme

def cycle_scheme(backward=False, purge=False):
    settings = sublime.load_settings('Preferences.sublime-settings')
    current_scheme = settings.get('color_scheme')

    raw_path = sublime.packages_path()
    package_path = fix_path(raw_path)

    schemes = ['/'.join([
            fix_path(dirpath[len(dirname(package_path)) + 1:]),
            filename,
        ])
        for dirpath, _, filenames in os.walk(package_path)
        for filename in filenames if filename.endswith('.tmTheme')
    ]
    schemes.sort(key=lambda x: basename(x))

    i = schemes.index(current_scheme) + (backward and -1 or 1)
    i = 0 if i == len(schemes) else len(schemes) - 1 if i == -1 else i

    scheme = schemes[i]
    if not scheme:
        return

    settings.set('color_scheme', scheme)
    sublime.save_settings('Preferences.sublime-settings')

    sublime.status_message(
        u'Color Scheme: ' + friendly_name(scheme)
    )

    if purge:
        purge_scheme(raw_path.rstrip('Packages'), current_scheme)
开发者ID:dshoreman,项目名称:sublime-scheme-arena,代码行数:32,代码来源:SchemeArena.py


示例14: ondone

 def ondone(mstr):
     settings = sublime.load_settings("luadbg.sublime-settings")
     global searchpaths
     if searchpaths.count(mstr) == 0:
         searchpaths.append(mstr)
     settings.set("searchpaths",searchpaths)
     sublime.save_settings("luadbg.sublime-settings")
开发者ID:Pythoner-xu,项目名称:LuaSoar,代码行数:7,代码来源:LuaSoar.py


示例15: onConfigDone

	def onConfigDone(self, data): 
		# print(self.window.project_data())
		global SETTINGS
		global CONFIG_PATH
		CONFIG_PATH = data
		if CONFIG_PATH == "":
			sublime.error_message(u"需设置 UI 资源路径!")
			return

		isOk = sublime.ok_cancel_dialog(u"是否将 UI 资源路径设置为: " + CONFIG_PATH  + " ?")

		if not isOk:
			self.window.show_input_panel(u"重新设置 UI 资源路径:", "", self.onConfigDone, None, self.onConfigCancel)
		else:
			# print(CONFIG_PATH)
			SETTINGS.set("UIResPath", CONFIG_PATH)
			#保存配置 在user目录下的 PUIEditor.sublime-settings文件
			sublime.save_settings(SETTING_FILE)

			projectData = self.window.project_data()
			folders = projectData['folders']
			folders.append({"path": CONFIG_PATH})
			self.window.set_project_data(projectData)


			snippetsGenerate = SnippetsGenerate()
			snippetsGenerate.dealFiles()
开发者ID:TgermPrj,项目名称:UIEditor,代码行数:27,代码来源:PUIEditor.py


示例16: run

    def run(self):
        try:
            debug('MavensMate Desktop installer running ...')

            ThreadProgress(self, "Installing MavensMate Desktop. This could take a few minutes.", '')
            self.install()

            settings = sublime.load_settings('mavensmate.sublime-settings')
            settings.set('mm_desktop_installed', True)
            sublime.save_settings('mavensmate.sublime-settings')

            self.result = 'MavensMate Desktop successfully installed. Happy coding!!'
            if self.printer != None:
                self.calculate_process_region()
                ThreadTracker.remove(self)

        except BaseException as e:
            import traceback
            import sys
            traceback.print_exc(file=sys.stdout)
            debug('[MAVENSMATE] could not install MavensMate Desktop')
            debug(e)
            self.result = '[OPERATION FAILED]: could not install MavensMate Desktop, please check the Sublime Text console for logs and post an issue.'
            if self.printer != None:
                self.calculate_process_region()
                ThreadTracker.remove(self)
开发者ID:DouglasCAyers,项目名称:MavensMate-SublimeText,代码行数:26,代码来源:desktop_installer.py


示例17: write_symbol_table_cache

    def write_symbol_table_cache(self, member_id):
        # Get the symbol table from ApexClassMember
        query = "SELECT Id, SymbolTable " +\
                "FROM ApexClassMember WHERE Id ='%s'" % member_id
        member = self.query(query, True)

        # Start to write symbol table to cache
        if not member["records"]: return
        symbol_table = member["records"][0]["SymbolTable"]

        # Get symbolTable from component_metadata.sublime-settings
        symbol_table_cache = sublime.load_settings("symbol_table.sublime-settings")
        symboltable_dict = symbol_table_cache.get(self.settings["username"], {})

        # Outer completions 
        outer = util.parse_symbol_table(symbol_table)

        symboltable_dict[symbol_table["name"].lower()] = {
            "outer" : outer,
            "name": symbol_table["name"]
        }

        # Inner completions
        inners = {}
        for inn in symbol_table["innerClasses"]:
            inner = util.parse_symbol_table(inn)
            inners[inn["name"].lower()] = inner
        symboltable_dict[symbol_table["name"].lower()]["inners"] = inners

        symbol_table_cache.set(self.settings["username"], symboltable_dict)
        sublime.save_settings("symbol_table.sublime-settings")
开发者ID:royluo6,项目名称:haoide,代码行数:31,代码来源:tooling.py


示例18: delayed_settings_restore

            def delayed_settings_restore():
                if type == 'upgrade' and package in self.old_syntaxes:
                    for view_syntax in self.old_syntaxes[package]:
                        view, syntax = view_syntax
                        view.settings().set('syntax', syntax)

                if type == 'upgrade' and package in self.old_color_schemes:
                    for view_scheme in self.old_color_schemes[package]:
                        view, scheme = view_scheme
                        view.settings().set('color_scheme', scheme)

                if type == 'upgrade' and self.old_theme_package == package:
                    settings.set('theme', self.old_theme)
                    sublime.message_dialog(text.format(
                        u'''
                        Package Control

                        Your active theme was just upgraded. You may see some
                        graphical corruption until you restart Sublime Text.
                        '''
                    ))

                if type == 'upgrade' and self.old_color_scheme_package == package:
                    settings.set('color_scheme', self.old_color_scheme)

                sublime.save_settings(preferences_filename())
开发者ID:autumnViolet,项目名称:package_control,代码行数:26,代码来源:package_disabler.py


示例19: run

    def run(self, edit, option):
        s = sublime.load_settings('phpfmt.sublime-settings')
        options = {
            "autocomplete":"autocomplete",
            "autoimport":"dependency autoimport",
            "enable_auto_align":"auto align",
            "format_on_save":"format on save",
            "psr1":"PSR1",
            "psr1_naming":"PSR1 Class and Method Naming",
            "psr2":"PSR2",
            "readini":"look for .php.tools.ini",
            "smart_linebreak_after_curly":"smart linebreak after curly",
            "skip_if_ini_missing":"skip if ini file is missing",
            "visibility_order":"visibility order",
            "yoda":"yoda mode",
        }
        s = sublime.load_settings('phpfmt.sublime-settings')
        value = s.get(option, False)

        if value:
            s.set(option, False)
            msg = "phpfmt: "+options[option]+" disabled"
            print_debug(msg)
            sublime.status_message(msg)
        else:
            s.set(option, True)
            msg = "phpfmt: "+options[option]+" enabled"
            print_debug(msg)
            sublime.status_message(msg)

        sublime.save_settings('phpfmt.sublime-settings')
开发者ID:D1amant,项目名称:sublime-phpfmt,代码行数:31,代码来源:phpfmt.py


示例20: path_entered

 def path_entered(self, path):
     path = os.path.abspath(os.path.expanduser(path))
     s = sublime.load_settings("Subclim.sublime-settings")
     s.set("eclim_executable_location", path)
     sublime.save_settings("Subclim.sublime-settings")
     # re-initialize the eclim module with the new path
     initialize_eclim_module()
开发者ID:vishwassharma,项目名称:Subclim,代码行数:7,代码来源:subclim_plugin.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python sublime.set_clipboard函数代码示例发布时间:2022-05-27
下一篇:
Python sublime.run_command函数代码示例发布时间: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