Commit 61a07bd0 authored by Karl Wette's avatar Karl Wette

LALInference: add python/ subdirectory

Original: b74df31cc905e430370f70fd8a86363337f7b4ba
parent 8dcc281c
......@@ -21,6 +21,8 @@ lalinference-*.tar.gz
lalinference.pc
lalinference.spec
libtool
python/__init__.py
python/git_version.py
src/LALInferenceConfig.h
src/LALInferenceVCSInfo.h
src/git_version
......
......@@ -18,6 +18,7 @@ SUBDIRS = \
debian \
include \
src \
python \
swig \
test
......
......@@ -13,6 +13,8 @@ AC_CONFIG_FILES([ \
include/Makefile \
include/lal/Makefile \
src/Makefile \
python/Makefile \
python/__init__.py \
swig/Makefile \
swig/octave/Makefile \
swig/python/Makefile \
......
pkgpython_PYTHON = \
__init__.py \
git_version.py
EXTRA_DIST = \
git_version.py
BUILT_SOURCES =
MOSTLYCLEANFILES =
if HAVE_GIT_REPO
BUILT_SOURCES += git_version.py
MOSTLYCLEANFILES += git_version.py
git_version.py .PHONY : gen-git_version.py
gen-git_version.py :
$(AM_V_at)$(GENERATE_VCS_INFO) git_version.py $(srcdir)/git_version.py.git
endif
# Import SWIG wrappings, if available
@SWIG_BUILD_PYTHON_TRUE@from lalinference import *
# git_version.py - vcs information module
#
# Copyright (C) 2010 Nickolas Fotopoulos
# Copyright (C) 2012-2013 Adam Mercer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with with program; see the file COPYING. If not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
id = "@ID@"
date = "@DATE@"
branch = "@BRANCH@"
tag = "@TAG@"
if tag == "None":
tag = None
author = "@AUTHOR@"
builder = "@BUILDER@"
committer = "@COMMITTER@"
status = "@STATUS@"
version = id
verbose_msg = """Branch: @BRANCH@
Tag: @TAG@
Id: @ID@
Builder: @BUILDER@
Repository status: @STATUS@"""
import warnings
class VersionMismatchError(ValueError):
pass
def check_match(foreign_id, onmismatch="raise"):
"""
If foreign_id != id, perform an action specified by the onmismatch
kwarg. This can be useful for validating input files.
onmismatch actions:
"raise": raise a VersionMismatchError, stating both versions involved
"warn": emit a warning, stating both versions involved
"""
if onmismatch not in ("raise", "warn"):
raise ValueError, onmismatch + " is an unrecognized value of onmismatch"
if foreign_id == "@ID@":
return
msg = "Program id (@ID@) does not match given id (%s)." % foreign_id
if onmismatch == "raise":
raise VersionMismatchError, msg
# in the backtrace, show calling code
warnings.warn(msg, UserWarning)
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