Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Xin Wang
codes-dev
Commits
bdf478f9
Commit
bdf478f9
authored
Jun 17, 2014
by
Jonathan Jenkins
Browse files
integrated codes-configurator scripts into build system
parent
39d64a99
Changes
4
Hide whitespace changes
Inline
Side-by-side
scripts/Makefile.subdir
View file @
bdf478f9
#bin_SCRIPTS += scripts/codes_configurator.py
my_bin_scripts
=
scripts/codes_configurator
\
scripts/codes_filter_configs
\
scripts/codes_config_get_vals
bin_SCRIPTS
+=
$(my_bin_scripts)
EXTRA_DIST
+=
$(my_bin_scripts)
CLEANFILES
+=
$(my_bin_scripts)
# manual rules for now
do_subst
=
sed
-e
's![@]libdir[@]!
$(libdir)
!g'
%
:
%.py.in Makefile
$(do_subst)
<
$<
>
$@
chmod
+x
$@
# install hook for configurator utility lib
# TODO: actually use the install program, use more of a 'standard' approach
install-data-local
:
cp
$(top_srcdir)
/scripts/configurator.py
$(libdir)
uninstall-local
:
rm
-f
$(libdir)
/configurator.py
scripts/codes_config_get_vals.py
→
scripts/codes_config_get_vals.py
.in
100755 → 100644
View file @
bdf478f9
#!/usr/bin/python2.7
import
argparse
import
sys
import
os
import
imp
from
itertools
import
islice
import
configurator
as
conf
# internal testing: import directly
#import configurator as conf
# internal testing: import directly
#import configurator as conf
# dynamically load from lib path
def
import_from
(
fname
):
path
,
name
=
os
.
path
.
split
(
fname
)
name
,
ext
=
os
.
path
.
splitext
(
name
)
fmod
,
fname
,
data
=
imp
.
find_module
(
name
,
[
path
])
return
imp
.
load_module
(
name
,
fmod
,
fname
,
data
)
conf
=
import_from
(
"@libdir@/configurator.py"
)
def
main
():
args
=
parse_args
()
...
...
scripts/codes_configurator.py
→
scripts/codes_configurator.py
.in
100755 → 100644
View file @
bdf478f9
...
...
@@ -2,7 +2,20 @@
import
os
import
argparse
import
configurator
as
conf
import
imp
# internal testing: import directly
#import configurator as conf
# dynamically load from lib path
def
import_from
(
fname
):
path
,
name
=
os
.
path
.
split
(
fname
)
name
,
ext
=
os
.
path
.
splitext
(
name
)
fmod
,
fname
,
data
=
imp
.
find_module
(
name
,
[
path
])
return
imp
.
load_module
(
name
,
fmod
,
fname
,
data
)
conf
=
import_from
(
"@libdir@/configurator.py"
)
def
main
():
args
=
parse_args
()
...
...
scripts/codes_filter_configs.py
→
scripts/codes_filter_configs.py
.in
100755 → 100644
View file @
bdf478f9
#!/usr/bin/python2.7
import
configurator
as
conf
from
sys
import
stdout
import
os
import
argparse
import
imp
# internal testing: import directly
#import configurator as conf
# dynamically load from lib path
def
import_from
(
fname
):
path
,
name
=
os
.
path
.
split
(
fname
)
name
,
ext
=
os
.
path
.
splitext
(
name
)
fmod
,
fname
,
data
=
imp
.
find_module
(
name
,
[
path
])
return
imp
.
load_module
(
name
,
fmod
,
fname
,
data
)
conf
=
import_from
(
"@libdir@/configurator.py"
)
def
main
():
args
=
parse_args
()
...
...
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