Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
b24ccfc6
Commit
b24ccfc6
authored
Jun 09, 2017
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py/makeqstrdefs.py: Make script run correctly with Python 2.6.
parent
a8a5d1e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
py/makeqstrdefs.py
py/makeqstrdefs.py
+15
-13
No files found.
py/makeqstrdefs.py
View file @
b24ccfc6
...
...
@@ -5,8 +5,10 @@ qstr. Each qstr is transformed into a qstr definition of the form 'Q(...)'.
This script works with Python 2.6, 2.7, 3.3 and 3.4.
"""
from
__future__
import
print_function
import
re
import
argparse
import
sys
import
os
# Blacklist of qstrings that are specially handled in further
...
...
@@ -84,18 +86,18 @@ def cat_together():
if
__name__
==
"__main__"
:
parser
=
argparse
.
ArgumentParser
(
description
=
'Generates qstr definitions from a specified source'
)
parser
.
add_argument
(
'command'
,
help
=
'Command (split/cat)'
)
parser
.
add_argument
(
'input_filename'
,
help
=
'Name of the input file (when not specified, the script reads standard input)'
)
parser
.
add_argument
(
'output_dir'
,
help
=
'Output directory to store individual qstr files'
)
parser
.
add_argument
(
'output_file'
,
help
=
'Name of the output file with collected qstrs'
)
args
=
parser
.
parse_args
()
if
len
(
sys
.
argv
)
!=
5
:
print
(
'usage: %s command input_filename output_dir output_file'
%
sys
.
argv
[
0
])
sys
.
exit
(
2
)
class
Args
:
pass
args
=
Args
()
args
.
command
=
sys
.
argv
[
1
]
args
.
input_filename
=
sys
.
argv
[
2
]
args
.
output_dir
=
sys
.
argv
[
3
]
args
.
output_file
=
sys
.
argv
[
4
]
try
:
os
.
makedirs
(
args
.
output_dir
)
except
OSError
:
...
...
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