Add support for examples list to parse and use tags. Patch from marcjansen

at the code sprint at FOSS4G2010. Woohoo. r=me, (Closes #2829)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@10728 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2010-09-13 11:27:12 +00:00
parent 581525af98
commit 4be7614570
2 changed files with 15 additions and 2 deletions

View File

@@ -135,6 +135,10 @@ def createFeed(examples):
title = doc.createElementNS(atomuri, "title")
title.appendChild(doc.createTextNode(example["title"] or example["example"]))
entry.appendChild(title)
tags = doc.createElementNS(atomuri, "tags")
tags.appendChild(doc.createTextNode(example["tags"] or example["example"]))
entry.appendChild(tags)
link = doc.createElementNS(atomuri, "link")
link.setAttribute("href", "%s%s" % (feedPath, example["example"]))
@@ -171,7 +175,7 @@ def wordIndex(examples):
"""
index = {}
unword = re.compile("\\W+")
keys = ["shortdesc", "title"]
keys = ["shortdesc", "title", "tags"]
for i in range(len(examples)):
for key in keys:
text = examples[i][key]
@@ -204,7 +208,7 @@ if __name__ == "__main__":
print 'Reading examples from %s and writing out to %s' % (examplesLocation, outFile.name)
exampleList = []
docIds = ['title','shortdesc']
docIds = ['title','shortdesc','tags']
#comment out option to create docs from online resource
#examplesLocation = 'http://svn.openlayers.org/sandbox/docs/examples/'