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 view.py
Date Mon, 28 Apr 2003 21:49:31 GMT
rubys       2003/04/28 14:49:31

  Modified:    python/gump __init__.py view.py
  Log:
  Restore lost changes
  
  Revision  Changes    Path
  1.3       +58 -17    jakarta-gump/python/gump/__init__.py
  
  Index: __init__.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/__init__.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- __init__.py	28 Apr 2003 21:38:02 -0000	1.2
  +++ __init__.py	28 Apr 2003 21:49:31 -0000	1.3
  @@ -319,11 +319,11 @@
       if not self['banner-image']:
         self['banner-image']="http://jakarta.apache.org/images/jakarta-logo.gif"
       if not self['banner-link']: self['banner-link']="http://jakarta.apache.org"
  -    if not self.logdir: self.logdir=self.basedir+"/log"
  -    if not self.cvsdir: self.cvsdir=self.basedir+"/cvs"
  +    if not self.logdir: self.logdir=os.path.join(self.basedir,"log")
  +    if not self.cvsdir: self.cvsdir=os.path.join(self.basedir,"cvs")
       if not self.pkgdir: self.pkgdir=self.basedir
       if self.deliver:
  -      if not self.scratchdir: self.scratchdir=self.basedir+"/scratch"
  +      if not self.scratchdir: self.scratchdir=os.path.join(self.basedir,"scratch")
   
   # represents a <profile/> element
   class Profile(Named):
  @@ -396,6 +396,23 @@
   
       # complete properties
       if self.ant: self.ant.complete(self)
  +    # compute home directory
  +    if self.home and isinstance(self.home,Single):
  +      if self.home.nested:
  +        srcdir=Module.list[self.module].srcdir
  +        self.home=os.path.normpath(os.path.join(srcdir,self.home.nested))
  +      elif self.home.parent:
  +        self.home=os.path.normpath(os.path.join(workspace.basedir,self.home.parent))
  +    elif not self.home: self.home=os.path.join(workspace.basedir,self.name)
  +
  +    # resolve jars
  +    for jar in self.jar:
  +      if self.home and jar.name:
  +        jar.path=os.path.normpath(os.path.join(self.home,jar.name))
  +
  +    # expand properties
  +    if self.ant: self.ant.expand(self)
  +
   
       # ensure that every project that this depends on is complete
       self.isComplete=1
  @@ -403,11 +420,8 @@
         project=Project.list.get(depend.project,None)
         if project: project.complete(workspace)
   
  -    # compute home directory
  -    if self.home and isinstance(self.home,Single):
  -      if self.home.nested:
  -        srcdir=Module.list[self.module].srcdir
  -        self.home=srcdir + os.sep + self.home.nested
  +    # complete properties
  +    if self.ant: self.ant.complete(self)
   
       # inherit dependencies:
       self.inheritDependencies()
  @@ -474,8 +488,9 @@
       self.property=Multiple(Property)
       self.jvmarg=Multiple()
   
  -  # provide default elements when not defined in xml
  -  def complete(self,project):
  +  # expand properties - in other words, do everything to complete the
  +  # entry that does NOT require referencing another project
  +  def expand(self,project):
   
       # convert property elements which reference a project into dependencies
       for property in self.property:
  @@ -484,8 +499,7 @@
         if property.reference=="srcdir": continue
         if project.hasFullDependencyOn(property.project): continue
   
  -      depend=Depend({})
  -      depend['project']=property.project
  +      depend=Depend({'project':property.project})
         if not property.classpath: depend['noclasspath']=Single({})
         if property.runtime: depend['runtime']=property.runtime
         project.depend.append(depend)
  @@ -495,11 +509,14 @@
         property=Property(depend.__dict__)
         property['reference']='jarpath'
         property['name']=depend.project
  -      del property['project']
         self.property.append(property)
         project.depend.append(depend)
       self.depend=None
   
  +  # complete the definition - it is safe to reference other projects
  +  # at this point
  +  def complete(self,project):
  +
       for property in self.property: property.complete(project)
   
   # represents a <nag/> element
  @@ -518,7 +535,31 @@
     def complete(self,project):
       if self.reference=='home':
         self.value=Project.list[self.project].home
  -    if self.reference=='srcdir':
  +
  +    elif self.reference=='srcdir':
  +      module=Project.list[self.project].module
  +      self.value=Module.list[module].srcdir
  +
  +    elif self.reference=='jarpath':
  +      target=Project.list[self.project]
  +      if self.id:
  +	for jar in target.jar:
  +	  if jar.id==self.id:
  +	    self.value=jar.path
  +	    break
  +	else:
  +	  raise str(("jar with id %s was not found in project %s "
  +	     "referenced by %s") % (self.id, target.name, project.name))
  +      elif len(target.jar)==1:
  +	self.value=target.jar[0].path
  +      elif len(target.jar)>1:
  +	raise str(("Multiple jars defined by project %s referenced by %s; " +
  +	   "an id attribute is required to select the one you want") %
  +	   (target.name, project.name))
  +      else:
  +	raise str("Project %s referenced by %s defines no jars as output" %
  +	  (target.name, project.name))
  +
         module=Project.list[self.project].module
         self.value=Module.list[module].srcdir
   
  
  
  
  1.3       +5 -5      jakarta-gump/python/gump/view.py
  
  Index: view.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/view.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- view.py	28 Apr 2003 21:38:02 -0000	1.2
  +++ view.py	28 Apr 2003 21:49:31 -0000	1.3
  @@ -214,8 +214,7 @@
       # add in work directories
       srcdir=Module.list[project.module].srcdir
       for work in project.work:
  -      jarpath=os.path.normpath(os.path.join(srcdir,work.nested))
  -      self.classpath.InsertStringItem(i,jarpath)
  +      self.classpath.InsertStringItem(i,jar.path)
         i=i+1
   
       # add in depends and options
  @@ -243,6 +242,7 @@
           i=i+1
   
       self.property.SetColumnWidth(0,wxLIST_AUTOSIZE_USEHEADER)
  +    self.property.SetColumnWidth(1,wxLIST_AUTOSIZE_USEHEADER)
   
     # show the xml description for a single item
     def selectItem(self, event):
  
  
  

Mime
View raw message