Example #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
Example #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
Example #3
0
File: core.py Project: 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)
Example #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)
Example #5
0
File: core.py Project: grigi/sure
def _get_line_number(func):
    try:
        return inspect.getlineno(func)
    except AttributeError:
        return get_function_code(func).co_firstlineno
Example #6
0
def _get_line_number(func):
    try:
        return inspect.getlineno(func)
    except AttributeError:
        return get_function_code(func).co_firstlineno