Changeset 79

Show
Ignore:
Timestamp:
07/04/06 15:54:59 (2 years ago)
Author:
mk
Message:

Implementation of --static command line option (closes ticket #36).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/mk/cheesecake/cheesecake_index.py

    r78 r79  
    819819 
    820820    def __init__(self, name="", url="", path="", sandbox=None, config=None, 
    821                 logfile=None, verbose=False, quiet=False): 
     821                logfile=None, verbose=False, quiet=False, static_only=False): 
    822822        """Initialize critical variables, download and unpack package, 
    823823        walk package tree. 
     
    837837        self.verbose = verbose 
    838838        self.quiet = quiet 
     839        self.static_only = static_only 
    839840 
    840841        self.package_types = { 
     
    874875 
    875876        # Install package. 
    876         self.install_pkg() 
     877        if self.static_only: 
     878            self.index["INSTALLABILITY"].remove_subindex('install') 
     879        else: 
     880            self.install_pkg() 
    877881 
    878882        # When checking an egg exclude irrelevant indices. 
     
    12731277    """ 
    12741278    parser = OptionParser() 
    1275     parser.add_option("-n", "--name", dest="name", 
    1276                       default="", help="package name (will be retrieved via setuptools utilities, if present)") 
    1277     parser.add_option("-u", "--url", dest="url", 
    1278                       default="", help="package URL") 
    1279     parser.add_option("-p", "--path", dest="path", 
    1280                       default="", help="path of tar.gz/zip package on local file system") 
    1281     parser.add_option("-s", "--sandbox", dest="sandbox", 
    1282                       default=None, 
    1283                       help="directory where package will be unpacked "\ 
    1284                            "(default is to use random directory inside %s)" % tempfile.gettempdir()) 
    12851279    parser.add_option("-c", "--config", dest="config", 
    12861280                      default=None, 
     
    12891283                      default=None, 
    12901284                      help="file to log all cheesecake messages") 
     1285    parser.add_option("-n", "--name", dest="name", 
     1286                      default="", help="package name (will be retrieved via setuptools utilities, if present)") 
     1287    parser.add_option("-p", "--path", dest="path", 
     1288                      default="", help="path of tar.gz/zip package on local file system") 
     1289    parser.add_option("-q", "--quiet", action="store_true", dest="quiet", 
     1290                      default=False, help="only print Cheesecake index value (default=False)") 
     1291    parser.add_option("-s", "--sandbox", dest="sandbox", 
     1292                      default=None, 
     1293                      help="directory where package will be unpacked "\ 
     1294                           "(default is to use random directory inside %s)" % tempfile.gettempdir()) 
     1295    parser.add_option("-t", "--static", action="store_true", dest="static", 
     1296                      default=False, help="don't run any code from the package being tested (default=False)") 
     1297    parser.add_option("-u", "--url", dest="url", 
     1298                      default="", help="package URL") 
    12911299    parser.add_option("-v", "--verbose", action="store_true", dest="verbose", 
    12921300                      default=False, help="verbose output (default=False)") 
    1293     parser.add_option("-q", "--quiet", action="store_true", dest="quiet", 
    1294                       default=False, help="only print Cheesecake index value (default=False)") 
    12951301 
    12961302    (options, args) = parser.parse_args() 
     
    13091315    verbose = options.verbose 
    13101316    quiet = options.quiet 
     1317    static_only = options.static 
    13111318 
    13121319    if not name and not url and not path: 
     
    13171324        c = Cheesecake(name=name, url=url, path=path, sandbox=sandbox, 
    13181325                       config=config, logfile=logfile, verbose=verbose, 
    1319                        quiet=quiet
     1326                       quiet=quiet, static_only=static_only
    13201327        c.compute_cheesecake_index() 
    13211328        c.cleanup()