home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_2556 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-10-31  |  3.7 KB  |  77 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import setuptools
  5. import sys
  6. import glob
  7. from distutils.command.install import install as _install
  8. from distutils.errors import DistutilsArgError
  9.  
  10. class install(_install):
  11.     user_options = _install.user_options + [
  12.         ('old-and-unmanageable', None, 'Try not to use this!'),
  13.         ('single-version-externally-managed', None, "used by system package builders to create 'flat' eggs")]
  14.     boolean_options = _install.boolean_options + [
  15.         'old-and-unmanageable',
  16.         'single-version-externally-managed']
  17.     new_commands = [
  18.         ('install_egg_info', (lambda self: True)),
  19.         ('install_scripts', (lambda self: True))]
  20.     _nc = dict(new_commands)
  21.     sub_commands = _[1] + new_commands
  22.     
  23.     def initialize_options(self):
  24.         _install.initialize_options(self)
  25.         self.old_and_unmanageable = None
  26.         self.single_version_externally_managed = None
  27.         self.no_compile = None
  28.  
  29.     
  30.     def finalize_options(self):
  31.         _install.finalize_options(self)
  32.         if self.root:
  33.             self.single_version_externally_managed = True
  34.         elif self.single_version_externally_managed:
  35.             if not (self.root) and not (self.record):
  36.                 raise DistutilsArgError('You must specify --record or --root when building system packages')
  37.             not (self.record)
  38.         
  39.  
  40.     
  41.     def handle_extra_path(self):
  42.         if self.root or self.single_version_externally_managed:
  43.             return _install.handle_extra_path(self)
  44.         self.path_file = None
  45.         self.extra_dirs = ''
  46.  
  47.     
  48.     def run(self):
  49.         if self.old_and_unmanageable or self.single_version_externally_managed:
  50.             return _install.run(self)
  51.         caller = sys._getframe(2)
  52.         caller_module = caller.f_globals.get('__name__', '')
  53.         caller_name = caller.f_code.co_name
  54.         if caller_module != 'distutils.dist' or caller_name != 'run_commands':
  55.             _install.run(self)
  56.         else:
  57.             self.do_egg_install()
  58.  
  59.     
  60.     def do_egg_install(self):
  61.         easy_install = self.distribution.get_command_class('easy_install')
  62.         cmd = easy_install(self.distribution, args = 'x', root = self.root, record = self.record)
  63.         cmd.ensure_finalized()
  64.         cmd.always_copy_from = '.'
  65.         cmd.package_index.scan(glob.glob('*.egg'))
  66.         self.run_command('bdist_egg')
  67.         args = [
  68.             self.distribution.get_command_obj('bdist_egg').egg_output]
  69.         if setuptools.bootstrap_install_from:
  70.             args.insert(0, setuptools.bootstrap_install_from)
  71.         
  72.         cmd.args = args
  73.         cmd.run()
  74.         setuptools.bootstrap_install_from = None
  75.  
  76.  
  77.