當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。