Changeset 466

Show
Ignore:
Timestamp:
05/19/08 09:31:13 (8 months ago)
Author:
jmowery
Message:

defaulting a function argument to a function call does not work as originally expected
defaults changed to None with initialization inside the call

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/trunk-pmd-intproto/server/storage.py

    r465 r466  
    6060        return path 
    6161 
    62 def collect_dirs(path, stop=os.getcwd()): 
     62def collect_dirs(path, stop=None): 
    6363        '''Get a list of the absolute paths to each directory in path until stop''' 
    6464        dir_list = [] 
     65        if stop is None: 
     66                stop = os.getcwd() 
    6567        path = os.path.realpath(os.path.expanduser(path)) 
    6668        if not in_subdir(path, stop): 
     
    245247                return times 
    246248 
    247         def find_recent(self, name, date=int(time.time())): 
     249        def find_recent(self, name, date=None): 
    248250                '''Return the most recent version of name as of date.''' 
     251                if date is None: 
     252                        date = int(time.time()) 
    249253                times = self.list_revisions(name) 
    250254                cur = 0 
     
    295299                self.modified = False 
    296300 
    297         def rollback(self, date=int(time.time()), name='.', recursive=False): 
     301        def rollback(self, date=None, name='.', recursive=False): 
    298302                '''Roll back (or forward) to date. If name specifies a directory set the applied time of all files it contains to the most recent as of date; else operate only on name.''' 
     303                if date is None: 
     304                        date = int(time.time()) 
    299305                raise NotImplementedError 
    300306