[Python-checkins] CVS: python/nondist/peps pep2html.py,1.13,1.14
Fred L. Drake
python-dev@python.org
Wed, 6 Sep 2000 18:26:50 -0700
Update of /cvsroot/python/python/nondist/peps
In directory slayer.i.sourceforge.net:/tmp/cvs-serv19071
Modified Files:
pep2html.py
Log Message:
Added a -q/--quiet option to suppress the per-file progress message.
Fixed the branch for files specified from the command line to only update
the Web server if the -u/--update option was used.
Index: pep2html.py
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep2html.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** pep2html.py 2000/08/28 16:00:49 1.13
--- pep2html.py 2000/09/07 01:26:46 1.14
***************
*** 160,166 ****
return "pep-%04d.txt" % num
! def make_html(file):
newfile = os.path.splitext(file)[0] + ".html"
! print file, "->", newfile
fixfile(file, newfile)
return newfile
--- 160,167 ----
return "pep-%04d.txt" % num
! def make_html(file, verbose=0):
newfile = os.path.splitext(file)[0] + ".html"
! if verbose:
! print file, "->", newfile
fixfile(file, newfile)
return newfile
***************
*** 171,177 ****
update = 0
username = ''
try:
! opts, args = getopt.getopt(sys.argv[1:], 'ih', ['install', 'help'])
except getopt.error, msg:
usage(1, msg)
--- 172,180 ----
update = 0
username = ''
+ verbose = 1
try:
! opts, args = getopt.getopt(sys.argv[1:], 'ihq',
! ['install', 'help', 'quiet'])
except getopt.error, msg:
usage(1, msg)
***************
*** 184,187 ****
--- 187,192 ----
elif opt in ('-u', '--user'):
username = arg + "@"
+ elif opt in ('-q', '--quiet'):
+ verbose = 0
if args:
***************
*** 189,200 ****
for pep in args:
file = find_pep(pep)
! newfile = make_html(file)
html.append(newfile)
! os.system("scp %s style.css " % " ".join(html) \
! + username + HOST + ":" + HDIR)
else:
# do them all
for file in glob.glob("pep-*.txt"):
! make_html(file)
if update:
os.system("scp pep-*.html style.css " + \
--- 194,206 ----
for pep in args:
file = find_pep(pep)
! newfile = make_html(file, verbose=verbose)
html.append(newfile)
! if update:
! os.system("scp %s style.css " % " ".join(html) \
! + username + HOST + ":" + HDIR)
else:
# do them all
for file in glob.glob("pep-*.txt"):
! make_html(file, verbose=verbose)
if update:
os.system("scp pep-*.html style.css " + \