Skip to content

Commit 96dd8a2

Browse files
committed
Only use one getkw.py (#161)
* Only use one getkw.py * Update PR template * Appease MinazoBot
1 parent 0664b57 commit 96dd8a2

File tree

5 files changed

+17
-904
lines changed

5 files changed

+17
-904
lines changed

.gitattributes

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,10 @@ tests/numerical_quadrature/*.cpp licensefile=.githooks/LICENSE-C++
7171
tests/utils/*.cpp licensefile=.githooks/LICENSE-C++
7272

7373
# tools
74-
doc/conf.py licensefile=.githooks/LICENSE-Python
75-
doc/gfx/cloc_tools.py.in licensefile=.githooks/LICENSE-Python
76-
src/make_cmake_files.py licensefile=.githooks/LICENSE-Python
77-
tools/codata.py licensefile=.githooks/LICENSE-Python
78-
tools/plot_cavity.py licensefile=.githooks/LICENSE-Python
79-
tools/init.py licensefile=.githooks/LICENSE-Python
80-
tests/make_cmake_files.py licensefile=.githooks/LICENSE-Python
81-
tests/go_pcm.py licensefile=.githooks/LICENSE-Python
82-
tests/pcmparser.py licensefile=.githooks/LICENSE-Python
74+
doc/conf.py licensefile=.githooks/LICENSE-Python
75+
doc/cloc_tools/cloc_wrapper.py licensefile=.githooks/LICENSE-Python
76+
tools/plot_cavity.py licensefile=.githooks/LICENSE-Python
77+
tools/init.py licensefile=.githooks/LICENSE-Python
78+
tools/go_pcm.py.in licensefile=.githooks/LICENSE-Python
79+
tools/pcmparser.py licensefile=.githooks/LICENSE-Python
80+
tools/pcmdata.py licensefile=.githooks/LICENSE-Python

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,5 @@
3737

3838
## Status
3939
<!--- Check this box when ready to be merged -->
40-
- [ ] Ready to go
41-
42-
40+
- [ ] Ready to go
41+
- [ ] Cherry-pick to latest release branch

tools/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@ install(
1313
${CMAKE_INSTALL_BINDIR}
1414
)
1515

16-
if(PYTHON_VERSION_MAJOR VERSION_EQUAL 3)
17-
configure_file(py3.x-getkw.py ${PROJECT_BINARY_DIR}/${PYMOD_INSTALL_FULLDIR}/getkw.py COPYONLY)
18-
else()
19-
configure_file(py2.x-getkw.py ${PROJECT_BINARY_DIR}/${PYMOD_INSTALL_FULLDIR}/getkw.py COPYONLY)
20-
endif()
2116
configure_file(init.py ${PROJECT_BINARY_DIR}/${PYMOD_INSTALL_FULLDIR}/__init__.py COPYONLY)
2217
file(
2318
COPY
19+
getkw.py
2420
pcmdata.py
2521
pcmparser.py
2622
pyparsing.py

tools/py3.x-getkw.py renamed to tools/getkw.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ def run_callbacks(self, templ):
238238
for tag in self.sect[i]:
239239
self.sect[i][tag].run_callbacks(templ.sect[i][None])
240240

241+
241242
#verify!
242243

243244
def sanity_check(self, path=None):
@@ -556,6 +557,8 @@ def __init__(self, templ=None):
556557
self.path = None
557558
if GetkwParser.bnf == None:
558559
GetkwParser.bnf = self.getkw_bnf()
560+
561+
559562
# self.parseString=self.bnf.parseString
560563
# GetkwParser.bnf.setDebug(True)
561564

@@ -648,8 +651,8 @@ def store_vector(self, s, l, t):
648651
if k.nargs == -1:
649652
pass
650653
elif len(arg) != k.nargs:
651-
print("Invalid number of elements for key '%s',\
652-
line: %d" % (name, lineno(self.loc, self.strg)))
654+
print("Invalid number of elements for key '{:s}', line: {:d}".format(
655+
name, lineno(self.loc, self.strg)))
653656
print(" -> %d required, %d given." % (k.nargs, len(arg)))
654657
if strict:
655658
sys.exit(1)
@@ -779,6 +782,7 @@ def parse_error(s, t, d, err):
779782
print("Parse error, line %d: %s" % (lineno(err.loc, err.pstr), line(err.loc, err.pstr)))
780783
sys.exit(1)
781784

785+
782786
######## Convenience routines for callbacks ########
783787

784788

@@ -814,6 +818,7 @@ def check_ignored(list, sect):
814818
else:
815819
print(warn % (i, sect.name, '<' + sect.tag + '>'))
816820

821+
817822
####################################################
818823

819824

0 commit comments

Comments
 (0)