gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicola...@apache.org
Subject cvs commit: jakarta-gump/python ruper.py
Date Sat, 26 Apr 2003 22:42:24 GMT
nicolaken    2003/04/26 15:42:24

  Modified:    python   ruper.py
  Log:
  Add an update method that does not download files that are already present
  in the local repository.
  
  Revision  Changes    Path
  1.5       +9 -2      jakarta-gump/python/ruper.py
  
  Index: ruper.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/ruper.py,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ruper.py	26 Apr 2003 21:43:43 -0000	1.4
  +++ ruper.py	26 Apr 2003 22:42:24 -0000	1.5
  @@ -36,7 +36,14 @@
       remoteurl = self.resolve(resource)
       urllib.urlretrieve(remoteurl, '%s/%s' % (destinationDir,resource.standardName()))
   
  -
  +  def update(self, resource, destinationDir):
  +   #download the file if not present
  +   if os.path.exists('%s/%s' % (destinationDir,resource.standardName())):
  +     if default.debug: print 'using cached file'
  +   else:
  +     if default.debug: print 'caching file...'
  +     download((self, resource, destinationDir))
  +     if default.debug: print '...done'
   
   # Resource
   class RuperResource(object):
  @@ -59,7 +66,7 @@
     print resource.standardName()
     repository = RuperRepository('http://www.ibiblio.org/maven','maven')
     print repository.resolve(resource)
  -  repository.download(resource,dir.cache)
  +  repository.update(resource,dir.cache)
   
   
   
  
  
  

Mime
View raw message