Improved some error messages for command line processing.
[python/dscho.git] / Demo / sgi / flp / tcache.py
blobcf713fc325f7c29f4ef26d65f25405ed941dcee8
1 # Test bug in caching of forms
3 import sys
4 import os
5 import flp
7 filename = 'tcache.fd'
8 cachename = filename + 's'
10 def first():
11 try:
12 os.unlink(cachename)
13 except os.error:
14 pass
15 first = flp.parse_form(filename, 'first')
17 def second():
18 forms = flp.parse_forms(filename)
19 k = forms.keys()
20 if 'first' in k and 'second' in k:
21 print 'OK'
22 else:
23 print 'BAD!', k
25 def main():
26 if sys.argv[1:]:
27 second()
28 else:
29 first()
30 print 'Now run the script again with an argument'
32 main()