1# Copyright (c) 2017, The MITRE Corporation. All rights reserved.
2# See LICENSE.txt for complete terms.
3
4import sys
5
6from mixbox.binding_utils import *
7from . import cybox_common
8from . import hostname_object
9from . import uri_object
10
11
12class URLHistoryEntryType(GeneratedsSuper):
13    """The URLHistoryEntryType captures the properties of a URL history
14    entry for a particular browser."""
15
16    subclass = None
17    superclass = None
18    def __init__(self, URL=None, Hostname=None, Referrer_URL=None, Page_Title=None, User_Profile_Name=None, Visit_Count=None, Manually_Entered_Count=None, Modification_DateTime=None, Expiration_DateTime=None, First_Visit_DateTime=None, Last_Visit_DateTime=None):
19        self.URL = URL
20        self.Hostname = Hostname
21        self.Referrer_URL = Referrer_URL
22        self.Page_Title = Page_Title
23        self.User_Profile_Name = User_Profile_Name
24        self.Visit_Count = Visit_Count
25        self.Manually_Entered_Count = Manually_Entered_Count
26        self.Modification_DateTime = Modification_DateTime
27        self.Expiration_DateTime = Expiration_DateTime
28        self.First_Visit_DateTime = First_Visit_DateTime
29        self.Last_Visit_DateTime = Last_Visit_DateTime
30    def factory(*args_, **kwargs_):
31        if URLHistoryEntryType.subclass:
32            return URLHistoryEntryType.subclass(*args_, **kwargs_)
33        else:
34            return URLHistoryEntryType(*args_, **kwargs_)
35    factory = staticmethod(factory)
36    def get_URL(self): return self.URL
37    def set_URL(self, URL): self.URL = URL
38    def get_Hostname(self): return self.Hostname
39    def set_Hostname(self, Hostname): self.Hostname = Hostname
40    def get_Referrer_URL(self): return self.Referrer_URL
41    def set_Referrer_URL(self, Referrer_URL): self.Referrer_URL = Referrer_URL
42    def get_Page_Title(self): return self.Page_Title
43    def set_Page_Title(self, Page_Title): self.Page_Title = Page_Title
44    def validate_StringObjectPropertyType(self, value):
45        # Validate type cybox_common.StringObjectPropertyType, a restriction on None.
46        pass
47    def get_User_Profile_Name(self): return self.User_Profile_Name
48    def set_User_Profile_Name(self, User_Profile_Name): self.User_Profile_Name = User_Profile_Name
49    def get_Visit_Count(self): return self.Visit_Count
50    def set_Visit_Count(self, Visit_Count): self.Visit_Count = Visit_Count
51    def validate_NonNegativeIntegerObjectPropertyType(self, value):
52        # Validate type cybox_common.NonNegativeIntegerObjectPropertyType, a restriction on None.
53        pass
54    def get_Manually_Entered_Count(self): return self.Manually_Entered_Count
55    def set_Manually_Entered_Count(self, Manually_Entered_Count): self.Manually_Entered_Count = Manually_Entered_Count
56    def get_Modification_DateTime(self): return self.Modification_DateTime
57    def set_Modification_DateTime(self, Modification_DateTime): self.Modification_DateTime = Modification_DateTime
58    def get_Expiration_DateTime(self): return self.Expiration_DateTime
59    def set_Expiration_DateTime(self, Expiration_DateTime): self.Expiration_DateTime = Expiration_DateTime
60    def get_First_Visit_DateTime(self): return self.First_Visit_DateTime
61    def set_First_Visit_DateTime(self, First_Visit_DateTime): self.First_Visit_DateTime = First_Visit_DateTime
62    def get_Last_Visit_DateTime(self): return self.Last_Visit_DateTime
63    def set_Last_Visit_DateTime(self, Last_Visit_DateTime): self.Last_Visit_DateTime = Last_Visit_DateTime
64    def hasContent_(self):
65        if (
66            self.URL is not None or
67            self.Hostname is not None or
68            self.Referrer_URL is not None or
69            self.Page_Title is not None or
70            self.User_Profile_Name is not None or
71            self.Visit_Count is not None or
72            self.Manually_Entered_Count is not None or
73            self.Modification_DateTime is not None or
74            self.Expiration_DateTime is not None or
75            self.First_Visit_DateTime is not None or
76            self.Last_Visit_DateTime is not None
77            ):
78            return True
79        else:
80            return False
81    def export(self, lwrite, level, namespace_='URLHistoryObj:', name_='URLHistoryEntryType', namespacedef_='', pretty_print=True):
82        if pretty_print:
83            eol_ = '\n'
84        else:
85            eol_ = ''
86        showIndent(lwrite, level, pretty_print)
87        lwrite('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
88        already_processed = set()
89        self.exportAttributes(lwrite, level, already_processed, namespace_, name_='URLHistoryEntryType')
90        if self.hasContent_():
91            lwrite('>%s' % (eol_, ))
92            self.exportChildren(lwrite, level + 1, namespace_, name_, pretty_print=pretty_print)
93            showIndent(lwrite, level, pretty_print)
94            lwrite('</%s%s>%s' % (namespace_, name_, eol_))
95        else:
96            lwrite('/>%s' % (eol_, ))
97    def exportAttributes(self, lwrite, level, already_processed, namespace_='URLHistoryObj:', name_='URLHistoryEntryType'):
98        pass
99    def exportChildren(self, lwrite, level, namespace_='URLHistoryObj:', name_='URLHistoryEntryType', fromsubclass_=False, pretty_print=True):
100        if pretty_print:
101            eol_ = '\n'
102        else:
103            eol_ = ''
104        if self.URL is not None:
105            self.URL.export(lwrite, level, 'URLHistoryObj:', name_='URL', pretty_print=pretty_print)
106        if self.Hostname is not None:
107            self.Hostname.export(lwrite, level, 'URLHistoryObj:', name_='Hostname', pretty_print=pretty_print)
108        if self.Referrer_URL is not None:
109            self.Referrer_URL.export(lwrite, level, 'URLHistoryObj:', name_='Referrer_URL', pretty_print=pretty_print)
110        if self.Page_Title is not None:
111            self.Page_Title.export(lwrite, level, 'URLHistoryObj:', name_='Page_Title', pretty_print=pretty_print)
112        if self.User_Profile_Name is not None:
113            self.User_Profile_Name.export(lwrite, level, 'URLHistoryObj:', name_='User_Profile_Name', pretty_print=pretty_print)
114        if self.Visit_Count is not None:
115            self.Visit_Count.export(lwrite, level, 'URLHistoryObj:', name_='Visit_Count', pretty_print=pretty_print)
116        if self.Manually_Entered_Count is not None:
117            self.Manually_Entered_Count.export(lwrite, level, 'URLHistoryObj:', name_='Manually_Entered_Count', pretty_print=pretty_print)
118        if self.Modification_DateTime is not None:
119            self.Modification_DateTime.export(lwrite, level, 'URLHistoryObj:', name_='Modification_DateTime', pretty_print=pretty_print)
120        if self.Expiration_DateTime is not None:
121            self.Expiration_DateTime.export(lwrite, level, 'URLHistoryObj:', name_='Expiration_DateTime', pretty_print=pretty_print)
122        if self.First_Visit_DateTime is not None:
123            self.First_Visit_DateTime.export(lwrite, level, 'URLHistoryObj:', name_='First_Visit_DateTime', pretty_print=pretty_print)
124        if self.Last_Visit_DateTime is not None:
125            self.Last_Visit_DateTime.export(lwrite, level, 'URLHistoryObj:', name_='Last_Visit_DateTime', pretty_print=pretty_print)
126    def build(self, node):
127        self.__sourcenode__ = node
128        already_processed = set()
129        self.buildAttributes(node, node.attrib, already_processed)
130        for child in node:
131            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
132            self.buildChildren(child, node, nodeName_)
133    def buildAttributes(self, node, attrs, already_processed):
134        pass
135    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
136        if nodeName_ == 'URL':
137            obj_ = uri_object.URIObjectType.factory()
138            obj_.build(child_)
139            self.set_URL(obj_)
140        elif nodeName_ == 'Hostname':
141            obj_ = hostname_object.HostnameObjectType.factory()
142            obj_.build(child_)
143            self.set_Hostname(obj_)
144        elif nodeName_ == 'Referrer_URL':
145            obj_ = uri_object.URIObjectType.factory()
146            obj_.build(child_)
147            self.set_Referrer_URL(obj_)
148        elif nodeName_ == 'Page_Title':
149            obj_ = cybox_common.StringObjectPropertyType.factory()
150            obj_.build(child_)
151            self.set_Page_Title(obj_)
152        elif nodeName_ == 'User_Profile_Name':
153            obj_ = cybox_common.StringObjectPropertyType.factory()
154            obj_.build(child_)
155            self.set_User_Profile_Name(obj_)
156        elif nodeName_ == 'Visit_Count':
157            obj_ = cybox_common.NonNegativeIntegerObjectPropertyType.factory()
158            obj_.build(child_)
159            self.set_Visit_Count(obj_)
160        elif nodeName_ == 'Manually_Entered_Count':
161            obj_ = cybox_common.NonNegativeIntegerObjectPropertyType.factory()
162            obj_.build(child_)
163            self.set_Manually_Entered_Count(obj_)
164        elif nodeName_ == 'Modification_DateTime':
165            obj_ = cybox_common.DateTimeObjectPropertyType.factory()
166            obj_.build(child_)
167            self.set_Modification_DateTime(obj_)
168        elif nodeName_ == 'Expiration_DateTime':
169            obj_ = cybox_common.DateTimeObjectPropertyType.factory()
170            obj_.build(child_)
171            self.set_Expiration_DateTime(obj_)
172        elif nodeName_ == 'First_Visit_DateTime':
173            obj_ = cybox_common.DateTimeObjectPropertyType.factory()
174            obj_.build(child_)
175            self.set_First_Visit_DateTime(obj_)
176        elif nodeName_ == 'Last_Visit_DateTime':
177            obj_ = cybox_common.DateTimeObjectPropertyType.factory()
178            obj_.build(child_)
179            self.set_Last_Visit_DateTime(obj_)
180# end class URLHistoryEntryType
181
182class URLHistoryObjectType(cybox_common.ObjectPropertiesType):
183    """The URLHistoryObject type is intended to characterize the stored URL
184    history for a particular web browser."""
185
186    subclass = None
187    superclass = cybox_common.ObjectPropertiesType
188    def __init__(self, object_reference=None, Custom_Properties=None, xsi_type=None, Browser_Information=None, URL_History_Entry=None):
189        super(URLHistoryObjectType, self).__init__(object_reference, Custom_Properties, xsi_type)
190        self.Browser_Information = Browser_Information
191        if URL_History_Entry is None:
192            self.URL_History_Entry = []
193        else:
194            self.URL_History_Entry = URL_History_Entry
195    def factory(*args_, **kwargs_):
196        if URLHistoryObjectType.subclass:
197            return URLHistoryObjectType.subclass(*args_, **kwargs_)
198        else:
199            return URLHistoryObjectType(*args_, **kwargs_)
200    factory = staticmethod(factory)
201    def get_Browser_Information(self): return self.Browser_Information
202    def set_Browser_Information(self, Browser_Information): self.Browser_Information = Browser_Information
203    def get_URL_History_Entry(self): return self.URL_History_Entry
204    def set_URL_History_Entry(self, URL_History_Entry): self.URL_History_Entry = URL_History_Entry
205    def add_URL_History_Entry(self, value): self.URL_History_Entry.append(value)
206    def insert_URL_History_Entry(self, index, value): self.URL_History_Entry[index] = value
207    def hasContent_(self):
208        if (
209            self.Browser_Information is not None or
210            self.URL_History_Entry or
211            super(URLHistoryObjectType, self).hasContent_()
212            ):
213            return True
214        else:
215            return False
216    def export(self, lwrite, level, namespace_='URLHistoryObj:', name_='URLHistoryObjectType', namespacedef_='', pretty_print=True):
217        if pretty_print:
218            eol_ = '\n'
219        else:
220            eol_ = ''
221        showIndent(lwrite, level, pretty_print)
222        lwrite('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
223        already_processed = set()
224        self.exportAttributes(lwrite, level, already_processed, namespace_, name_='URLHistoryObjectType')
225        if self.hasContent_():
226            lwrite('>%s' % (eol_, ))
227            self.exportChildren(lwrite, level + 1, namespace_, name_, pretty_print=pretty_print)
228            showIndent(lwrite, level, pretty_print)
229            lwrite('</%s%s>%s' % (namespace_, name_, eol_))
230        else:
231            lwrite('/>%s' % (eol_, ))
232    def exportAttributes(self, lwrite, level, already_processed, namespace_='URLHistoryObj:', name_='URLHistoryObjectType'):
233        super(URLHistoryObjectType, self).exportAttributes(lwrite, level, already_processed, namespace_, name_='URLHistoryObjectType')
234    def exportChildren(self, lwrite, level, namespace_='URLHistoryObj:', name_='URLHistoryObjectType', fromsubclass_=False, pretty_print=True):
235        super(URLHistoryObjectType, self).exportChildren(lwrite, level, 'URLHistoryObj:', name_, True, pretty_print=pretty_print)
236        if pretty_print:
237            eol_ = '\n'
238        else:
239            eol_ = ''
240        if self.Browser_Information is not None:
241            self.Browser_Information.export(lwrite, level, 'URLHistoryObj:', name_='Browser_Information', pretty_print=pretty_print)
242        for URL_History_Entry_ in self.URL_History_Entry:
243            URL_History_Entry_.export(lwrite, level, 'URLHistoryObj:', name_='URL_History_Entry', pretty_print=pretty_print)
244    def build(self, node):
245        self.__sourcenode__ = node
246        already_processed = set()
247        self.buildAttributes(node, node.attrib, already_processed)
248        for child in node:
249            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
250            self.buildChildren(child, node, nodeName_)
251    def buildAttributes(self, node, attrs, already_processed):
252        super(URLHistoryObjectType, self).buildAttributes(node, attrs, already_processed)
253    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
254        if nodeName_ == 'Browser_Information':
255            obj_ = cybox_common.ToolInformationType.factory()
256            obj_.build(child_)
257            self.set_Browser_Information(obj_)
258        elif nodeName_ == 'URL_History_Entry':
259            obj_ = URLHistoryEntryType.factory()
260            obj_.build(child_)
261            self.URL_History_Entry.append(obj_)
262        super(URLHistoryObjectType, self).buildChildren(child_, node, nodeName_, True)
263# end class URLHistoryObjectType
264
265GDSClassesMapping = {
266    'Build_Utility': cybox_common.BuildUtilityType,
267    'Byte_Order': cybox_common.EndiannessType,
268    'Errors': cybox_common.ErrorsType,
269    'Time': cybox_common.TimeType,
270    'Certificate_Issuer': cybox_common.StringObjectPropertyType,
271    'Metadata': cybox_common.MetadataType,
272    'Hash': cybox_common.HashType,
273    'Information_Source_Type': cybox_common.ControlledVocabularyStringType,
274    'Last_Visit_DateTime': cybox_common.DateTimeObjectPropertyType,
275    'Internal_Strings': cybox_common.InternalStringsType,
276    'Fuzzy_Hash_Structure': cybox_common.FuzzyHashStructureType,
277    'SubDatum': cybox_common.MetadataType,
278    'Segment_Hash': cybox_common.HashValueType,
279    'Digital_Signature': cybox_common.DigitalSignatureInfoType,
280    'URL': uri_object.URIObjectType,
281    'Code_Snippets': cybox_common.CodeSnippetsType,
282    'URI': uri_object.URIObjectType,
283    'Value': cybox_common.AnyURIObjectPropertyType,
284    'Length': cybox_common.IntegerObjectPropertyType,
285    'Produced_Time': cybox_common.DateTimeWithPrecisionType,
286    'Hostname_Value': cybox_common.StringObjectPropertyType,
287    'Reference': cybox_common.ToolReferenceType,
288    'Encoding': cybox_common.ControlledVocabularyStringType,
289    'Internationalization_Settings': cybox_common.InternationalizationSettingsType,
290    'Image_Offset': cybox_common.IntegerObjectPropertyType,
291    'English_Translation': cybox_common.StringObjectPropertyType,
292    'Start_Date': cybox_common.DateWithPrecisionType,
293    'Functions': cybox_common.FunctionsType,
294    'String_Value': cybox_common.StringObjectPropertyType,
295    'Build_Utility_Platform_Specification': cybox_common.PlatformSpecificationType,
296    'Compiler_Informal_Description': cybox_common.CompilerInformalDescriptionType,
297    'Start_Time': cybox_common.DateTimeWithPrecisionType,
298    'System': cybox_common.ObjectPropertiesType,
299    'Platform': cybox_common.PlatformSpecificationType,
300    'Usage_Context_Assumptions': cybox_common.UsageContextAssumptionsType,
301    'Page_Title': cybox_common.StringObjectPropertyType,
302    'Type': cybox_common.ControlledVocabularyStringType,
303    'Compilers': cybox_common.CompilersType,
304    'Tool_Type': cybox_common.ControlledVocabularyStringType,
305    'String': cybox_common.ExtractedStringType,
306    'Custom_Properties': cybox_common.CustomPropertiesType,
307    'Naming_System': cybox_common.StringObjectPropertyType,
308    'Build_Information': cybox_common.BuildInformationType,
309    'Tool_Hashes': cybox_common.HashListType,
310    'Modification_DateTime': cybox_common.DateTimeObjectPropertyType,
311    'Observable_Location': cybox_common.LocationType,
312    'Expiration_DateTime': cybox_common.DateTimeObjectPropertyType,
313    'Error_Instances': cybox_common.ErrorInstancesType,
314    'End_Date': cybox_common.DateWithPrecisionType,
315    'Data_Segment': cybox_common.StringObjectPropertyType,
316    'Certificate_Subject': cybox_common.StringObjectPropertyType,
317    'Compensation_Model': cybox_common.CompensationModelType,
318    'Property': cybox_common.PropertyType,
319    'Strings': cybox_common.ExtractedStringsType,
320    'Contributors': cybox_common.PersonnelType,
321    'Code_Snippet': cybox_common.ObjectPropertiesType,
322    'Configuration_Settings': cybox_common.ConfigurationSettingsType,
323    'Compiler_Platform_Specification': cybox_common.PlatformSpecificationType,
324    'Byte_String_Value': cybox_common.HexBinaryObjectPropertyType,
325    'Received_Time': cybox_common.DateTimeWithPrecisionType,
326    'Hostname': hostname_object.HostnameObjectType,
327    'Instance': cybox_common.ObjectPropertiesType,
328    'Import': cybox_common.StringObjectPropertyType,
329    'Manually_Entered_Count': cybox_common.NonNegativeIntegerObjectPropertyType,
330    'Identifier': cybox_common.PlatformIdentifierType,
331    'Tool_Specific_Data': cybox_common.ToolSpecificDataType,
332    'Execution_Environment': cybox_common.ExecutionEnvironmentType,
333    'Search_Distance': cybox_common.IntegerObjectPropertyType,
334    'Dependencies': cybox_common.DependenciesType,
335    'Segment_Count': cybox_common.IntegerObjectPropertyType,
336    'Offset': cybox_common.IntegerObjectPropertyType,
337    'Date': cybox_common.DateRangeType,
338    'Hashes': cybox_common.HashListType,
339    'Segments': cybox_common.HashSegmentsType,
340    'Language': cybox_common.StringObjectPropertyType,
341    'Usage_Context_Assumption': cybox_common.StructuredTextType,
342    'Block_Hash': cybox_common.FuzzyHashBlockType,
343    'Dependency': cybox_common.DependencyType,
344    'Error': cybox_common.ErrorType,
345    'Trigger_Point': cybox_common.HexBinaryObjectPropertyType,
346    'Environment_Variable': cybox_common.EnvironmentVariableType,
347    'Byte_Run': cybox_common.ByteRunType,
348    'File_System_Offset': cybox_common.IntegerObjectPropertyType,
349    'Tool_Configuration': cybox_common.ToolConfigurationType,
350    'Imports': cybox_common.ImportsType,
351    'Library': cybox_common.LibraryType,
352    'References': cybox_common.ToolReferencesType,
353    'Compilation_Date': cybox_common.DateTimeWithPrecisionType,
354    'Block_Hash_Value': cybox_common.HashValueType,
355    'Configuration_Setting': cybox_common.ConfigurationSettingType,
356    'Observation_Location': cybox_common.LocationType,
357    'Libraries': cybox_common.LibrariesType,
358    'Visit_Count': cybox_common.NonNegativeIntegerObjectPropertyType,
359    'Function': cybox_common.StringObjectPropertyType,
360    'Description': cybox_common.StructuredTextType,
361    'User_Account_Info': cybox_common.ObjectPropertiesType,
362    'Build_Configuration': cybox_common.BuildConfigurationType,
363    'Address': cybox_common.HexBinaryObjectPropertyType,
364    'User_Profile_Name': cybox_common.StringObjectPropertyType,
365    'Search_Within': cybox_common.IntegerObjectPropertyType,
366    'Segment': cybox_common.HashSegmentType,
367    'Compiler': cybox_common.CompilerType,
368    'Name': cybox_common.StringObjectPropertyType,
369    'Browser_Information': cybox_common.ToolInformationType,
370    'Signature_Description': cybox_common.StringObjectPropertyType,
371    'Block_Size': cybox_common.IntegerObjectPropertyType,
372    'Simple_Hash_Value': cybox_common.SimpleHashValueType,
373    'Fuzzy_Hash_Value': cybox_common.FuzzyHashValueType,
374    'Data_Size': cybox_common.DataSizeType,
375    'Dependency_Description': cybox_common.StructuredTextType,
376    'Referrer_URL': uri_object.URIObjectType,
377    'End_Time': cybox_common.DateTimeWithPrecisionType,
378    'First_Visit_DateTime': cybox_common.DateTimeObjectPropertyType,
379    'Contributor': cybox_common.ContributorType,
380    'Tools': cybox_common.ToolsInformationType,
381    'Tool': cybox_common.ToolInformationType,
382}
383
384USAGE_TEXT = """
385Usage: python <Parser>.py [ -s ] <in_xml_file>
386"""
387
388def usage():
389    print(USAGE_TEXT)
390    sys.exit(1)
391
392def get_root_tag(node):
393    tag = Tag_pattern_.match(node.tag).groups()[-1]
394    rootClass = GDSClassesMapping.get(tag)
395    if rootClass is None:
396        rootClass = globals().get(tag)
397    return tag, rootClass
398
399def parse(inFileName):
400    doc = parsexml_(inFileName)
401    rootNode = doc.getroot()
402    rootTag, rootClass = get_root_tag(rootNode)
403    if rootClass is None:
404        rootTag = 'URL_History'
405        rootClass = URLHistoryObjectType
406    rootObj = rootClass.factory()
407    rootObj.build(rootNode)
408    # Enable Python to collect the space used by the DOM.
409    doc = None
410    sys.stdout.write('<?xml version="1.0" ?>\n')
411    rootObj.export(sys.stdout.write, 0, name_=rootTag,
412        namespacedef_='',
413        pretty_print=True)
414    return rootObj
415
416def parseEtree(inFileName):
417    doc = parsexml_(inFileName)
418    rootNode = doc.getroot()
419    rootTag, rootClass = get_root_tag(rootNode)
420    if rootClass is None:
421        rootTag = 'URL_History'
422        rootClass = URLHistoryObjectType
423    rootObj = rootClass.factory()
424    rootObj.build(rootNode)
425    # Enable Python to collect the space used by the DOM.
426    doc = None
427    rootElement = rootObj.to_etree(None, name_=rootTag)
428    content = etree_.tostring(rootElement, pretty_print=True,
429        xml_declaration=True, encoding="utf-8")
430    sys.stdout.write(content)
431    sys.stdout.write('\n')
432    return rootObj, rootElement
433
434def parseString(inString):
435    from mixbox.vendor.six import StringIO
436    doc = parsexml_(StringIO(inString))
437    rootNode = doc.getroot()
438    rootTag, rootClass = get_root_tag(rootNode)
439    if rootClass is None:
440        rootTag = 'URL_History'
441        rootClass = URLHistoryObjectType
442    rootObj = rootClass.factory()
443    rootObj.build(rootNode)
444    # Enable Python to collect the space used by the DOM.
445    doc = None
446    sys.stdout.write('<?xml version="1.0" ?>\n')
447    rootObj.export(sys.stdout.write, 0, name_="URL_History",
448        namespacedef_='')
449    return rootObj
450
451def main():
452    args = sys.argv[1:]
453    if len(args) == 1:
454        parse(args[0])
455    else:
456        usage()
457
458if __name__ == '__main__':
459    #import pdb; pdb.set_trace()
460    main()
461
462__all__ = [
463    "URLHistoryObjectType",
464    "URLHistoryEntryType"
465    ]
466