summaryrefslogtreecommitdiffstats
path: root/Tools/faqwiz
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-03-31 00:58:00 (GMT)
committerGuido van Rossum <guido@python.org>2000-03-31 00:58:00 (GMT)
commit2b6004a07f8c5eb6006e8c9fc466b0499b00c105 (patch)
tree57c84db2eba305c4f2f670f9957916fe4c4834c6 /Tools/faqwiz
parent8daef3791ea95c2e257c49d56169a49d8f4b0b3a (diff)
downloadcpython-2b6004a07f8c5eb6006e8c9fc466b0499b00c105.zip
cpython-2b6004a07f8c5eb6006e8c9fc466b0499b00c105.tar.gz
cpython-2b6004a07f8c5eb6006e8c9fc466b0499b00c105.tar.bz2
New version 1.0.4. I'm sure someone mailed me these patches but I
can't remember who. :-) Changes: - Support for Windows NT (different locking behavior) - Added a logging mechanism
Diffstat (limited to 'Tools/faqwiz')
-rw-r--r--Tools/faqwiz/faqwiz.py26
1 files changed, 20 insertions, 6 deletions
diff --git a/Tools/faqwiz/faqwiz.py b/Tools/faqwiz/faqwiz.py
index 6e45c6e..638da17 100644
--- a/Tools/faqwiz/faqwiz.py
+++ b/Tools/faqwiz/faqwiz.py
@@ -112,6 +112,13 @@ def revparse(rev):
[major, minor] = map(string.atoi, m.group(1, 2))
return major, minor
+logon = 0
+def log(text):
+ if logon:
+ logfile = open("logfile", "a")
+ logfile.write(text + "\n")
+ logfile.close()
+
def load_cookies():
if not os.environ.has_key('HTTP_COOKIE'):
return {}
@@ -177,6 +184,7 @@ class UserInput:
def __init__(self):
self.__form = cgi.FieldStorage()
+ #log("\n\nbody: " + self.body)
def __getattr__(self, name):
if name[0] == '_':
@@ -776,7 +784,12 @@ class FaqWizard:
if self.ui.body == entry.body and self.ui.title == entry.title:
self.error("You didn't make any changes!")
return
- # XXX Should lock here
+
+ # need to lock here because otherwise the file exists and is not writable (on NT)
+ command = interpolate(SH_LOCK, file=file)
+ p = os.popen(command)
+ output = p.read()
+
try:
os.unlink(file)
except os.error:
@@ -799,14 +812,15 @@ class FaqWizard:
emit(LOGHEADER, self.ui, os.environ, date=date, _file=f)
f.close()
- command = interpolate(
- SH_LOCK + '\n' + SH_CHECKIN,
- file=file, tfn=tfn)
-
+ command = interpolate(SH_CHECKIN, file=file, tfn=tfn)
+ log("\n\n" + command)
p = os.popen(command)
output = p.read()
sts = p.close()
- # XXX Should unlock here
+ log("output: " + output)
+ log("done: " + str(sts))
+ log("TempFile:\n" + open(tfn).read() + "end")
+
if not sts:
self.prologue(T_COMMITTED)
emit(COMMITTED)