Commit bdf478f9 authored by Jonathan Jenkins's avatar Jonathan Jenkins

integrated codes-configurator scripts into build system

parent 39d64a99
#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
#!/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()
......
......@@ -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()
......
#!/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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment