id = "45c9dd9d16bc677a761b629ab559a22d24950f30"
date = "2014-11-19 22:12:50 +0000"
branch = "None"
tag = "glue-release-1-47-1"
if tag == "None":
    tag = None
author = "Ryan Fisher <ryan.fisher@ligo.org>"
builder = "Ryan Fisher <ryan.fisher@ligo.org>"
committer = "Ryan Fisher <ryan.fisher@ligo.org>"
status = "CLEAN: All modifications committed"
version = id
verbose_msg = """Branch: None
Tag: glue-release-1-47-1
Id: 45c9dd9d16bc677a761b629ab559a22d24950f30

Builder: Ryan Fisher <ryan.fisher@ligo.org>
Build date: 2014-11-19 22:14:15 +0000
Repository status: CLEAN: All modifications committed"""

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 == "45c9dd9d16bc677a761b629ab559a22d24950f30":
        return
    msg = "Program id (45c9dd9d16bc677a761b629ab559a22d24950f30) does not match given id (%s)." % foreign_id
    if onmismatch == "raise":
        raise VersionMismatchError, msg

    # in the backtrace, show calling code
    warnings.warn(msg, UserWarning)

