Пример #1
0
def must_true(val,errmsg) :
    if not val ==  True :
        raise interface.bug_exception( errmsg )
    return val
Пример #2
0
def must_obj(val,cls):
    if not isinstance(val,cls) :
        raise interface.bug_exception( " is not %s instance" %cls.__name__)
    return val
Пример #3
0
def not_none(val,errmsg) :
    if val is   None :
        raise interface.bug_exception( errmsg )
    return val
Пример #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 )
Пример #5
0
def not_none(val, errmsg):
    if val is None:
        raise interface.bug_exception(errmsg)
    return val
Пример #6
0
def must_obj(val, cls):
    if not isinstance(val, cls):
        raise interface.bug_exception(" is not %s instance" % cls.__name__)
    return val
Пример #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)
Пример #8
0
def must_true(val, errmsg):
    if not val == True:
        raise interface.bug_exception(errmsg)
    return val