Esempio n. 1
0
 def __init__(self, cb, args, kwargs):
     self.callback = cb
     self.args = args or []
     self.kwargs = kwargs or {}
     self.callback_name = cb.__name__
     self.callback_filename = os.path.split(get_function_code(cb).co_filename)[-1]
     self.callback_lineno = get_function_code(cb).co_firstlineno + 1
Esempio n. 2
0
 def __init__(self, cb, args, kwargs):
     self.callback = cb
     self.args = args or []
     self.kwargs = kwargs or {}
     self.callback_name = cb.__name__
     self.callback_filename = os.path.split(get_function_code(cb).co_filename)[-1]
     self.callback_lineno = get_function_code(cb).co_firstlineno + 1
Esempio n. 3
0
File: core.py Progetto: grigi/sure
def _get_file_name(func):
    try:
        name = inspect.getfile(func)
    except AttributeError:
        name = get_function_code(func).co_filename

    return os.path.abspath(name)
Esempio n. 4
0
def _get_file_name(func):
    try:
        name = inspect.getfile(func)
    except AttributeError:
        name = get_function_code(func).co_filename

    return os.path.abspath(name)
Esempio n. 5
0
File: core.py Progetto: grigi/sure
def _get_line_number(func):
    try:
        return inspect.getlineno(func)
    except AttributeError:
        return get_function_code(func).co_firstlineno
Esempio n. 6
0
def _get_line_number(func):
    try:
        return inspect.getlineno(func)
    except AttributeError:
        return get_function_code(func).co_firstlineno