资源简介
Package+Control;打开Sublime Text 3,选择菜单:Preference-->Browse Package... 浏览插件,将下载的文件覆盖到该目录下
代码片段和文件信息
import os
import sys
import sublime
import sublime_plugin
if sys.version_info >= (3):
import importlib
import zipimport
st_build = int(sublime.version())
mod_prefix = ‘package_control‘
# ST3 loads each package as a module so it needs an extra prefix
if sys.version_info >= (3):
bare_mod_prefix = mod_prefix
mod_prefix = ‘Package Control.‘ + mod_prefix
from imp import reload
# When reloading the package we also need to reload the base “package_control“
# module in ST3. This flag inidicates we should re-add the PC package path
# to the beginning of sys.path before we try to reload.
do_insert = False
is_zipped = False
commands_name = mod_prefix + ‘.commands‘
if commands_name in sys.modules and sys.version_info >= (3) and st_build < 3112:
# Unfortunately with ST3 the ZipLoader does not “properly“
# implement load_module() instead loading the code from the zip
# file when the object is instantiated. This means that calling
# reload() by itself does nothing. Instead we have to refresh the
# actual source code and then call reload().
pc_package_path = os.path.dirname(__file__)
if pc_package_path.endswith(‘.sublime-package‘):
refreshing_zip_loader = sublime_plugin.ZipLoader(pc_package_path)
pc_zip_loader = sys.modules[commands_name].__loader__
if hasattr(pc_zip_loader ‘contents‘) and hasattr(pc_zip_loader ‘packages‘):
pc_zip_loader.contents = refreshing_zip_loader.contents
pc_zip_loader.packages = refreshing_zip_loader.packages
if pc_package_path in zipimport._zip_directory_cache:
del zipimport._zip_directory_cache[pc_package_path]
is_zipped = True
importlib.invalidate_caches()
do_insert = True
# Python allows reloading modules on the fly which allows us to do live upgrades.
# The only caveat to this is that you have to reload in the dependency order.
#
# Thus is module A depends on B and we don‘t reload B before A when A is reloaded
# it will still have a reference to the old B. Thus we hard-code the dependency
# order of the various Package Control modules so they get reloaded properly.
#
# There are solutions for doing this all programatically but this is much easier
# to understand.
reload_mods = []
for mod in sys.modules:
if mod[0:15] in set([‘package_control‘ ‘Package Control‘]) and sys.modules[mod] is not None:
reload_mods.append(mod)
mods_load_order = [
‘‘
‘.sys_path‘
‘.text‘
‘.cache‘
‘.file_not_found_error‘
‘.open_compat‘
‘.http_cache‘
‘.console_write‘
‘.unicode‘
‘.clear_directory‘
‘.show_error‘
‘.cmd‘
‘.processes‘
‘.settings‘
‘.show_quick_panel‘
‘.thread_progress‘
‘.package_io‘
‘.semver‘
‘.versions‘
‘.deps.asn1crypto._errors‘
‘.deps.asn1crypto._ffi‘
‘.deps.asn1crypto._int‘
‘.deps.asn1crypto._elliptic_curve‘
‘.deps.asn1crypto._types‘
‘.deps.asn1crypto._inet
- 上一篇:英语培训静态页面
- 下一篇:KF_Altitude
相关资源
- SublimeREPL-master.zip
-
Source Insight 4 主题xm
l配置文件仿su - Sublime Text 317664位 +破解补丁+详细使用
- sublime汉化包,packagecontrolchannel_v3.js
- Sublime Text3绿色版
- Sublime Text 3 3126官方原版 汉化插件 注
- Sublime3及Lua插件
- SublimeText3Build3103x64PortableCracked(2016
- Sublime Text 3绿色破解版
- Sublime Text 3
- linux-sublime-text3.deb
- web前端开发模仿代码
- Sublime Text 2 破解版
- sublimetext3汉化版+注册机
- sublime text3 win64 +破解码
- sublime-text_build-3083_i386
- sublimetext3 ubantu deb
- sublime text2
- sublime text2官网最新原版+汉化包
- Sublime Text 2 简体中文版
- sublime(Linux安装包)
- Sublime SFTP插件
- sublime text3 verilog&VHDL;语言专版
- Sublime_Text3中文版
- sublime for mac 安装包
- Sublime Text 3 中文版免安装、已集成大
- sublime text 3207全平台安装包便携版及注
- sublime_text_SublimeCodeIntel.rar
- Sublime Text3必备插件集合
- sublime text3 带插件50+插件 最强汉化版
评论
共有 条评论