<s> import setuptools , sys , glob <EOL> from distutils . command . install import install as _install <EOL> from distutils . errors import DistutilsArgError <EOL> class install ( _install ) : <EOL> """<STR_LIT>""" <EOL> user_options = _install . user_options + [ <EOL> ( '<STR_LIT>' , None , "<STR_LIT>" ) , <EOL> ( '<STR_LIT>' , None , <EOL> "<STR_LIT>" ) , <EOL> ] <EOL> boolean_options = _install . boolean_options + [ <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> ] <EOL> new_commands = [ <EOL> ( '<STR_LIT>' , lambda self : True ) , <EOL> ( '<STR_LIT>' , lambda self : True ) , <EOL> ] <EOL> _nc = dict ( new_commands ) <EOL> def initialize_options ( self ) : <EOL> _install . initialize_options ( self ) <EOL> self . old_and_unmanageable = None <EOL> self . single_version_externally_managed = None <EOL> self . no_compile = None <EOL> def finalize_options ( self ) : <EOL> _install . finalize_options ( self ) <EOL> if self . root : <EOL> self . single_version_externally_managed = True <EOL> elif self . single_version_externally_managed : <EOL> if not self . root and not self . record : <EOL> raise DistutilsArgError ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) <EOL> def handle_extra_path ( self ) : <EOL> if self . root or self . single_version_externally_managed : <EOL> return _install . handle_extra_path ( self ) <EOL> self . path_file = None <EOL> self . extra_dirs = '<STR_LIT>' <EOL> def run ( self ) : <EOL> if self . old_and_unmanageable or self . single_version_externally_managed : <EOL> return _install . run ( self ) <EOL> caller = sys . _getframe ( <NUM_LIT:2> ) <EOL> caller_module = caller . f_globals . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> caller_name = caller . f_code . co_name <EOL> if caller_module != '<STR_LIT>' or caller_name != '<STR_LIT>' : <EOL> _install . run ( self ) <EOL> else : <EOL> self . do_egg_install ( ) <EOL> def do_egg_install ( self ) : <EOL> easy_install = self . distribution . get_command_class ( '<STR_LIT>' ) <EOL> cmd = easy_install ( <EOL> self . distribution , args = "<STR_LIT:x>" , root = self . root , record = self . record , <EOL> ) <EOL> cmd . ensure_finalized ( ) <EOL> cmd . always_copy_from = '<STR_LIT:.>' <EOL> cmd . package_index . scan ( glob . glob ( '<STR_LIT>' ) ) <EOL> self . run_command ( '<STR_LIT>' ) <EOL> args = [ self . distribution . get_command_obj ( '<STR_LIT>' ) . egg_output ] <EOL> if setuptools . bootstrap_install_from : <EOL> args . insert ( <NUM_LIT:0> , setuptools . bootstrap_install_from ) <EOL> cmd . args = args <EOL> cmd . run ( ) <EOL> setuptools . bootstrap_install_from = None <EOL> install . sub_commands = [ <EOL> cmd for cmd in _install . sub_commands if cmd [ <NUM_LIT:0> ] not in install . _nc <EOL> ] + install . new_commands </s>
