<s> import os <EOL> import sublime <EOL> import sys <EOL> import threading <EOL> if os . name == '<STR_LIT>' : <EOL> from ctypes import windll , create_unicode_buffer <EOL> class Prefs : <EOL> @ staticmethod <EOL> def load ( ) : <EOL> settings = sublime . load_settings ( '<STR_LIT>' ) <EOL> Prefs . plugins = settings . get ( '<STR_LIT>' , [ ] ) <EOL> Prefs . debug = settings . get ( '<STR_LIT>' , <NUM_LIT:0> ) <EOL> Prefs . load ( ) <EOL> def add_to_path ( path ) : <EOL> if os . name == '<STR_LIT>' : <EOL> buf = create_unicode_buffer ( <NUM_LIT> ) <EOL> if windll . kernel32 . GetShortPathNameW ( path , buf , len ( buf ) ) : <EOL> path = buf . value <EOL> if path not in sys . path : <EOL> sys . path . append ( path ) <EOL> pc_folder = os . path . join ( sublime . packages_path ( ) , '<STR_LIT>' ) <EOL> add_to_path ( pc_folder ) <EOL> os . chdir ( pc_folder ) <EOL> from package_control . package_manager import PackageManager <EOL> class PHPIDE ( threading . Thread ) : <EOL> def __init__ ( self ) : <EOL> self . manager = PackageManager ( ) <EOL> threading . Thread . __init__ ( self ) <EOL> def run ( self ) : <EOL> installed_packages = self . manager . list_packages ( ) <EOL> for plugin in Prefs . plugins : <EOL> print "<STR_LIT>" + plugin <EOL> if not plugin in installed_packages : <EOL> self . manager . install_package ( plugin ) <EOL> sublime . set_timeout ( lambda : PHPIDE ( ) . start ( ) , <NUM_LIT> ) </s>
