|
Lines 7-12
Link Here
|
| 7 |
""" |
7 |
""" |
| 8 |
|
8 |
|
| 9 |
import xml.sax, string |
9 |
import xml.sax, string |
|
|
10 |
from GLIUtility import * |
| 10 |
|
11 |
|
| 11 |
class SimpleXMLParser(xml.sax.ContentHandler): |
12 |
class SimpleXMLParser(xml.sax.ContentHandler): |
| 12 |
|
13 |
|
|
Lines 15-20
Link Here
|
| 15 |
# @param self Parameter description |
16 |
# @param self Parameter description |
| 16 |
# @param file=None Parameter description |
17 |
# @param file=None Parameter description |
| 17 |
def __init__(self, file=None): |
18 |
def __init__(self, file=None): |
|
|
19 |
xml.sax.handler.ContentHandler.__init__(self) |
| 18 |
self._xml_elements = [] |
20 |
self._xml_elements = [] |
| 19 |
self._xml_attrs = [] |
21 |
self._xml_attrs = [] |
| 20 |
self._xml_current_data = "" |
22 |
self._xml_current_data = "" |
|
Lines 108-114
Link Here
|
| 108 |
Parse serialized configuration file. |
110 |
Parse serialized configuration file. |
| 109 |
""" |
111 |
""" |
| 110 |
if path == None and self._path == None: |
112 |
if path == None and self._path == None: |
| 111 |
raise "NoFileGiven","You must specify a file to parse!" |
113 |
raise GLIException("SimpleXMLParserError",'fatal', 'parse', "You must specify a file to parse!") |
| 112 |
elif path == None: |
114 |
elif path == None: |
| 113 |
xml.sax.parse(self._path, self) |
115 |
xml.sax.parse(self._path, self) |
| 114 |
else: |
116 |
else: |