资源简介
sublime_package_control-python3.zip用来安装Emmet插件时使用.
代码片段和文件信息
import sublime
import sys
import os
st_version = 2
# Warn about out-dated versions of ST3
if sublime.version() == ‘‘:
st_version = 3
print(‘Package Control: Please upgrade to Sublime Text 3 build 3012 or newer‘)
elif int(sublime.version()) > 3000:
st_version = 3
if st_version == 3:
installed_dir _ = __name__.split(‘.‘)
elif st_version == 2:
installed_dir = os.path.basename(os.getcwd())
# Ensure the user has installed Package Control properly
if installed_dir != ‘Package Control‘:
message = (u“Package Control\n\nThis package appears to be installed “ +
u“incorrectly.\n\nIt should be installed as \“Package Control\“ “ +
u“but seems to be installed as \“%s\“.\n\n“ % installed_dir)
# If installed unpacked
if os.path.exists(os.path.join(sublime.packages_path() installed_dir)):
message += (u“Please use the Preferences > Browse Packages... menu “ +
u“entry to open the \“Packages/\“ folder and rename“ +
u“\“%s/\“ to \“Package Control/\“ “ % installed_dir)
# If installed as a .sublime-package file
else:
message += (u“Please use the Preferences > Browse Packages... menu “ +
u“entry to open the \“Packages/\“ folder then browse up a “ +
u“folder and into the \“Installed Packages/\“ folder.\n\n“ +
u“Inside of \“Installed Packages/\“ rename “ +
u“\“%s.sublime-package\“ to “ % installed_dir +
u“\“Package Control.sublime-package\“ “)
message += u“and restart Sublime Text.“
sublime.error_message(message)
# Normal execution will finish setting up the package
else:
reloader_name = ‘package_control.reloader‘
# ST3 loads each package as a module so it needs an extra prefix
if st_version == 3:
reloader_name = ‘Package Control.‘ + reloader_name
from imp import reload
# Make sure all dependencies are reloaded on upgrade
if reloader_name in sys.modules:
reload(sys.modules[reloader_name])
try:
# Python 3
from .package_control import reloader
from .package_control.commands import *
from .package_control.package_cleanup import PackageCleanup
except (ValueError):
# Python 2
from package_control import reloader
from package_control import sys_path
from package_control.commands import *
from package_control.package_cleanup import PackageCleanup
def plugin_loaded():
# Start shortly after Sublime starts so package renames don‘t cause errors
# with keybindings settings etc disappearing in the middle of parsing
sublime.set_timeout(lambda: PackageCleanup().start() 2000)
if st_version == 2:
plugin_loaded()
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-07-15 07:48 sublime_package_control-python3\
文件 60 2013-07-15 07:48 sublime_package_control-python3\.gitignore
文件 1742 2013-07-15 07:48 sublime_package_control-python3\Default.sublime-commands
文件 1546 2013-07-15 07:48 sublime_package_control-python3\Main.sublime-menu
文件 41531 2013-07-15 07:48 sublime_package_control-python3\Package Control.ca-bundle
文件 187 2013-07-15 07:48 sublime_package_control-python3\Package Control.ca-list
文件 2769 2013-07-15 07:48 sublime_package_control-python3\Package Control.py
文件 6191 2013-07-15 07:48 sublime_package_control-python3\Package Control.sublime-settings
文件 2571 2013-07-15 07:48 sublime_package_control-python3\example-channel.json
文件 102 2013-07-15 07:48 sublime_package_control-python3\example-messages.json
文件 8610 2013-07-15 07:48 sublime_package_control-python3\example-repository.json
文件 66 2013-07-15 07:48 sublime_package_control-python3\messages.json
目录 0 2013-07-15 07:48 sublime_package_control-python3\messages\
文件 621 2013-07-15 07:48 sublime_package_control-python3\messages\1.3.0.txt
文件 3723 2013-07-15 07:48 sublime_package_control-python3\messages\1.6.0.txt
文件 142 2013-07-15 07:48 sublime_package_control-python3\package-me
目录 0 2013-07-15 07:48 sublime_package_control-python3\package_control\
文件 70 2013-07-15 07:48 sublime_package_control-python3\package_control\__init__.py
文件 5755 2013-07-15 07:48 sublime_package_control-python3\package_control\automatic_upgrader.py
文件 4732 2013-07-15 07:48 sublime_package_control-python3\package_control\cache.py
文件 1131 2013-07-15 07:48 sublime_package_control-python3\package_control\clear_directory.py
目录 0 2013-07-15 07:48 sublime_package_control-python3\package_control\clients\
文件 0 2013-07-15 07:48 sublime_package_control-python3\package_control\clients\__init__.py
文件 7586 2013-07-15 07:48 sublime_package_control-python3\package_control\clients\bitbucket_client.py
文件 8777 2013-07-15 07:48 sublime_package_control-python3\package_control\clients\github_client.py
文件 1967 2013-07-15 07:48 sublime_package_control-python3\package_control\clients\json_api_client.py
文件 2311 2013-07-15 07:48 sublime_package_control-python3\package_control\clients\readme_client.py
文件 875 2013-07-15 07:48 sublime_package_control-python3\package_control\cmd.py
目录 0 2013-07-15 07:48 sublime_package_control-python3\package_control\commands\
文件 1195 2013-07-15 07:48 sublime_package_control-python3\package_control\commands\__init__.py
文件 1287 2013-07-15 07:48 sublime_package_control-python3\package_control\commands\add_repository_channel_command.py
............此处省略73个文件信息
评论
共有 条评论