gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject cvs commit: jakarta-gump/python/gump __init__.py model.py
Date Sun, 04 May 2003 19:39:50 GMT
rubys       2003/05/04 12:39:50

  Modified:    python/gump __init__.py model.py
  Log:
  Add method for computing the cvsroot for a module
  
  Revision  Changes    Path
  1.7       +12 -4     jakarta-gump/python/gump/__init__.py
  
  Index: __init__.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/__init__.py,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- __init__.py	2 May 2003 01:31:10 -0000	1.6
  +++ __init__.py	4 May 2003 19:39:50 -0000	1.7
  @@ -288,6 +288,13 @@
     def __nonzero__(self):
       return self.delegate
   
  +  def __setitem__(self,name,value):
  +    self.delegate[name]=value
  +
  +  def __getitem__(self,name):
  +    if name in self.delegate.__dict__: return self.delegate.__dict__[name]
  +
  +
   class Multiple(list):
     """Properties which can hold multiple instances."""
   
  @@ -351,10 +358,11 @@
   
       raise IOError, 'workspace '+file+' not found'
   
  -  from gump.model import Workspace, Module, Project
  +  from gump.model import Workspace, Repository, Module, Project
     workspace=SAXDispatcher(file,'workspace',Workspace).docElement
     workspace.complete()
   
  +  for repository in Repository.list.values(): repository.complete(workspace)
     for module in Module.list.values(): module.complete(workspace)
     for project in Project.list.values(): project.complete(workspace)
     return workspace
  
  
  
  1.8       +25 -3     jakarta-gump/python/gump/model.py
  
  Index: model.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/model.py,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- model.py	4 May 2003 08:49:06 -0000	1.7
  +++ model.py	4 May 2003 19:39:50 -0000	1.8
  @@ -126,8 +126,24 @@
       self.redistributable=Single()
       self.project=Multiple(Project)
   
  +  def cvsroot(self):
  +    if not self.cvs: return
  +    repository=Repository.list[self.cvs.repository]
  +
  +    root=':' + str(repository.root.method) + ':'
  +    if repository.root.user: root+=str(repository.root.user)
  +    if repository.root.hostname:
  +      root+='@'
  +      if self.cvs['host-prefix']: root+=self.cvs['host-prefix']+'.'
  +      root+=str(repository.root.hostname) + ':'
  +    root+=str(repository.root.path)
  +    if self.cvs.dir: root+='/'+str(self.cvs.dir)
  +
  +    return root
  +
     # provide default elements when not defined in xml
     def complete(self,workspace):
  +    if self.tag and self.cvs: self.cvs.tag=self.tag
       self.srcdir=os.path.join(str(workspace.basedir),self.srcdir or self.name)
       for project in self.project:
         if not project.module: project.module=self.name
  @@ -141,6 +157,12 @@
       self.cvsweb=Single()
       self.root=Single(RepositoryRoot)
       self.redistributable=Single()
  +  def complete(self,workspace):
  +    if self.root:
  +      if self.user: self.root.user=self.user
  +      if self.path: self.root.path=self.path
  +      if self.method: self.root.method=self.method
  +      if self['host-name']: self.root['host-name']=self['host-name']
   
   # represents a <root/> element within a <repository/> element
   class RepositoryRoot(GumpBase):
  
  
  

Mime
View raw message