From fab7d56593afe9114b927759f56ab6d3ca2f7301 Mon Sep 17 00:00:00 2001 From: Ryan Rix Date: Fri, 4 Dec 2009 23:52:38 -0700 Subject: Updated the first mockup to use a blue foliage instead of green. Looks a little cooler :) --- backend/tour_menuobject.py | 6 +++ backend/tour_menuobject.py~ | 63 +++++++++++++++++++----- docs/BACKEND | 25 ++-------- docs/BACKEND~ | 115 ++++++++++++++++++++++++++++++++++++++++++++ docs/fedora-tour-1.png | Bin 149010 -> 153567 bytes docs/fedora-tour-1.png~ | Bin 0 -> 149010 bytes docs/fedora-tour-1.svg | 2 +- docs/fedora-tour-1.svg~ | 60 +++++++++++++++++++++++ docs/tour-mockup-1.odg | Bin 38537 -> 38623 bytes docs/tour-mockup-1.odg~ | Bin 0 -> 38537 bytes 10 files changed, 238 insertions(+), 33 deletions(-) create mode 100644 docs/BACKEND~ create mode 100644 docs/fedora-tour-1.png~ create mode 100644 docs/fedora-tour-1.svg~ create mode 100644 docs/tour-mockup-1.odg~ diff --git a/backend/tour_menuobject.py b/backend/tour_menuobject.py index 8ca7949..2a6a67e 100644 --- a/backend/tour_menuobject.py +++ b/backend/tour_menuobject.py @@ -32,6 +32,7 @@ class MenuObject: activeNode = False Icon = False + IconID = False DocRoot = False Locale = False Priority = False @@ -47,6 +48,8 @@ class MenuObject: self.parser.EndElementHandler = self.parserEndElement self.parser.ParseFile(open(package,"r")) + + self.Icon = makeIcon(IconID) def addNode(self,parent,nodeType): node = MenuNode() @@ -112,5 +115,8 @@ class MenuObject: if name == "Page": self.activeNode = self.activeNode.parent + + def makeIcon(self, iconID): + print MenuObject("../data/package.xml").isValid \ No newline at end of file diff --git a/backend/tour_menuobject.py~ b/backend/tour_menuobject.py~ index f72ffab..9bf1d84 100644 --- a/backend/tour_menuobject.py~ +++ b/backend/tour_menuobject.py~ @@ -20,15 +20,21 @@ import io import os.path import xml.parsers.expat +import sys class MenuNode: parent = 0 class MenuObject: - isValid = True; - currenElement = False; - rootNode = False; - activeNode = False; + isValid = True + currenElement = False + rootNode = False + activeNode = False + + Icon = False + DocRoot = False + Locale = False + Priority = False def __init__(self,package): if not os.path.isfile(package): @@ -42,30 +48,63 @@ class MenuObject: self.parser.ParseFile(open(package,"r")) - def addNode(self,parent): + def addNode(self,parent,nodeType): node = MenuNode() - if parent = False: + node.nodes = list() + node.parent = False + node.nodeType = nodeType + + if parent != False: node.parent = parent parent.nodes.append(node) - return node def parserCharData(self, data): if self.currenElement == False: pass + + elif self.currentElement == "DisplayName": + self.activeNode.displayName = data + + elif self.currentElement == "Icon": + self.activeNode.icon = findIcon(data) + + elif self.currentElement == "DocRoot": + self.activeNode. def parserStartElement(self, name, attrs): + print "Encountered "+name+" node Start" + + self.currentElement = name + if name == "Package": - self.rootNode = self.addNode(False) - self.currentElement = "Package" + self.rootNode = self.addNode(False,"Package") + self.activeNode = self.rootNode elif name == "Page": - self.activeNode = self.addNode(activeNode) - self.currentElement = "Page" + self.activeNode = self.addNode(self.activeNode, "Page") + + elif name == "DisplayName": + self.currentElement = "DisplayName" + + elif name == "Icon" or name == "DocRoot" or name == "Locale" or name == "Priority": + """ + These tags are only allowed under root, so we should err if this happens. + """ + if self.activeNode.parent != False: + print self.rootNode + print self.activeNode + print "<"+name+"> node is only allowed underneath the Node. Please file a bug on the Fedora-tour Fedora component at http://bugzilla.redhat.com" + sys.exit() def parserEndElement(self, name): - print name + print "Encountered "+name+" node End" + + self.currentElement == False + + if name == "Page": + self.activeNode = self.activeNode.parent print MenuObject("../data/package.xml").isValid \ No newline at end of file diff --git a/docs/BACKEND b/docs/BACKEND index 58f9106..13d47a0 100644 --- a/docs/BACKEND +++ b/docs/BACKEND @@ -43,12 +43,12 @@ A rough outline of the typical Content Descriptor, with explanation follows. access to the latest free and open source software, in a stable, secure and easy to manage form what-is-fedora - enUS + enUS 1 Overview This section provides a brief overview of the Fedora Project -Community and Fedora Linux. + Community and Fedora Linux. overview.html HTML @@ -57,24 +57,9 @@ Community and Fedora Linux. mission-and-goals.html HTML - Foundation 1: Freedom - mission-and-goals/freedom.html - HTML - - - Foundation 2: Friends - mission-and-goals/friends.html - HTML - - - Foundation 3: Features - mission-and-goals/features.html - HTML - - - Foundation 4: First - mission-and-goals/first.html - HTML + Foundation 1: Freedom + mission-and-goals/freedom.html + HTML diff --git a/docs/BACKEND~ b/docs/BACKEND~ new file mode 100644 index 0000000..58f9106 --- /dev/null +++ b/docs/BACKEND~ @@ -0,0 +1,115 @@ +$author: Ryan Rix +$cdate: 3Dec2009 +$mdate: + +Fedora-Tour + +This document describes the backend of fedora-tour in detail. Care should be +taken to keep this document in sync with any development done on the project +to aide future contributors and maintainers. + +1. File System Layout + +/usr/bin/fedora-tour : This is the main executable for + : Fedora-tour. + +/usr/share/fedora-tour : + +/usr/share/fedora-tour/packages : tourContentDescriptorsDir. The location + : of Content Descriptors defining content + : for Fedora-tour + +/usr/share/fedora-tour/content-enUS/ : tourContentDirectoryLocalized. This is + : the location of the actual content, used +/usr/share/fedora-tour/content-enGB/ : in generating a full DocRoot for a +...etc... : particular Package in cooperation with + : the Locale entry of the Package. + +2. Content Descriptors + +Content Descriptors are the files in tourContentDescriptorsDir which describe +the content of a particular Fedora Tour package. These are XML descriptions of +each page and are used to generate the menues. When the application loads the +menu, it will search tourContentDescriptorsDir for a list of .xml files, parse +each one + +A rough outline of the typical Content Descriptor, with explanation follows. + + + + What is the Fedora Project? + fedora-logo-sprite + Fedora is a Linux based operating system that provides users with +access to the latest free and open source software, in a stable, secure and +easy to manage form + what-is-fedora + enUS + 1 + + Overview + This section provides a brief overview of the Fedora Project +Community and Fedora Linux. + overview.html + HTML + + + Our Mission and Goals + mission-and-goals.html + HTML + + Foundation 1: Freedom + mission-and-goals/freedom.html + HTML + + + Foundation 2: Friends + mission-and-goals/friends.html + HTML + + + Foundation 3: Features + mission-and-goals/features.html + HTML + + + Foundation 4: First + mission-and-goals/first.html + HTML + + + + +DisplayName: This is the name that will appear on either the TreeView or +MenuView. It should be short, as the length of the visible column will be +variable. + +Icon: The name of the icon to be displayed in TreeView and MenuView. Fedora-Tour +will poll standard application icon directories (/usr/share/pixmaps, +/usr/share/icons and /usr/share/icons/hicolor) for this icon. Only file's +basename is required, but if extension is provided, it will be used as first +priority, in the case of multiple icons. +* This entry is only valid as a direct child of Package. + +Comment: This will be displayed as a tooltip when a user mouses over the leaf in +TreeView or the entry in MenuView. + +DocRoot: The folder underneath tourContentDirectoryLocalized in which the +content resides. +* This entry is only valid as a direct child of Package. + +Priority: This entry defines how Fedora-tour will sort the top menu levels, when +generating a list from many XML files. In the case of multiple packages sharing +the same priority, alphabetical order will be used. +* This entry is only valid as a direct child of Package. The order of child +pages is ascertained from the order of entities in the XML file. + +Locale: The Locale of the package for i18n support. Used to generate the proper +DocRoot + +Page: This entry opens a new page. + +File: Where in DocRoot this Page entry resides + +Type: The content type. What will be supported will be defined at some later +time than now. Currently, only HTML. TODO + diff --git a/docs/fedora-tour-1.png b/docs/fedora-tour-1.png index ecd69aa..5338c57 100644 Binary files a/docs/fedora-tour-1.png and b/docs/fedora-tour-1.png differ diff --git a/docs/fedora-tour-1.png~ b/docs/fedora-tour-1.png~ new file mode 100644 index 0000000..ecd69aa Binary files /dev/null and b/docs/fedora-tour-1.png~ differ diff --git a/docs/fedora-tour-1.svg b/docs/fedora-tour-1.svg index 88191d9..e18344c 100644 --- a/docs/fedora-tour-1.svg +++ b/docs/fedora-tour-1.svg @@ -6,7 +6,7 @@ - + diff --git a/docs/fedora-tour-1.svg~ b/docs/fedora-tour-1.svg~ new file mode 100644 index 0000000..88191d9 --- /dev/null +++ b/docs/fedora-tour-1.svg~ @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/tour-mockup-1.odg b/docs/tour-mockup-1.odg index ff6929e..6a53d27 100644 Binary files a/docs/tour-mockup-1.odg and b/docs/tour-mockup-1.odg differ diff --git a/docs/tour-mockup-1.odg~ b/docs/tour-mockup-1.odg~ new file mode 100644 index 0000000..ff6929e Binary files /dev/null and b/docs/tour-mockup-1.odg~ differ -- cgit