diff options
author | Ryan Rix <phrkonaleash@gmail.com> | 2009-12-05 20:46:27 -0700 |
---|---|---|
committer | Ryan Rix <phrkonaleash@gmail.com> | 2009-12-05 20:46:27 -0700 |
commit | 0b3e5434513c2e0be465bcfec83c5b98be73349f (patch) | |
tree | 3c461957bf12429185752897260eae58e8f43f9e /backend | |
parent | 855e4731836b4d77c0aa3a888759828f168d030f (diff) | |
download | fedora-tour-0b3e5434513c2e0be465bcfec83c5b98be73349f.tar.gz fedora-tour-0b3e5434513c2e0be465bcfec83c5b98be73349f.tar.xz fedora-tour-0b3e5434513c2e0be465bcfec83c5b98be73349f.zip |
I'm not sure wtf is wrong but the object is kinda broken right now.
I think my algorithm for generating the tree of objects is broken :(
WIll look into it tomorrow, suffering massive caffeine headache.
Diffstat (limited to 'backend')
-rw-r--r-- | backend/tour_menuobject.py | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/backend/tour_menuobject.py b/backend/tour_menuobject.py index c97c9ec..a16b84a 100644 --- a/backend/tour_menuobject.py +++ b/backend/tour_menuobject.py @@ -21,6 +21,7 @@ import io import os.path import xml.parsers.expat import sys +import pprint """ @@ -57,7 +58,7 @@ node.nodeType = Page """ class MenuObject: isValid = True - currenElement = False + currenElement = "powo" rootNode = False activeNode = False @@ -87,6 +88,7 @@ class MenuObject: "fedora-logo-sprite", and "</Icon>" respectively as arguments and these are used to create the object. """ + print "Initializing and starting XML Parser for "+package+"." self.parser = xml.parsers.expat.ParserCreate() self.parser.CharacterDataHandler = self.parserCharData self.parser.StartElementHandler = self.parserStartElement @@ -150,10 +152,18 @@ class MenuObject: TODO: Finish handlers for other entities, you missed a few. """ def parserCharData(self, data): - if self.currenElement == False: - pass - elif self.currentElement == "DisplayName": + if data == "": + return + + #if self.currenElement == False: + # return + + print "currentElement: "+self.currentElement + print "data: "+data + + + if self.currentElement == "DisplayName": self.activeNode.displayName = data elif self.currentElement == "Icon": @@ -187,4 +197,8 @@ class MenuObject: def makeIcon(self, iconID): pass -print MenuObject("../data/package.xml").isValid
\ No newline at end of file +menu = MenuObject("../data/package.xml") +print "===========================" +print menu.IconID +print menu.Priority +print menu.DocRoot
\ No newline at end of file |