-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Dave Dykstra <[email protected]>
- Loading branch information
Showing
3 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# This copies all files given in argv to the same file name with a '.rep' | ||
# extension, replacing all the strings defined in replacements.py. | ||
# This is intended for use in conjunction with rstcheck which runs | ||
# independently of the variable replacement that sphinx does. | ||
# | ||
from replacements import * | ||
import sys | ||
|
||
for f in sys.argv[1:]: | ||
with open(f, 'r', encoding='utf-8') as fdin: | ||
data = fdin.read() | ||
for key in variable_replacements: | ||
data = data.replace(key, variable_replacements[key]) | ||
with open(f + '.rep', 'w', encoding='utf-8') as fdout: | ||
fdout.write(data) |