资源简介
出现package control 无法或得连接,无法自动下载的时候,可以直接用这个插件。直接放到 插件目录中重启就可以了。
代码片段和文件信息
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.version‘
‘.deps.asn1crypto._errors‘
‘.deps.asn1crypto._ffi‘
‘.deps.asn1crypto._int‘
‘.deps.asn1crypto._elliptic_curve‘
‘.deps.asn1crypto._typ
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 217 2018-10-08 07:24 Package_control_util\.github\ISSUE_TEMPLATE.md
....... 60 2018-10-08 07:24 Package_control_util\.gitignore
....... 10244 2018-10-08 07:24 Package_control_util\1_reloader.py
....... 6785 2018-10-08 07:24 Package_control_util\2_bootstrap.py
....... 2502 2018-10-08 07:24 Package_control_util\Default.sublime-commands
....... 182 2018-10-08 07:24 Package_control_util\dependencies.json
....... 3988 2018-10-08 07:24 Package_control_util\dev\update_dependencies.py
文件 90 2019-03-07 10:58 Package_control_util\error_desc.txt
....... 2051 2018-10-08 07:24 Package_control_util\example-channel.json
....... 1254 2018-10-08 07:24 Package_control_util\example-dependencies.json
....... 102 2018-10-08 07:24 Package_control_util\example-messages.json
....... 12250 2018-10-08 07:24 Package_control_util\example-repository.json
....... 1487 2018-10-08 07:24 Package_control_util\Main.sublime-menu
....... 621 2018-10-08 07:24 Package_control_util\messages\1.3.0.txt
....... 3695 2018-10-08 07:24 Package_control_util\messages\1.6.0.txt
....... 2550 2018-10-08 07:24 Package_control_util\messages\2.0.0.txt
....... 2261 2018-10-08 07:24 Package_control_util\messages\3.0.0.txt
....... 876 2018-10-08 07:24 Package_control_util\messages\3.1.0.txt
....... 743 2018-10-08 07:24 Package_control_util\messages\3.2.0.txt
....... 195 2018-10-08 07:24 Package_control_util\messages.json
....... 5108 2018-10-08 07:24 Package_control_util\Package Control.py
....... 7415 2018-10-08 07:24 Package_control_util\Package Control.sublime-settings
....... 161 2018-10-08 07:24 Package_control_util\package-me
....... 11337 2018-10-08 07:24 Package_control_util\package_control\automatic_upgrader.py
....... 5933 2018-10-08 07:24 Package_control_util\package_control\bootstrap.py
....... 4886 2018-10-08 07:24 Package_control_util\package_control\cache.py
....... 7400 2018-10-08 07:24 Package_control_util\package_control\ca_certs.py
....... 4058 2018-10-08 07:24 Package_control_util\package_control\clear_directory.py
....... 8997 2018-10-08 07:24 Package_control_util\package_control\clients\bitbucket_client.py
....... 360 2018-10-08 07:24 Package_control_util\package_control\clients\client_exception.py
............此处省略203个文件信息
- 上一篇:WAV用于百度语音测试文件
- 下一篇:FPGA多功能简易电子琴模块
相关资源
- 使用迅雷百度云盘数据-插件包
- 腾讯通共享文件插件
- windows64位平台的hadoop2.5.2插件包(ha
- Chrome迅雷插件Thunder-Download-Extension-f
- vue省市区组件,mint-ui封装的省市区组
- DES加密解密以及Eclipse插件
-
Notepad++ 的lua.xm
l 语法高亮和自动补 - 添加Microsoft Visual Studio 解决方案平台
- ecshop 仿淘宝颜色尺寸选择插件内附详
- dtree插件bootstrap风格图标
- ActiveX for chrome 插件
- angular.js + bootstrap 带数据搜索筛选的多
- Photoshop ICO插件含64位版本
- Solidworks实用宏插件
- GD32F1x0 for keil v4.7插件
- 织梦CMSdedecms医生排版插件
- Unity 二维码生成插件ZXing
- 电磁炮comdlg32.ocx插件
- jd-gui插件-jd-eclipse-site-1.0.0-RC2
- cad插件,生成纬地横断面成果txt
- mapinfo三扇区图层制作插件GCI-CDMAtool
- CAD坐标导出到EXCEL插件v2.0绿色中文免
- 最新版Unity代码混淆加密插件 Obfusca
- 我的Firefox插件开发之旅——从零开始
- VC 6.0 补丁 FileTool.dll
- 织梦小程序助手插件.zip
- 织梦CMS微信支付插件接口.rar
- Axure浏览器插件chrome for mac Axure-RP-Ex
- 微信开发:织梦整合微信公众代码,
- js文本比对插件
评论
共有 条评论