home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pyos2bin.zip / Demo / sgi / flp / tcache.py < prev    next >
Text File  |  1994-10-07  |  487b  |  33 lines

  1. # Test bug in caching of forms
  2.  
  3. import sys
  4. import os
  5. import flp
  6.  
  7. filename = 'tcache.fd'
  8. cachename = filename + 's'
  9.  
  10. def first():
  11.     try:
  12.         os.unlink(cachename)
  13.     except os.error:
  14.         pass
  15.     first = flp.parse_form(filename, 'first')
  16.  
  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
  24.  
  25. def main():
  26.     if sys.argv[1:]:
  27.         second()
  28.     else:
  29.         first()
  30.         print 'Now run the script again with an argument'
  31.  
  32. main()
  33.