Ejemplo 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
Ejemplo 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
Ejemplo n.º 3
0
Archivo: core.py Proyecto: 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)
Ejemplo 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)
Ejemplo n.º 5
0
Archivo: core.py Proyecto: grigi/sure
def _get_line_number(func):
    try:
        return inspect.getlineno(func)
    except AttributeError:
        return get_function_code(func).co_firstlineno
Ejemplo n.º 6
0
def _get_line_number(func):
    try:
        return inspect.getlineno(func)
    except AttributeError:
        return get_function_code(func).co_firstlineno