/[cvs]/nfo/projects/netfraggle/bin/fraggleParserXML.py
ViewVC logotype

Diff of /nfo/projects/netfraggle/bin/fraggleParserXML.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by xabbu, Wed Aug 25 21:41:48 2004 UTC revision 1.5 by xabbu, Sun Aug 29 22:52:40 2004 UTC
# Line 3  Line 3 
3  import sys  import sys
4  import fraggleError  import fraggleError
5    
6    #from fraggleError import *
7  from xml.dom.ext.reader import Sax2  from xml.dom.ext.reader import Sax2
8  from xml.marshal import *  from xml.marshal import *
9    
# Line 23  class fraggleParserXML: Line 24  class fraggleParserXML:
24          try:          try:
25              dom = self.reader.fromStream(input)              dom = self.reader.fromStream(input)
26          except:          except:
27              fraggleError.errorFileNotFound()              fraggleError.errorXMLStreamNotValid()
28          return dom          return dom
29            
30      def printXML(self,inputDom,outputLocation):      def printXML(self,inputDom,outputLocation):
# Line 31  class fraggleParserXML: Line 32  class fraggleParserXML:
32              file = open(outputLocation,"w")              file = open(outputLocation,"w")
33              self.reader.PrettyPrint(inputDom,file)              self.reader.PrettyPrint(inputDom,file)
34          except:          except:
35              fraggleError.errorFileNotFound()              fraggleError.errorFileNotFound(outputLocation)
36                            
37      def marshalXML(self,values,outputLocation):      def marshalXML(self,values,outputLocation):
38          try:          try:
# Line 39  class fraggleParserXML: Line 40  class fraggleParserXML:
40             # self.marshall.dump(values,file)             # self.marshall.dump(values,file)
41              generic.dump(values,file)              generic.dump(values,file)
42          except:          except:
43              fraggleError.errorFileNotFound()              fraggleError.errorFileNotFound(outputLocation)
44                    
45                                    
46          #print generic.dumps(values)          #print generic.dumps(values)
# Line 48  class fraggleParserXML: Line 49  class fraggleParserXML:
49          try:          try:
50              file = open(inputLocation,"r")              file = open(inputLocation,"r")
51          except:          except:
52              fraggleError.errorFileNotFound()              return
53                #fraggleError.errorFileNotFound(inputLocation)
54          return generic.load(file)          return generic.load(file)
55            

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed