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

Commit b24ccfc

Browse files
committed
py/makeqstrdefs.py: Make script run correctly with Python 2.6.
1 parent a8a5d1e commit b24ccfc

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

py/makeqstrdefs.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
This script works with Python 2.6, 2.7, 3.3 and 3.4.
66
"""
77

8+
from __future__ import print_function
9+
810
import re
9-
import argparse
11+
import sys
1012
import os
1113

1214
# Blacklist of qstrings that are specially handled in further
@@ -84,18 +86,18 @@ def cat_together():
8486

8587

8688
if __name__ == "__main__":
87-
parser = argparse.ArgumentParser(description='Generates qstr definitions from a specified source')
88-
89-
parser.add_argument('command',
90-
help='Command (split/cat)')
91-
parser.add_argument('input_filename',
92-
help='Name of the input file (when not specified, the script reads standard input)')
93-
parser.add_argument('output_dir',
94-
help='Output directory to store individual qstr files')
95-
parser.add_argument('output_file',
96-
help='Name of the output file with collected qstrs')
97-
98-
args = parser.parse_args()
89+
if len(sys.argv) != 5:
90+
print('usage: %s command input_filename output_dir output_file' % sys.argv[0])
91+
sys.exit(2)
92+
93+
class Args:
94+
pass
95+
args = Args()
96+
args.command = sys.argv[1]
97+
args.input_filename = sys.argv[2]
98+
args.output_dir = sys.argv[3]
99+
args.output_file = sys.argv[4]
100+
99101
try:
100102
os.makedirs(args.output_dir)
101103
except OSError:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy