本文整理汇总了Python中sublime.save_settings方法的典型用法代码示例。如果您正苦于以下问题:Python sublime.save_settings方法的具体用法?Python sublime.save_settings怎么用?Python sublime.save_settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sublime
的用法示例。
在下文中一共展示了sublime.save_settings方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import save_settings [as 别名]
def run(self, setting, default):
sksp_options_dict = {
"ksp_compact_output" : "Remove Indents and Empty Lines",
"ksp_compact_variables" : "Compact Variables",
"ksp_extra_checks" : "Extra Syntax Checks",
"ksp_optimize_code" : "Optimize Compiled Code",
"ksp_signal_empty_ifcase" : "Raise Error on Empty 'if' or 'case' Statements",
"ksp_add_compiled_date" : "Add Compilation Date/Time Comment",
"ksp_comment_inline_functions" : "Insert Comments When Expanding Functions",
"ksp_play_sound" : "Play Sound When Compilation Finishes"
}
s = sublime.load_settings("KSP.sublime-settings")
s.set(setting, not s.get(setting, False))
sublime.save_settings("KSP.sublime-settings")
if s.get(setting, False):
option_toggle = "enabled!"
else:
option_toggle = "disabled!"
sublime.status_message('SublimeKSP option %s is %s' % (sksp_options_dict[setting], option_toggle))
示例2: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import save_settings [as 别名]
def run(self, edit, dirs):
settings = sublime.load_settings('dired.sublime-settings')
for key_name in ['reuse_view', 'bookmarks']:
settings.set(key_name, settings.get(key_name))
bm = bookmarks()
for path in dirs :
bm.append(path)
settings.set('bookmarks', bm)
# This command makes/writes a sublime-settings file at Packages/User/,
# and doesn't write into one at Packages/dired/.
sublime.save_settings('dired.sublime-settings')
sublime.status_message('Bookmarking succeeded.')
self.view.erase_regions('marked')
示例3: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import save_settings [as 别名]
def run(self, edit, cut=False):
self.index = self.get_all()
filenames = self.get_marked(full=True) or self.get_selected(parent=False, full=True)
if not filenames:
return sublime.status_message('Nothing chosen')
settings = sublime.load_settings('dired.sublime-settings')
copy_list = settings.get('dired_to_copy', [])
cut_list = settings.get('dired_to_move', [])
# copied item shall not be added into cut list, and vice versa
for f in filenames:
if cut:
if not f in copy_list:
cut_list.append(f)
else:
if not f in cut_list:
copy_list.append(f)
settings.set('dired_to_move', list(set(cut_list)))
settings.set('dired_to_copy', list(set(copy_list)))
sublime.save_settings('dired.sublime-settings')
self.show_hidden = self.view.settings().get('dired_show_hidden_files', True)
self.set_status()
示例4: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import save_settings [as 别名]
def run(self, edit):
settings = sublime.load_settings(SETTINGS_FILE_NAME)
network_info_on_hover = settings.get(NETWORK_INFO_ON_HOVER_SETTING_NAME, True)
print(network_info_on_hover)
settings.set(NETWORK_INFO_ON_HOVER_SETTING_NAME, not network_info_on_hover)
sublime.save_settings(SETTINGS_FILE_NAME)
setting_status = 'ON' if not network_info_on_hover else 'OFF'
set_status = 'Network Info Popup: {}'.format(setting_status)
def clear_status():
current_status = self.view.get_status(STATUS_KEY)
if set_status == current_status:
self.view.erase_status(STATUS_KEY)
self.view.set_status(STATUS_KEY, set_status)
sublime.set_timeout_async(clear_status, 4000)
示例5: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import save_settings [as 别名]
def run(self, edit):
self.settings = sublime.load_settings(SETTINGS)
self.hound_url = self.settings.get("hound_url").rstrip("/")
self.github_base_url = self.settings.get("github_base_url")
self.exclude_repos = set(self.settings.get("exclude_repos", []))
self.custom_headers = self.settings.get("custom_headers", {})
self.debug = self.settings.get("debug", False)
if self.debug:
logger.setLevel(logging.DEBUG)
http.client.HTTPConnection.debuglevel = 1
else:
http.client.HTTPConnection.debuglevel = 0
if self.hound_url == "" or self.github_base_url == "":
self.settings.set("hound_url", self.hound_url)
self.settings.set("github_base_url", self.github_base_url)
sublime.save_settings(self.SETTINGS) # save them so we have something to edit
sublime.error_message("Please set your hound_url and github_base_url.")
self.open_settings()
return
示例6: on_navigate
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import save_settings [as 别名]
def on_navigate(self, href):
if href.startswith('back'):
self.show_popup(href[5:])
else:
settings = sublime.load_settings('Preferences.sublime-settings')
name, value, section = href.split(':')
if name:
if name not in ('theme', 'color_scheme'):
boolean = True if value == 'True' else False
if boolean:
settings.set(name, boolean)
else:
settings.erase(name)
else:
settings.set(name, value)
sublime.save_settings('Preferences.sublime-settings')
self.show_popup(section)
示例7: find_yapf
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import save_settings [as 别名]
def find_yapf(self):
"""Find the yapf executable."""
# default to what is in the settings file
cmd = self.get_setting("yapf_command")
cmd = os.path.expanduser(cmd)
cmd = sublime.expand_variables(
cmd,
sublime.active_window().extract_variables()
)
save_settings = not cmd
for maybe_cmd in ['yapf', 'yapf3', 'yapf.exe', 'yapf3.exe']:
if not cmd:
cmd = which(maybe_cmd)
if cmd:
self.debug('Found yapf: %s', cmd)
break
if cmd and save_settings:
settings = sublime.load_settings(PLUGIN_SETTINGS_FILE)
settings.set("yapf_command", cmd)
sublime.save_settings(PLUGIN_SETTINGS_FILE)
return cmd
示例8: __init__
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import save_settings [as 别名]
def __init__(self):
self.before = ""
self.after = ""
self.region_includes_beginning = False
self.region_includes_end = False
self.before_begin_location = 0
self.autocompleting = False
self.choices = []
self.substitute_interval = 0, 0
self.actions_since_completion = 1
self.old_prefix = None
self.popup_is_ours = False
self.seen_changes = False
self.no_hide_until = time.time()
self.just_pressed_tab = False
self.tab_only = False
self.tab_index = 0
self.old_prefix = None
self.expected_prefix = ""
self.user_message = []
sublime.load_settings(PREFERENCES_PATH).set('auto_complete', False)
sublime.save_settings(PREFERENCES_PATH)
示例9: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import save_settings [as 别名]
def run(self, edit):
def done(path):
settings = sublime.load_settings("PICO-8.sublime-settings")
settings.set("pico-8_path", path)
sublime.save_settings("PICO-8.sublime-settings")
return
platform = sublime.platform()
if platform == "linux":
self.view.window().show_input_panel("PICO-8 Path", "/path/to/pico8", done, None, None)
elif platform == "osx":
self.view.window().show_input_panel("PICO-8 Path", "/path/to/PICO-8.app/Contents/MacOS/pico8", done, None, None)
elif platform == "windows":
self.view.window().show_input_panel("PICO-8 Path", "C:\\Program Files (x86)\\PICO-8\\pico8.exe", done, None, None)
else:
sublime.error_message("Error: could not resolve platform\n\n[\"linux\", \"osx\", \"windows\"]")
return
示例10: save
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import save_settings [as 别名]
def save(self):
sublime.save_settings(self._name)
示例11: save_settings
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import save_settings [as 别名]
def save_settings():
"""Save plugin settings to disk."""
sublime.save_settings(SETTINGS)
示例12: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import save_settings [as 别名]
def run(self, edit):
for w in sublime.windows():
for v in w.views():
if v.settings():
p = v.settings().get("dired_path")
if p and p[~0] != os.sep:
v.settings().set("dired_path", p+os.sep)
jp = sublime.load_settings('dired.sublime-settings').get('dired_jump_points', {})
if jp:
fix_jp = dict((n if ST3 else n.decode('utf8'), t if t[~0] == os.sep else t+os.sep) for n, t in jp.items())
sublime.load_settings('dired.sublime-settings').set('dired_jump_points', fix_jp)
sublime.save_settings('dired.sublime-settings')
print('\nFileBrowser:\n\tAll fixed. Thank you for patience!\n')
示例13: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import save_settings [as 别名]
def run(self):
SETTING_PATH = os.path.join(sublime.packages_path(), "User", SFDX_SETTINGS)
if not os.path.exists(SETTING_PATH):
s = sublime.load_settings(SFDX_SETTINGS)
tasks = s.get("tasks")
custom_env = s.get("custom_env")
s.set("tasks", tasks)
s.set("custom_env", custom_env)
sublime.save_settings(SFDX_SETTINGS)
self.window.run_command("open_file", {
"file": SETTING_PATH
})
示例14: update_authentication_setting
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import save_settings [as 别名]
def update_authentication_setting(self, auth_type=AUTHENTICATION_OAUTH2):
# s = sublime.load_settings(SFDC_HUANGXY_SETTINGS)
# s.set("authentication", auth_type)
# sublime.save_settings(SFDC_HUANGXY_SETTINGS)
debug('>>>update_authentication_setting')
pro_config = self.get_project_config()
pro_config["authentication"] = auth_type
content = json.dumps(pro_config, indent=4)
save_file(self.get_project_config_path(), content)
示例15: update_default_browser
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import save_settings [as 别名]
def update_default_browser(self, browser_name):
# Save the updated settings
# s = sublime.load_settings(SFDC_HUANGXY_SETTINGS)
# s.set("default_browser", browser_name)
# sublime.save_settings(SFDC_HUANGXY_SETTINGS)
debug('>>>update_authentication_setting')
pro_config = self.get_project_config()
pro_config["default_browser"] = browser_name
content = json.dumps(pro_config, indent=4)
save_file(self.get_project_config_path(), content)