<s> import sublime <EOL> import os <EOL> import subprocess <EOL> def get_settings ( ) : <EOL> return sublime . load_settings ( "<STR_LIT>" ) <EOL> def get_setting ( key , default = None , view = None ) : <EOL> try : <EOL> if view == None : <EOL> view = sublime . active_window ( ) . active_view ( ) <EOL> s = view . settings ( ) <EOL> if s . has ( "<STR_LIT>" % key ) : <EOL> return s . get ( "<STR_LIT>" % key ) <EOL> except : <EOL> pass <EOL> return get_settings ( ) . get ( key , default ) <EOL> def getenv ( ) : <EOL> env = os . environ . copy ( ) <EOL> userenv = get_setting ( "<STR_LIT>" ) <EOL> for k in userenv : <EOL> env [ k ] = os . path . expandvars ( userenv [ k ] ) <EOL> return env <EOL> def openProcess ( args , env = None , cwd = None , stdin = None , stdout = None , stderr = None , shell = False ) : <EOL> startupinfo = None <EOL> if os . name == '<STR_LIT>' : <EOL> startupinfo = subprocess . STARTUPINFO ( ) <EOL> startupinfo . dwFlags |= subprocess . STARTF_USESHOWWINDOW <EOL> proc = subprocess . Popen ( args , bufsize = - <NUM_LIT:1> , env = env , cwd = cwd , stdin = stdin , stdout = stdout , stderr = stderr , startupinfo = startupinfo , shell = shell ) <EOL> return proc </s>
