本文整理汇总了Python中sublime.MONOSPACE_FONT属性的典型用法代码示例。如果您正苦于以下问题:Python sublime.MONOSPACE_FONT属性的具体用法?Python sublime.MONOSPACE_FONT怎么用?Python sublime.MONOSPACE_FONT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类sublime
的用法示例。
在下文中一共展示了sublime.MONOSPACE_FONT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import MONOSPACE_FONT [as 别名]
def run(self, immediate=False, single_pane=False, project=False, other_group=False):
path, goto = self._determine_path()
if project:
folders = self.window.folders()
if len(folders) == 1:
path = folders[0]
elif folders:
names = [basename(f) for f in folders]
longest_name = max([len(n) for n in names])
for i, f in enumerate(folders):
name = names[i]
offset = ' ' * (longest_name - len(name) + 1)
names[i] = u'%s%s%s' % (name, offset, self.display_path(f))
self.window.show_quick_panel(names, lambda i: self._show_folder(i, path, goto, single_pane, other_group), sublime.MONOSPACE_FONT)
return
if immediate:
show(self.window, path, goto=goto, single_pane=single_pane, other_group=other_group)
else:
prompt.start('Directory:', self.window, path, self._show)
示例2: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import MONOSPACE_FONT [as 别名]
def run(self, edit, new_window=False):
jp = jump_points()
if not jp:
status_message("No jump points available. To create jump point for this directory use 'P'.")
return
# show_quick_panel didn't work with dict_items
self.new_window = new_window
self.jump_points = [[n, t] for n, t in jp]
self.display_jump_points = []
longest_name = max([len(n) for n in jump_names().values()])
for n, t in jp:
n = n if ST3 else n.decode('utf8')
offset = ' ' * (longest_name - len(n) + 1)
path = self.display_path(t)
name = u'%s%s%s' % (n, offset, path.rstrip(os.sep))
self.display_jump_points.append(name)
self.view.window().show_quick_panel(self.display_jump_points, self.on_pick_point, sublime.MONOSPACE_FONT)
示例3: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import MONOSPACE_FONT [as 别名]
def run(self, edit, deploy_file_list=None):
self.window = sublime.active_window()
if deploy_file_list:
self.open_files = deploy_file_list
self.current_file = None
self.sel_type_list = ["Deploy Directory", "Deploy Directory To Server(check only)"]
self.sel_type_key_list = ["DeployOpenFiles", "CheckDeployOpenFiles"]
else:
self.open_files = []
for _view in self.window.views():
file_name = _view.file_name()
if file_name:
self.open_files.append(file_name)
self.current_file = self.view.file_name()
self.sel_type_list = ["Config Ant Metadata Tool", "Backup All Metadata", "Deploy Open Files To Server", "Deploy Open Files To Server(check only)"]
self.sel_type_key_list = ["Build", "Backup", "DeployOpenFiles", "CheckDeployOpenFiles"]
if self.current_file:
file_path, file_name = os.path.split(self.current_file)
self.sel_type_list.append("Deploy Current File To Server : %s" % file_name)
self.sel_type_list.append("Deploy Current File To Server : %s (check only)" % file_name)
self.sel_type_key_list.append("DeployOne")
self.sel_type_key_list.append("CheckDeployOne")
self.window.show_quick_panel(self.sel_type_list, self.panel_done, sublime.MONOSPACE_FONT)
示例4: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import MONOSPACE_FONT [as 别名]
def run(self, type=None, object_name=None):
try:
self.sf_basic_config = SfBasicConfig()
self.settings = self.sf_basic_config.get_setting()
self.sublconsole = SublConsole(self.sf_basic_config)
self.type = type
self.attr = self.get_attr(self.type)
self.save_dir = self.sf_basic_config.get_src_dir(sub_folder=self.attr["folder"])
self.template = Template()
self.template_config_dict = self.template.load_config_dict(self.type)
self.template_config_list = list(self.template_config_dict.keys())
self.object_name = object_name
self.window.show_quick_panel(self.template_config_list, self.panel_done,sublime.MONOSPACE_FONT)
except Exception as e:
self.sublconsole.showlog(e)
return
示例5: open_category_panel
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import MONOSPACE_FONT [as 别名]
def open_category_panel(self, thread, sel_category, timeout=200):
if thread.is_alive():
self.sublconsole.showlog("loading metadata , please wait...")
timeout=200
sublime.set_timeout(lambda: self.open_category_panel(thread, sel_category, timeout), timeout)
return
self.sublconsole.showlog("load metadata ok!")
try:
self.sel_category_list = self.metadata_cache.get_meta_category()
if sel_category and sel_category in self.sel_category_list:
self.open_detail_panel(sel_category)
else:
self.window.show_quick_panel(self.sel_category_list, self.panel_done, sublime.MONOSPACE_FONT)
except Exception as e:
self.sublconsole.showlog(e)
return
示例6: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import MONOSPACE_FONT [as 别名]
def run(self):
try:
self.sf_basic_config = SfBasicConfig()
self.settings = self.sf_basic_config.get_setting()
self.sublconsole = SublConsole(self.sf_basic_config)
settings = self.settings
auth_type = settings["authentication"]
self.dirs = [setting.AUTHENTICATION_OAUTH2, setting.AUTHENTICATION_PASSWORD]
show_dirs = []
for dirstr in self.dirs:
if auth_type == dirstr:
show_dirs.append('[○]' + dirstr)
else:
show_dirs.append('[X]' + dirstr)
self.window.show_quick_panel(show_dirs, self.panel_done,sublime.MONOSPACE_FONT)
except Exception as e:
self.sublconsole.showlog(e)
return
示例7: on_input
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import MONOSPACE_FONT [as 别名]
def on_input(self, args):
print(args)
if self.input_index > 0:
pre_conf = self.input_conf[self.input_index-1]
ui_type = pre_conf["type"]
if ui_type == "input":
pre_conf["value"] = args
elif ui_type == "select":
if 0 <= args and args < len(pre_conf["option-v"]):
pre_conf["value"] = pre_conf["option-v"][args]
if self.input_index < len(self.input_conf):
current_conf = self.input_conf[self.input_index]
if current_conf["type"] == "input":
caption = "Please Input your %s: " % current_conf["key"]
self.window.show_input_panel(caption, current_conf["value"], self.on_input, None, None)
elif current_conf["type"] == "select":
show_opts = current_conf["option"]
self.window.show_quick_panel(show_opts, self.on_input, sublime.MONOSPACE_FONT)
self.input_index = self.input_index + 1
else:
self._save_conf()
示例8: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import MONOSPACE_FONT [as 别名]
def run(self):
self.sf_basic_config = SfBasicConfig()
self.settings = self.sf_basic_config.get_setting()
self.sublconsole = SublConsole(self.sf_basic_config)
self.window = sublime.active_window()
self.osutil = util.OsUtil(self.sf_basic_config)
s = sublime.load_settings(SFDX_SETTINGS)
tasks = s.get("tasks")
self.env = s.get("custom_env")
self.env.update(DxEnv().get_env())
self.env.update(CommandEnv(self.window, self.sf_basic_config.get_project_dir()).get_env())
self.sel_keys = [task["label"] for task in tasks]
self.sel_vals = [task for task in tasks]
self.window.show_quick_panel(self.sel_keys, self.panel_done, sublime.MONOSPACE_FONT)
示例9: show_package_list
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import MONOSPACE_FONT [as 别名]
def show_package_list(self):
"""Sample doc string."""
self.messages = []
p = popen_force_cli(["describe", "-t", "metadata", "-j"])
result, err = p.communicate()
if err:
sublime.error_message(err.decode("utf-8"))
else:
try:
m = json.loads(result.decode("utf-8"))
for mm in m:
x = [mm['XmlName'], "In folder: " + mm['DirectoryName'],
"Suffix: " + mm['Suffix']]
self.messages.append(x)
self.window = sublime.active_window()
self.window.show_quick_panel(self.messages,
self.open_selected_metadata,
sublime.MONOSPACE_FONT)
except:
return
示例10: show_list
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import MONOSPACE_FONT [as 别名]
def show_list(self, data):
m = json.loads(data)
if len(m) == 0:
sublime.message_dialog(
"There aren't any lightning components "
" in this org.")
return
print("data: " + str(m))
self.messages.append(["All Bundles", "*", "Every Bundle",
"All the lightning bundles "
"in your org!"])
print("And now here")
for mm in m:
x = [mm['MasterLabel'], mm['Id'], mm["DeveloperName"],
mm["Description"]]
self.messages.append(x)
self.window = sublime.active_window()
self.window.show_quick_panel(self.messages,
self.open_selected_bundle,
sublime.MONOSPACE_FONT)
示例11: run_async
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import MONOSPACE_FONT [as 别名]
def run_async(self):
all_file_lines = (
line.split(" ", 1)
for line in self.git("ls-files", "-v").split("\n")
)
self._ignored_files = tuple(f[1] for f in all_file_lines if f[0] == "h")
if not self._ignored_files:
self.window.show_quick_panel(["No files are assumed unchanged."], None)
else:
self.window.show_quick_panel(
self._ignored_files,
self.on_selection,
flags=sublime.MONOSPACE_FONT
)
示例12: run_async
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import MONOSPACE_FONT [as 别名]
def run_async(self, **kwargs):
email = self.git("config", "user.email").strip()
self._entries = []
commiter_str = self.git("shortlog", "-sne", "HEAD")
for line in commiter_str.split('\n'):
m = re.search(r'\s*(\d*)\s*(.*)\s<(.*)>', line)
if m is None:
continue
commit_count, author_name, author_email = m.groups()
author_text = "{} <{}>".format(author_name, author_email)
self._entries.append((commit_count, author_name, author_email, author_text))
try:
selected_index = (list(line[2] for line in self._entries)).index(email)
except ValueError:
selected_index = 0
self.window.show_quick_panel(
[entry[3] for entry in self._entries],
lambda index: self.on_author_selection(index, **kwargs),
flags=sublime.MONOSPACE_FONT,
selected_index=selected_index
)
示例13: _generic_select
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import MONOSPACE_FONT [as 别名]
def _generic_select(self, help_text, options, callback,
no_opts="There are no branches available"):
"""
Display quick_panel with help_text as first option and options as
the rest and passes given callback to `show_quick_panel`.
In case options is empty or None displays only `no_opts` text.
"""
if not options:
self.window.show_quick_panel([no_opts], None)
else:
self.window.show_quick_panel(
[help_text] + options,
callback,
flags=sublime.MONOSPACE_FONT
)
示例14: offer_force_deletion
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import MONOSPACE_FONT [as 别名]
def offer_force_deletion(self, branch_name):
# type: (str) -> None
actions = [
"Abort, '{}' is not fully merged.".format(branch_name),
"Delete anyway."
]
def on_action_selection(index):
if index < 1:
return
self.window.run_command("gs_delete_branch", {
"branch": branch_name,
"force": True
})
self.window.show_quick_panel(
actions,
on_action_selection,
flags=sublime.MONOSPACE_FONT,
)
示例15: show_quick_panel
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import MONOSPACE_FONT [as 别名]
def show_quick_panel(self):
'''dialog asks if user would like to duplicate, overwrite, or skip item'''
t, f = self.errors.popitem()
options = self.actions + [[u'from %s' % f, 'Skip'], [u'to %s' % t, 'Skip']]
done = lambda i: self.user_input(i, f, t)
sublime.set_timeout(lambda: self.window.show_quick_panel(options, done, sublime.MONOSPACE_FONT), 10)
return