Exemple #1
0
def must_true(val,errmsg) :
    if not val ==  True :
        raise interface.bug_exception( errmsg )
    return val
Exemple #2
0
def must_obj(val,cls):
    if not isinstance(val,cls) :
        raise interface.bug_exception( " is not %s instance" %cls.__name__)
    return val
Exemple #3
0
def not_none(val,errmsg) :
    if val is   None :
        raise interface.bug_exception( errmsg )
    return val
Exemple #4
0
def must_exists( path) :
    if path is None or not os.path.exists(path) :
        raise interface.bug_exception("file not exists : %s" %path )
Exemple #5
0
def not_none(val, errmsg):
    if val is None:
        raise interface.bug_exception(errmsg)
    return val
Exemple #6
0
def must_obj(val, cls):
    if not isinstance(val, cls):
        raise interface.bug_exception(" is not %s instance" % cls.__name__)
    return val
Exemple #7
0
def must_exists(path):
    if path is None or not os.path.exists(path):
        raise interface.bug_exception("file not exists : %s" % path)
Exemple #8
0
def must_true(val, errmsg):
    if not val == True:
        raise interface.bug_exception(errmsg)
    return val