当前位置: 首页>>代码示例>>Python>>正文


Python sublime_plugin.WindowCommand方法代码示例

本文整理汇总了Python中sublime_plugin.WindowCommand方法的典型用法代码示例。如果您正苦于以下问题:Python sublime_plugin.WindowCommand方法的具体用法?Python sublime_plugin.WindowCommand怎么用?Python sublime_plugin.WindowCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sublime_plugin的用法示例。


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

示例1: __init__

# 需要导入模块: import sublime_plugin [as 别名]
# 或者: from sublime_plugin import WindowCommand [as 别名]
def __init__(self, param):
        # no super() call! this would get the references confused
        if isinstance(param, sublime.Window):
            self.window = param
            self._window_command = True  # probably called from build system
            self.typ = WindowCommand
        elif isinstance(param, sublime.View):
            self.view   = param
            self._window_command = False
            self.typ = TextCommand
        else:
            raise TypeError("Something really bad happened and you are responsible")

        self._update_members() 
开发者ID:typeintandem,项目名称:tandem,代码行数:16,代码来源:__init__.py

示例2: __init__

# 需要导入模块: import sublime_plugin [as 别名]
# 或者: from sublime_plugin import WindowCommand [as 别名]
def __init__(self, *args, **kwargs):
        self.settings = Settings()
        sublime_plugin.WindowCommand.__init__(self, *args, **kwargs) 
开发者ID:KunihikoKido,项目名称:sublime-elasticsearch-client,代码行数:5,代码来源:base.py

示例3: setTimeout

# 需要导入模块: import sublime_plugin [as 别名]
# 或者: from sublime_plugin import WindowCommand [as 别名]
def setTimeout(time, func):
  timer = Timer(time, func)
  timer.start()

# class handle_settingCommand(sublime_plugin.WindowCommand) :
#   def run(self, folder_from_package, file_name, extension) :
#     open_setting(folder_from_package, file_name, extension)

#   def is_visible(self, folder_from_package, file_name, extension) :
#     if file_name.find(" (") >= 0 and file_name.find(" ("+PLATFORM+")") >= 0 :
#       return True
#     elif file_name.find(" (") >= 0 and file_name.find(" ("+PLATFORM+")") < 0 :
#       return False
#     return True
    
# def enable_setting(folder_from_package, file_name, extension) :
#   path = os.path.join(PACKAGE_PATH, folder_from_package)
#   file_name_enabled = file_name + "." + extension
#   file_name_disabled = file_name + "_disabled" + "." + extension
#   path_file_enabled = os.path.join(path, file_name_enabled)
#   path_file_disabled = os.path.join(path, file_name_disabled)
#   try :
#     if os.path.isfile(path_file_disabled) :
#       os.rename(path_file_disabled, path_file_enabled)
#   except Exception as e :
#     print("Error: "+traceback.format_exc())

# def disable_setting(folder_from_package, file_name, extension) :
#   path = os.path.join(PACKAGE_PATH, folder_from_package)
#   file_name_enabled = file_name + "." + extension
#   file_name_disabled = file_name + "_disabled" + "." + extension
#   path_file_enabled = os.path.join(path, file_name_enabled)
#   path_file_disabled = os.path.join(path, file_name_disabled)
#   try :
#     if os.path.isfile(path_file_enabled) :
#       os.rename(path_file_enabled, path_file_disabled)
#   except Exception as e :
#     print("Error: "+traceback.format_exc())

# def is_setting_enabled(folder_from_package, file_name, extension) :
#   path = os.path.join(PACKAGE_PATH, folder_from_package)
#   file_name_enabled = file_name + "." + extension
#   path_file_enabled = os.path.join(path, file_name_enabled)
#   return os.path.isfile(path_file_enabled)
      
# def open_setting(folder_from_package, file_name, extension) :
#   path = os.path.join(PACKAGE_PATH, folder_from_package)
#   file_name_enabled = file_name + "." + extension
#   file_name_disabled = file_name + "_disabled" + "." + extension
#   path_file_enabled = os.path.join(path, file_name_enabled)
#   path_file_disabled = os.path.join(path, file_name_disabled)

#   if os.path.isfile(path_file_enabled) :
#     sublime.active_window().open_file(path_file_enabled)
#   elif os.path.isfile(path_file_disabled) :
#     sublime.active_window().open_file(path_file_disabled) 
开发者ID:pichillilorenzo,项目名称:JavaScript-Completions,代码行数:58,代码来源:_init.py


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