Version number

This commit is contained in:
Bob Mottram 2014-04-26 19:16:32 +01:00
parent edff42cba7
commit eb8b3f4afd

View File

@ -1,5 +1,6 @@
import os import os
import string import string
import operator
def jargonParseEntry(filename): def jargonParseEntry(filename):
if not os.path.isfile(filename): if not os.path.isfile(filename):
@ -31,15 +32,16 @@ def jargonGetEntries(entriesDir):
entry = jargonParseEntry(entriesDir + '/' + filename) entry = jargonParseEntry(entriesDir + '/' + filename)
if entry: if entry:
entries.append(entry) entries.append(entry)
entries.sort(key=operator.itemgetter(0))
return entries return entries
def jargonToManpage(manpageFilename, entries): def jargonToManpage(manpageFilename, entries, version):
if not os.path.isdir("man"): if not os.path.isdir("man"):
os.system("mkdir man") os.system("mkdir man")
fp = open(manpageFilename,'w') fp = open(manpageFilename,'w')
fp.write(".TH \"The Jargon File\" 1 \"April 26, 2014\" \"\" \"The Jargon File\"\n\n") fp.write(".TH \"The Jargon File\" 1 \"April 26, 2014\" \"\" \"" + version + "\"\n\n")
for entry in entries: for entry in entries:
title = entry[0] title = entry[0]
@ -55,5 +57,6 @@ def jargonToManpage(manpageFilename, entries):
print "sudo install -m 644 " + manpageFilename + ".gz /usr/local/share/man/man1" print "sudo install -m 644 " + manpageFilename + ".gz /usr/local/share/man/man1"
if __name__ == "__main__": if __name__ == "__main__":
version = "x.xx"
entries = jargonGetEntries('entries') entries = jargonGetEntries('entries')
jargonToManpage("man/jargon.1", entries) jargonToManpage("man/jargon.1", entries, version)