Tuesday, December 25, 2007

Text to HTML Table Converter 1.2.1: Fixed flag bug in txt2html v1.2

The argsContain(flag) function in the script only checks if the first argument contains 'flag'. Replace argsContain with:

def argsContain(flag):
""" Flag is the letter/word/etc that follows the '-' or '--' in the options """
# search for flag in options part of args i.e. before filename
found = False
for arg in sys.argv[1:len(sys.argv)-1]:
if arg.find(flag) != -1:
found = True
return found

This checks all the flags for the one you want.

1 comment:

Lauraine said...

Interesting one. Keep posting such kind of information on your blog. I bookmarked it for continuous visit. Thanks once again.