Changeset 254

Show
Ignore:
Timestamp:
07/31/02 00:00:29 (6 years ago)
Author:
lking
Message:

Added the revision page parser.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/RBPrivate/Prototypes/Larry/parsechanges.py

    r233 r254  
    1313    SubHead = '<font face="arial" size="1" color="FFCC33">%s</font><br>' 
    1414    SubItem = '<font face="arial" size="1" color="D5F6A8">- %s</font><br>' 
     15    ReadMore = '<a href="revision.html"><font face="arial" size="1" color="FFFFFF"><b>READ MORE</b></font></a><br>' 
    1516    LineCount = 20 
    1617    OutputList = [] 
     
    4344        print OutputList[index] 
    4445 
     46    # Print the Read More link 
     47    print ReadMore 
     48 
     49# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     50 
     51def Revision(): 
     52    Headline = '<font face="arial" size="3" color="D5F6A8"><b>%s</b></font><br>' 
     53    Description = '<font face="arial" size="2" color="CCCCCC"><i>%s</i></font><br>' 
     54    SubHead = '<font face="arial" size="2" color="FFCC33"><b>%s</b></font><br>' 
     55    SubItem = '<font face="arial" size="2" color="FFFFFF">- %s</font><br>' 
     56    Divider = '<hr noshade size="0" width="100%" color="FFFFFF">' 
     57    OutputList = [] 
     58     
     59    # Open the file and create an Objectified Object 
     60    AllChanges = XMLObjectify.ObjectifyFile(open('CHANGES', 'r')) 
     61     
     62    # Create a list of all releases and traverse the list 
     63    for Release in AllChanges.release: 
     64        # Append the date, version, and description of the release 
     65        OutputList.append(Headline % (Release.date + " - version " + Release.version)) 
     66        OutputList.append(Description % (Release().strip())) 
     67        OutputList.append(Divider) 
     68 
     69        #Create a list of features within the release and traverse the list 
     70        for Feature in Release.features: 
     71            # Append the feature's title 
     72            OutputList.append(SubHead % (Feature.title)) 
     73            # Create a list of items within each feature and traverse the list 
     74            for data in filter(None, map(str.strip, Feature(None))): 
     75                # Append the feature's item 
     76                OutputList.append(SubItem % data) 
     77 
     78            OutputList.append("<br>") 
     79 
     80        OutputList.append("<br>") 
     81 
     82    # Print the parsed data 
     83    for index in range(len(OutputList)): 
     84        print OutputList[index] 
     85 
     86 
     87 
    4588 
    4689# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     
    5497        SideBar() 
    5598    elif sys.argv[1] == "revision": 
    56         print "Revision" 
     99        Revision() 
    57100    else: 
    58101        print "USAGE:  parsechanges.py sidebar OR parsechanges.py revision"