arch () return def add_dependency ( name, first = False ): """ Accepts a dependency name and automatically adds the appropriate path to sys.path, if the dependency has a path for the current platform and architecture. join ( packages_dir, name ) ver = u 'st %s ' % st_version plat = sublime. join ( st_dir, u 'Packages' ) dependency_dir = os. :param name: A unicode string name of the dependency :return: A dict with the following keys: - 'ver' - 'plat' - 'arch' """ packages_dir = os. ![]() remove ( encode ( path )) except ( ValueError ): pass def generate_dependency_paths ( name ): """ Accepts a dependency name and generates a dict containing the three standard import paths that are valid for the current machine. GetShortPathNameW ( path, buf, len ( buf )): path = buf. name = 'nt' : buf = create_unicode_buffer ( 512 ) if windll. ![]() remove ( encode ( path )) except ( ValueError ): pass if os. append ( enc_path ) def remove ( path ): """ Removes a path from sys.path if it is present :param path: A unicode string of a folder, zip file or sublime-package file """ try : sys. insert ( 0, enc_path ) elif enc_path not in sys. remove ( enc_path ) except ( ValueError ): pass sys. exists ( enc_path ): if first : try : sys. name = 'nt' : # Work around unicode path import issue on Windows with Python 2.6 buf = create_unicode_buffer ( 512 ) if windll. :param path: A unicode string of a folder, zip file or sublime-package file to add to the path :param first: If the path should be added at the beginning """ if os. getcwd ()) st_version = u '2' st_dir = dirname ( dirname ( pc_package_path )) def add ( path, first = False ): """ Adds an entry to the beginning of sys.path, working around the fact that Python 2.6 can't import from non-ASCII paths on Windows. ![]() getfilesystemencoding ()) return path pc_package_path = decode ( os. getfilesystemencoding ()) return path def encode ( path ): if isinstance ( path, unicode ): path = path. sublime-package file, the filename ends up being # Package Control.sublime-package/Package Control.package_control.sys_path else : pc_package_path = dirname ( _file_ ) st_version = u '3' else : def decode ( path ): if not isinstance ( path, unicode ): path = path. basename ( _file_ ) = 'sys_path.py' : pc_package_path = dirname ( dirname ( _file_ )) # When loaded as a. version_info >= ( 3 ,): def decode ( path ): return path def encode ( path ): return path if os. name = 'nt' : from ctypes import windll, create_unicode_buffer import sublime if sys. Import sys import os from os.path import dirname if os. facelessuser/sublime-backrefs → backrefsĭownload and unpack or git clone the latest RegReplace release and unpack it as RegReplace:Ĭreate a folder under Packages called 00-dependencies and under that folder create a file called 00-dependencies.py:Ĭopy the following code to 00-dependencies.py (this code was taken from Package Control):.facelessuser/sublime-markdown → python-markdown.facelessuser/sublime-markdown-popups → mdpopups.teddy_beer_maniac/sublime-text-dependency-jinja2 → python-jinja2.teddy_beer_maniac/sublime-text-dependency-markupsafe → markupsafe. ![]() Beware: when going this route, you'll have to keep all the packages updated yourself!ĭownload the latest releases of the following dependencies and unpack or git clone them in the Packages folder as shown below: If you are forking for a pull request, you should just clone RegReplace and run Package Control's Satisfy Dependency command to get all the dependencies.įor those who want to install RegReplace without package control, here are the steps. Installing it this way will not get automatically updated. This is not the recommended way to install RegReplace for the average user.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |