Changeset 125 in tailor for vcpx/tailor.py


Ignore:
Timestamp:
08/01/04 20:59:20 (9 years ago)
Author:
lele@…
Hash name:
20040801185920-97f81-92a04ac05e33fe3a6dbd866ebf7e24dd9adb3b69
Message:

Adjust minor nits in the new TailorConfig?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/tailor.py

    r124 r125  
    2424    def __init__(self, options): 
    2525        self.options = options 
     26         
     27    def __call__(self, args): 
     28        from os.path import abspath 
     29         
    2630        self.__load() 
    27          
    28     def __call__(self, args): 
    29         if len(args) == 0 and not self.options.bootstrap: 
     31 
     32        if len(args) == 0 and self.options.update: 
    3033            args = self.config.keys() 
    3134 
    32         for root in args: 
     35        for a in args: 
     36            root = abspath(a) 
     37             
    3338            tailored = TailorizedProject(root, self.options.verbose, self) 
    3439             
     
    3944                                   self.options.module, 
    4045                                   self.options.revision) 
    41             elif options.update: 
     46            elif self.options.migrate: 
     47                tailored.migrateConfiguration() 
     48            elif self.options.update: 
    4249                tailored.update(self.options.single_commit, 
    4350                                self.options.concatenate_logs) 
    44             elif options.migrate: 
    45                 tailored.migrateConfiguration() 
    46              
     51 
     52        self.__save() 
     53         
    4754    def __save(self): 
    4855        from pprint import pprint 
     
    5360 
    5461    def __load(self): 
    55         configfile = open(self.options.configfile) 
    56         self.config = eval(configfile.read()) 
    57         configfile.close() 
    58  
     62        from os.path import exists 
     63 
     64        if exists(self.options.configfile): 
     65            configfile = open(self.options.configfile) 
     66            self.config = eval(configfile.read()) 
     67            configfile.close() 
     68        else: 
     69            self.config = {} 
     70             
    5971    def loadProject(self, project): 
    6072        info = self.config.get(project.root) 
Note: See TracChangeset for help on using the changeset viewer.