Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
17b9e27a
Commit
17b9e27a
authored
Mar 31, 2009
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run 2to3 over new script.
parent
369bc0f9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Tools/scripts/reindent-rst.py
Tools/scripts/reindent-rst.py
+4
-4
No files found.
Tools/scripts/reindent-rst.py
View file @
17b9e27a
...
...
@@ -3,7 +3,7 @@
# Make a reST file compliant to our pre-commit hook.
# Currently just remove trailing whitespace.
from
__future__
import
with_statement
import
sys
,
re
,
shutil
ws_re
=
re
.
compile
(
r'\
s+(
\r?\n)$'
)
...
...
@@ -16,12 +16,12 @@ def main(argv=sys.argv):
lines
=
f
.
readlines
()
new_lines
=
[
ws_re
.
sub
(
r'\1'
,
line
)
for
line
in
lines
]
if
new_lines
!=
lines
:
print
'Fixing %s...'
%
filename
print
(
'Fixing %s...'
%
filename
)
shutil
.
copyfile
(
filename
,
filename
+
'.bak'
)
with
open
(
filename
,
'wb'
)
as
f
:
f
.
writelines
(
new_lines
)
except
Exception
,
err
:
print
'Cannot fix %s: %s'
%
(
filename
,
err
)
except
Exception
as
err
:
print
(
'Cannot fix %s: %s'
%
(
filename
,
err
)
)
rv
=
1
return
rv
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment