Changeset ad678a4
- Timestamp:
- 2015-05-17T03:41:31Z (9 years ago)
- Branches:
- master
- Children:
- baa09cc
- Parents:
- d6acf79
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/user-guide/genhelp.py
rd6acf79 rad678a4 1 1 #!/usr/bin/env python 2 # 2 3 # Usage: python genhelp.py input.xml output.txt 4 # (Both python2 (>=2.5) or python3 work) 5 3 6 # This program is free software; you can redistribute it and/or 4 7 # modify it under the terms of the GNU General Public License … … 18 21 19 22 import re 23 import sys 20 24 import xml.etree.ElementTree as ET 21 25 22 IN_FILE = 'help.xml'23 OUT_FILE = 'help.txt'24 26 NORMALIZE_RE = re.compile(r"([^<>\s\t])[\s\t]+([^<>\s\t])") 25 27 … … 216 218 217 219 def main(): 218 txt = process_file(IN_FILE) 219 open(OUT_FILE, "w").write(txt) 220 if len(sys.argv) != 3: 221 print("Usage: python genhelp.py input.xml output.txt") 222 return 223 224 txt = process_file(sys.argv[1]) 225 open(sys.argv[2], "w").write(txt) 220 226 221 227 if __name__ == '__main__':
Note: See TracChangeset
for help on using the changeset viewer.