dist.py 2.07 KB
Newer Older
Eric Coissac committed
1 2 3 4 5 6
'''
Created on 20 oct. 2012

@author: coissac
'''

7 8 9 10
try:
    from setuptools.dist import Distribution as ori_Distribution
except ImportError:
    from distutils.dist import Distribution as ori_Distribution
11

12
# from distutils.dist import Distribution as ori_Distribution
Eric Coissac committed
13 14 15 16 17 18

class Distribution(ori_Distribution):
    
    def __init__(self,attrs=None):
        self.executables = None
        self.ctools = None
19
        self.files = None
Eric Coissac committed
20 21 22
        self.build_cexe  = None
        self.deprecated_scripts = None
        self.zip_safe=False
23
        self.sse = None
24
        self.serenity=attrs['serenity']
Eric Coissac committed
25 26 27
        
        ori_Distribution.__init__(self, attrs)
        
28
        self.global_options.insert(0,('serenity', None, "install or build the package in a python virtualenv "
29 30 31
                                                       "without polluting the installed python and with many "
                                                       "checks during the installation process"
                                     ))
32 33
        self.global_options.insert(0,('virtualenv', None, "if the installation is done using the serenity mode "
                                                        "this option allows for specifying the virtualenv name. "
34 35 36
                                                        "By default the name is PACKAGE-VERSION"
                                     ))
        
37 38 39 40 41
    def run_commands(self):
        """Run each command that was seen on the setup script command line.
        Uses the list of commands found and cache of command objects
        created by 'get_command_obj()'.
        """
42
#        self.run_command('littlebigman')
43 44
        ori_Distribution.run_commands(self)
        
45
        
Eric Coissac committed
46
    def has_executables(self):
47
        return self.executables is not None and self.executables
Eric Coissac committed
48 49
        
    def has_ctools(self):
50 51 52 53
        return self.ctools is not None and self.ctools
        
    def has_files(self):
        return self.files is not None and self.files
Eric Coissac committed
54 55
        
    def has_deprecated_scripts(self):
56
        return self.deprecated_scripts is not None and self.deprecated_scripts
Eric Coissac committed
57 58