Ejemplo n.º 1
0
 def getComments(self):
      """Get the properties text of the set reading and parsing the gipsy log file, just after run HEADER task. When it gets a XeqError exception raises a gipsyException with a
         properly message
     
      **Raises:**
         gipsyException
         
      
      """
     
      if(self.comments!=""):
         return self.comments
      elif(self.setname!=None):
         try:
             xeq("HEADER INSET=%s"%(self.setname))
         except XeqError:
             raise gipsyException("%s: HEADER error"%(self.setname))
             return
         f = open(GIPSYLOG,"r")
         rev = [ line for line in xreverse(f) ]
         comments="" 
         for line in rev:
             if line.startswith('='):
                 self.comments=comments
                 return comments
             elif line.startswith("COMMENT"):
                 #skip 'comment='
                 begin=line.find('=') +1
                 comments=line[begin:].lstrip()+comments
Ejemplo n.º 2
0
 def getHistory(self):
      """Get the history text of the set reading and parsing the gipsy log file, just after run HEADER task. When it gets a XeqError exception raises a gipsyException with a
         properly message
     
      **Raises:**
         gipsyException
         
     
      """
      if(self.history!=""):
         return self.history
      elif(self.setname!=None):
         try:
             xeq("HEADER INSET=%s"%(self.setname))
         except XeqError:
             raise gipsyException("%s: HEADER error"%(self.setname))
             return
         f = open(GIPSYLOG,"r")
         rev = [ line for line in xreverse(f) ]
         history="" 
         for line in rev:
             if line.startswith('='):
                 self.history=history
                 return history
             elif line.startswith("HISTORY"):
                 #skip 'history='
                 #begin=line.find('=') +1
                 #history=line[begin:].lstrip()+history
                 history=line+history
         f.close()