Mercurial > cpython-lru_cache-weakref
annotate Tools/scripts/treesync.py @ 80661:94de77bd0b4b 2.7
Issue #16194: document imp.load_dynamic problems
when read several extension modules from the same binary object file.
| author | Andrew Svetlov <andrew.svetlov@gmail.com> |
|---|---|
| date | Thu, 29 Nov 2012 19:51:28 +0200 |
| parents | 981fff7363b9 |
| children | 081b4f0e81b7 |
| rev | line source |
|---|---|
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
1 #! /usr/bin/env python |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
2 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
3 """Script to synchronize two source trees. |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
4 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
5 Invoke with two arguments: |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
6 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
7 python treesync.py slave master |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
8 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
9 The assumption is that "master" contains CVS administration while |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
10 slave doesn't. All files in the slave tree that have a CVS/Entries |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
11 entry in the master tree are synchronized. This means: |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
12 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
13 If the files differ: |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
14 if the slave file is newer: |
| 7735 | 15 normalize the slave file |
| 16 if the files still differ: | |
| 17 copy the slave to the master | |
| 18 else (the master is newer): | |
| 19 copy the master to the slave | |
|
15930
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
7735
diff
changeset
|
20 |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
21 normalizing the slave means replacing CRLF with LF when the master |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
22 doesn't use CRLF |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
23 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
24 """ |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
25 |
|
25219
8a7a2f1f88f0
Apply diff2.txt from SF patch http://www.python.org/sf/572113
Walter Dörwald <walter@livinglogic.de>
parents:
15930
diff
changeset
|
26 import os, sys, stat, getopt |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
27 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
28 # Interactivity options |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
29 default_answer = "ask" |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
30 create_files = "yes" |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
31 create_directories = "no" |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
32 write_slave = "ask" |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
33 write_master = "ask" |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
34 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
35 def main(): |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
36 global always_no, always_yes |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
37 global create_directories, write_master, write_slave |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
38 opts, args = getopt.getopt(sys.argv[1:], "nym:s:d:f:a:") |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
39 for o, a in opts: |
| 7735 | 40 if o == '-y': |
| 41 default_answer = "yes" | |
| 42 if o == '-n': | |
| 43 default_answer = "no" | |
| 44 if o == '-s': | |
| 45 write_slave = a | |
| 46 if o == '-m': | |
| 47 write_master = a | |
| 48 if o == '-d': | |
| 49 create_directories = a | |
| 50 if o == '-f': | |
| 51 create_files = a | |
| 52 if o == '-a': | |
| 53 create_files = create_directories = write_slave = write_master = a | |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
54 try: |
| 7735 | 55 [slave, master] = args |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
56 except ValueError: |
| 7735 | 57 print "usage: python", sys.argv[0] or "treesync.py", |
| 58 print "[-n] [-y] [-m y|n|a] [-s y|n|a] [-d y|n|a] [-f n|y|a]", | |
| 59 print "slavedir masterdir" | |
| 60 return | |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
61 process(slave, master) |
|
15930
14a27acc755a
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
7735
diff
changeset
|
62 |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
63 def process(slave, master): |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
64 cvsdir = os.path.join(master, "CVS") |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
65 if not os.path.isdir(cvsdir): |
| 7735 | 66 print "skipping master subdirectory", master |
| 67 print "-- not under CVS" | |
| 68 return | |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
69 print "-"*40 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
70 print "slave ", slave |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
71 print "master", master |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
72 if not os.path.isdir(slave): |
| 7735 | 73 if not okay("create slave directory %s?" % slave, |
| 74 answer=create_directories): | |
| 75 print "skipping master subdirectory", master | |
| 76 print "-- no corresponding slave", slave | |
| 77 return | |
| 78 print "creating slave directory", slave | |
| 79 try: | |
| 80 os.mkdir(slave) | |
| 81 except os.error, msg: | |
| 82 print "can't make slave directory", slave, ":", msg | |
| 83 return | |
| 84 else: | |
| 85 print "made slave directory", slave | |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
86 cvsdir = None |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
87 subdirs = [] |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
88 names = os.listdir(master) |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
89 for name in names: |
| 7735 | 90 mastername = os.path.join(master, name) |
| 91 slavename = os.path.join(slave, name) | |
| 92 if name == "CVS": | |
| 93 cvsdir = mastername | |
| 94 else: | |
| 95 if os.path.isdir(mastername) and not os.path.islink(mastername): | |
| 96 subdirs.append((slavename, mastername)) | |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
97 if cvsdir: |
| 7735 | 98 entries = os.path.join(cvsdir, "Entries") |
| 99 for e in open(entries).readlines(): | |
|
25219
8a7a2f1f88f0
Apply diff2.txt from SF patch http://www.python.org/sf/572113
Walter Dörwald <walter@livinglogic.de>
parents:
15930
diff
changeset
|
100 words = e.split('/') |
| 7735 | 101 if words[0] == '' and words[1:]: |
| 102 name = words[1] | |
| 103 s = os.path.join(slave, name) | |
| 104 m = os.path.join(master, name) | |
| 105 compare(s, m) | |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
106 for (s, m) in subdirs: |
| 7735 | 107 process(s, m) |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
108 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
109 def compare(slave, master): |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
110 try: |
| 7735 | 111 sf = open(slave, 'r') |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
112 except IOError: |
| 7735 | 113 sf = None |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
114 try: |
| 7735 | 115 mf = open(master, 'rb') |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
116 except IOError: |
| 7735 | 117 mf = None |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
118 if not sf: |
| 7735 | 119 if not mf: |
| 120 print "Neither master nor slave exists", master | |
| 121 return | |
| 122 print "Creating missing slave", slave | |
| 123 copy(master, slave, answer=create_files) | |
| 124 return | |
|
6553
2c6f2d92b315
When checking for equality, open the slave file in text mode so it
Guido van Rossum <guido@python.org>
parents:
6101
diff
changeset
|
125 if not mf: |
| 7735 | 126 print "Not updating missing master", master |
| 127 return | |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
128 if sf and mf: |
| 7735 | 129 if identical(sf, mf): |
| 130 return | |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
131 sft = mtime(sf) |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
132 mft = mtime(mf) |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
133 if mft > sft: |
| 7735 | 134 # Master is newer -- copy master to slave |
| 135 sf.close() | |
| 136 mf.close() | |
| 137 print "Master ", master | |
| 138 print "is newer than slave", slave | |
| 139 copy(master, slave, answer=write_slave) | |
| 140 return | |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
141 # Slave is newer -- copy slave to master |
|
6553
2c6f2d92b315
When checking for equality, open the slave file in text mode so it
Guido van Rossum <guido@python.org>
parents:
6101
diff
changeset
|
142 print "Slave is", sft-mft, "seconds newer than master" |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
143 # But first check what to do about CRLF |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
144 mf.seek(0) |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
145 fun = funnychars(mf) |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
146 mf.close() |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
147 sf.close() |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
148 if fun: |
| 7735 | 149 print "***UPDATING MASTER (BINARY COPY)***" |
| 150 copy(slave, master, "rb", answer=write_master) | |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
151 else: |
| 7735 | 152 print "***UPDATING MASTER***" |
| 153 copy(slave, master, "r", answer=write_master) | |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
154 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
155 BUFSIZE = 16*1024 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
156 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
157 def identical(sf, mf): |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
158 while 1: |
| 7735 | 159 sd = sf.read(BUFSIZE) |
| 160 md = mf.read(BUFSIZE) | |
| 161 if sd != md: return 0 | |
| 162 if not sd: break | |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
163 return 1 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
164 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
165 def mtime(f): |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
166 st = os.fstat(f.fileno()) |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
167 return st[stat.ST_MTIME] |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
168 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
169 def funnychars(f): |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
170 while 1: |
| 7735 | 171 buf = f.read(BUFSIZE) |
| 172 if not buf: break | |
| 173 if '\r' in buf or '\0' in buf: return 1 | |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
174 return 0 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
175 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
176 def copy(src, dst, rmode="rb", wmode="wb", answer='ask'): |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
177 print "copying", src |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
178 print " to", dst |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
179 if not okay("okay to copy? ", answer): |
| 7735 | 180 return |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
181 f = open(src, rmode) |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
182 g = open(dst, wmode) |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
183 while 1: |
| 7735 | 184 buf = f.read(BUFSIZE) |
| 185 if not buf: break | |
| 186 g.write(buf) | |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
187 f.close() |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
188 g.close() |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
189 |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
190 def okay(prompt, answer='ask'): |
|
25219
8a7a2f1f88f0
Apply diff2.txt from SF patch http://www.python.org/sf/572113
Walter Dörwald <walter@livinglogic.de>
parents:
15930
diff
changeset
|
191 answer = answer.strip().lower() |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
192 if not answer or answer[0] not in 'ny': |
| 7735 | 193 answer = raw_input(prompt) |
|
25219
8a7a2f1f88f0
Apply diff2.txt from SF patch http://www.python.org/sf/572113
Walter Dörwald <walter@livinglogic.de>
parents:
15930
diff
changeset
|
194 answer = answer.strip().lower() |
| 7735 | 195 if not answer: |
| 196 answer = default_answer | |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
197 if answer[:1] == 'y': |
| 7735 | 198 return 1 |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
199 if answer[:1] == 'n': |
| 7735 | 200 return 0 |
|
6034
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
201 print "Yes or No please -- try again:" |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
202 return okay(prompt) |
|
1cf79ea8ffa2
Source tree synchronization tool (for Windowes, mostly)
Guido van Rossum <guido@python.org>
parents:
diff
changeset
|
203 |
|
33074
981fff7363b9
[Patch #1005491 ] use __name__ == '__main__' in scripts
Andrew M. Kuchling <amk@amk.ca>
parents:
25219
diff
changeset
|
204 if __name__ == '__main__': |
|
981fff7363b9
[Patch #1005491 ] use __name__ == '__main__' in scripts
Andrew M. Kuchling <amk@amk.ca>
parents:
25219
diff
changeset
|
205 main() |
