repo.or.cz
/
python
/
dscho.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Improved some error messages for command line processing.
[python/dscho.git]
/
Demo
/
sgi
/
flp
/
tcache.py
blob
cf713fc325f7c29f4ef26d65f25405ed941dcee8
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
()