summaryrefslogtreecommitdiffstats
path: root/Demo/pdist
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-03-17 06:49:51 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-03-17 06:49:51 (GMT)
commitce96f69d69a6020c780145c89a17a8391b63624b (patch)
tree7325a9bfaddf191e49910532df1fa4210c335196 /Demo/pdist
parent9e2b9665ae9f94a07da54156c48e2cd411a23746 (diff)
downloadcpython-ce96f69d69a6020c780145c89a17a8391b63624b.zip
cpython-ce96f69d69a6020c780145c89a17a8391b63624b.tar.gz
cpython-ce96f69d69a6020c780145c89a17a8391b63624b.tar.bz2
Get rid of a bunch more raw_input references
Diffstat (limited to 'Demo/pdist')
-rwxr-xr-xDemo/pdist/cmptree.py5
-rwxr-xr-xDemo/pdist/mac.py11
-rwxr-xr-xDemo/pdist/rcvs.py7
-rwxr-xr-xDemo/pdist/sumtree.py5
4 files changed, 20 insertions, 8 deletions
diff --git a/Demo/pdist/cmptree.py b/Demo/pdist/cmptree.py
index f6c611f..fa06f5f 100755
--- a/Demo/pdist/cmptree.py
+++ b/Demo/pdist/cmptree.py
@@ -6,6 +6,11 @@ import FSProxy
import time
import os
+def raw_input(prompt):
+ sys.stdout.write(prompt)
+ sys.stdout.flush()
+ return sys.stdin.readline()
+
def main():
pwd = os.getcwd()
s = raw_input("chdir [%s] " % pwd)
diff --git a/Demo/pdist/mac.py b/Demo/pdist/mac.py
index 107113c..61cff09 100755
--- a/Demo/pdist/mac.py
+++ b/Demo/pdist/mac.py
@@ -1,14 +1,18 @@
import sys
-import string
import rcvs
+def raw_input(prompt):
+ sys.stdout.write(prompt)
+ sys.stdout.flush()
+ return sys.stdin.readline()
+
def main():
while 1:
try:
line = raw_input('$ ')
except EOFError:
break
- words = string.split(line)
+ words = line.split()
if not words:
continue
if words[0] != 'rcvs':
@@ -16,4 +20,5 @@ def main():
sys.argv = words
rcvs.main()
-main()
+if __name__ == '__main__':
+ main()
diff --git a/Demo/pdist/rcvs.py b/Demo/pdist/rcvs.py
index 8b8bae6..ab1fd87 100755
--- a/Demo/pdist/rcvs.py
+++ b/Demo/pdist/rcvs.py
@@ -35,7 +35,6 @@
from cvslib import CVS, File
import md5
import os
-import string
import sys
from cmdfw import CommandFrameWork
@@ -269,13 +268,13 @@ class RCVS(CVS):
def mailinfo(self, files, message = ""):
towhom = "sjoerd@cwi.nl, jack@cwi.nl" # XXX
- mailtext = MAILFORM % (towhom, string.join(files),
- string.join(files), message)
+ mailtext = MAILFORM % (towhom, ' '.join(files),
+ ' '.join(files), message)
print '-'*70
print mailtext
print '-'*70
ok = raw_input("OK to mail to %s? " % towhom)
- if string.lower(string.strip(ok)) in ('y', 'ye', 'yes'):
+ if ok.lower().strip() in ('y', 'ye', 'yes'):
p = os.popen(SENDMAIL, "w")
p.write(mailtext)
sts = p.close()
diff --git a/Demo/pdist/sumtree.py b/Demo/pdist/sumtree.py
index 9291a56..68224df 100755
--- a/Demo/pdist/sumtree.py
+++ b/Demo/pdist/sumtree.py
@@ -1,4 +1,5 @@
import time
+import sys
import FSProxy
def main():
@@ -9,7 +10,9 @@ def main():
proxy._close()
t2 = time.time()
print t2-t1, "seconds"
- raw_input("[Return to exit] ")
+ sys.stdout.write("[Return to exit] ")
+ sys.stdout.flush()
+ sys.stdin.readline()
def sumtree(proxy):
print "PWD =", proxy.pwd()