This repository was archived by the owner on Oct 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change 5
5
This script works with Python 2.6, 2.7, 3.3 and 3.4.
6
6
"""
7
7
8
+ from __future__ import print_function
9
+
8
10
import re
9
- import argparse
11
+ import sys
10
12
import os
11
13
12
14
# Blacklist of qstrings that are specially handled in further
@@ -84,18 +86,18 @@ def cat_together():
84
86
85
87
86
88
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
+
99
101
try :
100
102
os .makedirs (args .output_dir )
101
103
except OSError :
You can’t perform that action at this time.
0 commit comments