Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.

Commit d8f3db1

Browse files
authored
Small cleanups to the REP scripts. (#396)
1. Removes instances of /usr/bin/env python, which don't work on non-Linux and also were wrong in some cases. 2. Makes sure to use raw strings for regexes, which gets rid of some warnings with modern Python. 3. Uses '-f' when removing files to quite warnings. Signed-off-by: Chris Lalancette <[email protected]>
1 parent eb6329e commit d8f3db1

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ xsdvalid:
2626
$(PYTHON) xsdValid.py
2727

2828
clean:
29-
-rm *.html
30-
-rm rep-0000.rst
29+
-rm -f *.html
30+
-rm -f rep-0000.rst
3131

3232
upload: all
3333
rsync -r README.txt *.html mermaid.js css rep-0000.rst $(SUBDIRS) [email protected]:/var/www/www.ros.org/reps

genrepindex.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env python2.5
21
"""Auto-generate REP 0 (REP index).
32
43
Generating the REP index is a multi-step process. To begin, you must first

rep2html.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@
7070
' "http://www.w3.org/TR/REC-html40/loose.dtd">')
7171

7272
fixpat = re.compile(
73-
"((https?|ftp):[-_a-zA-Z0-9/.+~:?#$=&,]+)|(rep-\d+(.rst)?)|"
74-
"(RFC[- ]?(?P<rfcnum>\d+))|"
75-
"(REP\s+(?P<repnum>\d+))|"
73+
r"((https?|ftp):[-_a-zA-Z0-9/.+~:?#$=&,]+)|(rep-\d+(.rst)?)|"
74+
r"(RFC[- ]?(?P<rfcnum>\d+))|"
75+
r"(REP\s+(?P<repnum>\d+))|"
7676
".")
7777

7878
EMPTYSTRING = ''
@@ -220,7 +220,7 @@ def fixfile(inpath, input_lines, outfile):
220220
for k, v in header:
221221
if k.lower() in ('author', 'discussions-to'):
222222
mailtos = []
223-
for part in re.split(',\s*', v):
223+
for part in re.split(r',\s*', v):
224224
if '@' in part:
225225
realname, addr = parseaddr(part)
226226
if k.lower() == 'discussions-to':
@@ -236,7 +236,7 @@ def fixfile(inpath, input_lines, outfile):
236236
v = COMMASPACE.join(mailtos)
237237
elif k.lower() in ('replaces', 'replaced-by', 'requires'):
238238
otherreps = ''
239-
for otherrep in re.split(',?\s+', v):
239+
for otherrep in re.split(r',?\s+', v):
240240
otherrep = int(otherrep)
241241
otherreps += '<a href="rep-%04d.html">%i</a> ' % (otherrep,
242242
otherrep)

xsdValid.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/python
2-
31
import xmlschema
42

53
format1 = xmlschema.XMLSchema('xsd/package_format1.xsd')

0 commit comments

Comments
 (0)