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 gumpcore.py gumputil.py
Date Sat, 26 Apr 2003 10:32:46 GMT
nicolaken    2003/04/26 03:32:46

  Modified:    python   gumpcore.py gumputil.py
  Log:
  Last fixes to make Gump find all the stuff with the new paths.
  
  Revision  Changes    Path
  1.12      +11 -8     jakarta-gump/python/gumpcore.py
  
  Index: gumpcore.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gumpcore.py,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- gumpcore.py	26 Apr 2003 09:29:55 -0000	1.11
  +++ gumpcore.py	26 Apr 2003 10:32:45 -0000	1.12
  @@ -79,7 +79,7 @@
       # parse out '@@DATE@@'
       for (name,value) in attrs.items():
         self.__dict__[name]=value.replace('@@DATE@@',default.date)
  -      
  +
       # setup internal character field
       if not '@text' in self.__dict__: self.init()
       self.__dict__['@text']=''
  @@ -126,8 +126,8 @@
   class Named(GumpBase):
     def __new__(cls,attrs):
       href=attrs.get('href')
  -    
  -    if href: 
  +
  +    if href:
         newHref=gumpCache(href)
         if default.debug: print 'opening: ' + newHref + '\n'
         element=SAXDispatcher(open(newHref),cls.__name__.lower(),cls).docElement
  @@ -410,16 +410,19 @@
           return ret
         
   #########################################################################
  -#			    Demonstration code				                        #
  +#			    Demonstration code			        #
   #########################################################################
   
   if __name__=='__main__':
  -  print "*** starting ***"
  -  os.chdir(dir.base)
  -  workspace=load(default.workspace)
  +  print 
  +  print
  +  print "               *** starting DEMO ***"
  +
  +  workspace=load(gumpPath(default.workspace))
   
     print
  -  print "*** workspace "+default.workspace+" ***"
  +  print "workspace: "+default.workspace
  +  print "full path: "+gumpPath(default.workspace)
     print
     print 'basedir:\t', workspace.basedir
     print 'pkgdir:\t\t', workspace.pkgdir
  
  
  
  1.7       +7 -6      jakarta-gump/python/gumputil.py
  
  Index: gumputil.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gumputil.py,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- gumputil.py	26 Apr 2003 10:03:53 -0000	1.6
  +++ gumputil.py	26 Apr 2003 10:32:45 -0000	1.7
  @@ -13,12 +13,17 @@
   #                     Utility functions                                 #
   #########################################################################
   
  +# returns the path absolutized relative to the base gump dir
  +def gumpPath(path):
  +  return os.path.normpath('%s/%s' % (dir.base,path))
  +                 
  +
   # returns the path of the file in the href, cached if remote
   def gumpCache(href):
   
     #if it's a local file get it locally
     if not href.startswith('http://'):
  -    newHref=href;
  +    newHref=gumpPath(href);
     else:
      if debug: print 'url: ' + href
      if not os.path.exists(dir.cache):  mkdir(dir.cache)
  @@ -36,7 +41,7 @@
        urllib.urlretrieve(href, newHref)
        if debug: print '...done'
   
  -   return newHref
  +  return newHref
   
   # display an error message in standard formatting
   def gumpMessage(type, error, description):
  @@ -55,7 +60,3 @@
     print
     print
   
  -# returns the path absolutized relative to the base gump dir
  -def gumpPath(path):
  -  return os.path.normpath('%s/%s' % (dir.base,path))
  -                 
  
  
  

Mime
View raw message