Python repr.repr() Examples
The following are 30
code examples of repr.repr().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
repr
, or try the search function
.
Example #1
Source File: bdb.py From unity-python with MIT License | 6 votes |
def trace_dispatch(self, frame, event, arg): if self.quitting: return # None if event == 'line': return self.dispatch_line(frame) if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call': return self.trace_dispatch if event == 'c_exception': return self.trace_dispatch if event == 'c_return': return self.trace_dispatch print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch
Example #2
Source File: bdb.py From CTFCrackTools-V2 with GNU General Public License v3.0 | 6 votes |
def trace_dispatch(self, frame, event, arg): if self.quitting: return # None if event == 'line': return self.dispatch_line(frame) if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call': return self.trace_dispatch if event == 'c_exception': return self.trace_dispatch if event == 'c_return': return self.trace_dispatch print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch
Example #3
Source File: bdb.py From CTFCrackTools-V2 with GNU General Public License v3.0 | 6 votes |
def trace_dispatch(self, frame, event, arg): if self.quitting: return # None if event == 'line': return self.dispatch_line(frame) if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call': return self.trace_dispatch if event == 'c_exception': return self.trace_dispatch if event == 'c_return': return self.trace_dispatch print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch
Example #4
Source File: bdb.py From RevitBatchProcessor with GNU General Public License v3.0 | 6 votes |
def trace_dispatch(self, frame, event, arg): if self.quitting: return # None if event == 'line': return self.dispatch_line(frame) if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call': return self.trace_dispatch if event == 'c_exception': return self.trace_dispatch if event == 'c_return': return self.trace_dispatch print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch
Example #5
Source File: bdb.py From medicare-demo with Apache License 2.0 | 6 votes |
def trace_dispatch(self, frame, event, arg): if self.quitting: return # None if event == 'line': return self.dispatch_line(frame) if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call': return self.trace_dispatch if event == 'c_exception': return self.trace_dispatch if event == 'c_return': return self.trace_dispatch print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch
Example #6
Source File: bdb.py From PokemonGo-DesktopMap with MIT License | 6 votes |
def trace_dispatch(self, frame, event, arg): if self.quitting: return # None if event == 'line': return self.dispatch_line(frame) if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call': return self.trace_dispatch if event == 'c_exception': return self.trace_dispatch if event == 'c_return': return self.trace_dispatch print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch
Example #7
Source File: bdb.py From Splunking-Crime with GNU Affero General Public License v3.0 | 6 votes |
def trace_dispatch(self, frame, event, arg): if self.quitting: return # None if event == 'line': return self.dispatch_line(frame) if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call': return self.trace_dispatch if event == 'c_exception': return self.trace_dispatch if event == 'c_return': return self.trace_dispatch print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch
Example #8
Source File: bdb.py From pycopia with Apache License 2.0 | 6 votes |
def format_stack_entry(self, frame_lineno, lprefix=': '): import linecache, repr frame, lineno = frame_lineno filename = self.canonic(frame.f_code.co_filename) s = '%s(%r)' % (filename, lineno) if frame.f_code.co_name: s = s + frame.f_code.co_name else: s = s + "<lambda>" if '__args__' in frame.f_locals: args = frame.f_locals['__args__'] else: args = None if args: s = s + repr.repr(args) else: s = s + '()' if '__return__' in frame.f_locals: rv = frame.f_locals['__return__'] s = s + '->' s = s + repr.repr(rv) line = linecache.getline(filename, lineno) if line: s = s + lprefix + line.strip() return s
Example #9
Source File: bdb.py From pycopia with Apache License 2.0 | 6 votes |
def trace_dispatch(self, frame, event, arg): if self.quitting: return # None if event == 'line': return self.dispatch_line(frame) if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call': return self.trace_dispatch if event == 'c_exception': return self.trace_dispatch if event == 'c_return': return self.trace_dispatch print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch
Example #10
Source File: bdb.py From oss-ftp with MIT License | 6 votes |
def trace_dispatch(self, frame, event, arg): if self.quitting: return # None if event == 'line': return self.dispatch_line(frame) if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call': return self.trace_dispatch if event == 'c_exception': return self.trace_dispatch if event == 'c_return': return self.trace_dispatch print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch
Example #11
Source File: bdb.py From canape with GNU General Public License v3.0 | 6 votes |
def trace_dispatch(self, frame, event, arg): if self.quitting: return # None if event == 'line': return self.dispatch_line(frame) if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call': return self.trace_dispatch if event == 'c_exception': return self.trace_dispatch if event == 'c_return': return self.trace_dispatch print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch
Example #12
Source File: bdb.py From CTFCrackTools with GNU General Public License v3.0 | 6 votes |
def trace_dispatch(self, frame, event, arg): if self.quitting: return # None if event == 'line': return self.dispatch_line(frame) if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call': return self.trace_dispatch if event == 'c_exception': return self.trace_dispatch if event == 'c_return': return self.trace_dispatch print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch
Example #13
Source File: bdb.py From BinderFilter with MIT License | 6 votes |
def trace_dispatch(self, frame, event, arg): if self.quitting: return # None if event == 'line': return self.dispatch_line(frame) if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call': return self.trace_dispatch if event == 'c_exception': return self.trace_dispatch if event == 'c_return': return self.trace_dispatch print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch
Example #14
Source File: bdb.py From CTFCrackTools with GNU General Public License v3.0 | 6 votes |
def trace_dispatch(self, frame, event, arg): if self.quitting: return # None if event == 'line': return self.dispatch_line(frame) if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call': return self.trace_dispatch if event == 'c_exception': return self.trace_dispatch if event == 'c_return': return self.trace_dispatch print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch
Example #15
Source File: bdb.py From ironpython2 with Apache License 2.0 | 6 votes |
def trace_dispatch(self, frame, event, arg): if self.quitting: return # None if event == 'line': return self.dispatch_line(frame) if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call': return self.trace_dispatch if event == 'c_exception': return self.trace_dispatch if event == 'c_return': return self.trace_dispatch print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch
Example #16
Source File: bdb.py From meddle with MIT License | 6 votes |
def trace_dispatch(self, frame, event, arg): if self.quitting: return # None if event == 'line': return self.dispatch_line(frame) if event == 'call': return self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) if event == 'c_call': return self.trace_dispatch if event == 'c_exception': return self.trace_dispatch if event == 'c_return': return self.trace_dispatch print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch
Example #17
Source File: bdb.py From unity-python with MIT License | 5 votes |
def format_stack_entry(self, frame_lineno, lprefix=': '): import linecache, repr frame, lineno = frame_lineno filename = self.canonic(frame.f_code.co_filename) s = '%s(%r)' % (filename, lineno) if frame.f_code.co_name: s = s + frame.f_code.co_name else: s = s + "<lambda>" if '__args__' in frame.f_locals: args = frame.f_locals['__args__'] else: args = None if args: s = s + repr.repr(args) else: s = s + '()' if '__return__' in frame.f_locals: rv = frame.f_locals['__return__'] s = s + '->' s = s + repr.repr(rv) line = linecache.getline(filename, lineno, frame.f_globals) if line: s = s + lprefix + line.strip() return s # The following two methods can be called by clients to use # a debugger to debug a statement, given as a string.
Example #18
Source File: bdb.py From CTFCrackTools with GNU General Public License v3.0 | 5 votes |
def format_stack_entry(self, frame_lineno, lprefix=': '): import linecache, repr frame, lineno = frame_lineno filename = self.canonic(frame.f_code.co_filename) s = '%s(%r)' % (filename, lineno) if frame.f_code.co_name: s = s + frame.f_code.co_name else: s = s + "<lambda>" if '__args__' in frame.f_locals: args = frame.f_locals['__args__'] else: args = None if args: s = s + repr.repr(args) else: s = s + '()' if '__return__' in frame.f_locals: rv = frame.f_locals['__return__'] s = s + '->' s = s + repr.repr(rv) line = linecache.getline(filename, lineno, frame.f_globals) if line: s = s + lprefix + line.strip() return s # The following two methods can be called by clients to use # a debugger to debug a statement, given as a string.
Example #19
Source File: bdb.py From canape with GNU General Public License v3.0 | 5 votes |
def format_stack_entry(self, frame_lineno, lprefix=': '): import linecache, repr frame, lineno = frame_lineno filename = self.canonic(frame.f_code.co_filename) s = '%s(%r)' % (filename, lineno) if frame.f_code.co_name: s = s + frame.f_code.co_name else: s = s + "<lambda>" if '__args__' in frame.f_locals: args = frame.f_locals['__args__'] else: args = None if args: s = s + repr.repr(args) else: s = s + '()' if '__return__' in frame.f_locals: rv = frame.f_locals['__return__'] s = s + '->' s = s + repr.repr(rv) line = linecache.getline(filename, lineno, frame.f_globals) if line: s = s + lprefix + line.strip() return s # The following two methods can be called by clients to use # a debugger to debug a statement, given as a string.
Example #20
Source File: bdb.py From PokemonGo-DesktopMap with MIT License | 5 votes |
def format_stack_entry(self, frame_lineno, lprefix=': '): import linecache, repr frame, lineno = frame_lineno filename = self.canonic(frame.f_code.co_filename) s = '%s(%r)' % (filename, lineno) if frame.f_code.co_name: s = s + frame.f_code.co_name else: s = s + "<lambda>" if '__args__' in frame.f_locals: args = frame.f_locals['__args__'] else: args = None if args: s = s + repr.repr(args) else: s = s + '()' if '__return__' in frame.f_locals: rv = frame.f_locals['__return__'] s = s + '->' s = s + repr.repr(rv) line = linecache.getline(filename, lineno, frame.f_globals) if line: s = s + lprefix + line.strip() return s # The following two methods can be called by clients to use # a debugger to debug a statement, given as a string.
Example #21
Source File: bdb.py From CTFCrackTools with GNU General Public License v3.0 | 5 votes |
def format_stack_entry(self, frame_lineno, lprefix=': '): import linecache, repr frame, lineno = frame_lineno filename = self.canonic(frame.f_code.co_filename) s = '%s(%r)' % (filename, lineno) if frame.f_code.co_name: s = s + frame.f_code.co_name else: s = s + "<lambda>" if '__args__' in frame.f_locals: args = frame.f_locals['__args__'] else: args = None if args: s = s + repr.repr(args) else: s = s + '()' if '__return__' in frame.f_locals: rv = frame.f_locals['__return__'] s = s + '->' s = s + repr.repr(rv) line = linecache.getline(filename, lineno, frame.f_globals) if line: s = s + lprefix + line.strip() return s # The following two methods can be called by clients to use # a debugger to debug a statement, given as a string.
Example #22
Source File: bdb.py From RevitBatchProcessor with GNU General Public License v3.0 | 5 votes |
def format_stack_entry(self, frame_lineno, lprefix=': '): import linecache, repr frame, lineno = frame_lineno filename = self.canonic(frame.f_code.co_filename) s = '%s(%r)' % (filename, lineno) if frame.f_code.co_name: s = s + frame.f_code.co_name else: s = s + "<lambda>" if '__args__' in frame.f_locals: args = frame.f_locals['__args__'] else: args = None if args: s = s + repr.repr(args) else: s = s + '()' if '__return__' in frame.f_locals: rv = frame.f_locals['__return__'] s = s + '->' s = s + repr.repr(rv) line = linecache.getline(filename, lineno, frame.f_globals) if line: s = s + lprefix + line.strip() return s # The following two methods can be called by clients to use # a debugger to debug a statement, given as a string.
Example #23
Source File: bdb.py From CTFCrackTools-V2 with GNU General Public License v3.0 | 5 votes |
def format_stack_entry(self, frame_lineno, lprefix=': '): import linecache, repr frame, lineno = frame_lineno filename = self.canonic(frame.f_code.co_filename) s = '%s(%r)' % (filename, lineno) if frame.f_code.co_name: s = s + frame.f_code.co_name else: s = s + "<lambda>" if '__args__' in frame.f_locals: args = frame.f_locals['__args__'] else: args = None if args: s = s + repr.repr(args) else: s = s + '()' if '__return__' in frame.f_locals: rv = frame.f_locals['__return__'] s = s + '->' s = s + repr.repr(rv) line = linecache.getline(filename, lineno, frame.f_globals) if line: s = s + lprefix + line.strip() return s # The following two methods can be called by clients to use # a debugger to debug a statement, given as a string.
Example #24
Source File: bdb.py From CTFCrackTools-V2 with GNU General Public License v3.0 | 5 votes |
def format_stack_entry(self, frame_lineno, lprefix=': '): import linecache, repr frame, lineno = frame_lineno filename = self.canonic(frame.f_code.co_filename) s = '%s(%r)' % (filename, lineno) if frame.f_code.co_name: s = s + frame.f_code.co_name else: s = s + "<lambda>" if '__args__' in frame.f_locals: args = frame.f_locals['__args__'] else: args = None if args: s = s + repr.repr(args) else: s = s + '()' if '__return__' in frame.f_locals: rv = frame.f_locals['__return__'] s = s + '->' s = s + repr.repr(rv) line = linecache.getline(filename, lineno, frame.f_globals) if line: s = s + lprefix + line.strip() return s # The following two methods can be called by clients to use # a debugger to debug a statement, given as a string.
Example #25
Source File: bdb.py From medicare-demo with Apache License 2.0 | 5 votes |
def format_stack_entry(self, frame_lineno, lprefix=': '): import linecache, repr frame, lineno = frame_lineno filename = self.canonic(frame.f_code.co_filename) s = '%s(%r)' % (filename, lineno) if frame.f_code.co_name: s = s + frame.f_code.co_name else: s = s + "<lambda>" if '__args__' in frame.f_locals: args = frame.f_locals['__args__'] else: args = None if args: s = s + repr.repr(args) else: s = s + '()' if '__return__' in frame.f_locals: rv = frame.f_locals['__return__'] s = s + '->' s = s + repr.repr(rv) line = linecache.getline(filename, lineno) if line: s = s + lprefix + line.strip() return s # The following two methods can be called by clients to use # a debugger to debug a statement, given as a string.
Example #26
Source File: bdb.py From Splunking-Crime with GNU Affero General Public License v3.0 | 5 votes |
def format_stack_entry(self, frame_lineno, lprefix=': '): import linecache, repr frame, lineno = frame_lineno filename = self.canonic(frame.f_code.co_filename) s = '%s(%r)' % (filename, lineno) if frame.f_code.co_name: s = s + frame.f_code.co_name else: s = s + "<lambda>" if '__args__' in frame.f_locals: args = frame.f_locals['__args__'] else: args = None if args: s = s + repr.repr(args) else: s = s + '()' if '__return__' in frame.f_locals: rv = frame.f_locals['__return__'] s = s + '->' s = s + repr.repr(rv) line = linecache.getline(filename, lineno, frame.f_globals) if line: s = s + lprefix + line.strip() return s # The following two methods can be called by clients to use # a debugger to debug a statement, given as a string.
Example #27
Source File: log_helpers.py From n6 with GNU Affero General Public License v3.0 | 5 votes |
def configure_logging(suffix=None): logging.config.eval = _security_logging_config_monkeypatched_eval file_name = ('logging.conf' if suffix is None else 'logging-{0}.conf'.format(suffix)) file_paths = [os.path.join(config_dir, file_name) for config_dir in (ETC_DIR, USER_DIR)] for path in file_paths: if path in _loaded_configuration_paths: _LOGGER.warning('ignored attempt to load logging configuration ' 'file %r that has already been used', path) continue try: _try_reading(path) except EnvironmentError: pass else: try: logging.config.fileConfig(path, disable_existing_loggers=False) except AMQPConnectionError: raise RuntimeError('error while configuring logging, ' 'using settings from configuration file {0!r}:\n' 'unable to establish ' 'connection with RabbitMQ server\n{1}' .format(path, traceback.format_exc())) except Exception: raise RuntimeError('error while configuring logging, ' 'using settings from configuration file {0!r}:\n{1}' .format(path, traceback.format_exc())) else: _LOGGER.info('logging configuration loaded from %r', path) _loaded_configuration_paths.add(path) if not _loaded_configuration_paths: raise RuntimeError('logging configuration not loaded: ' 'could not open any of the files: {0}' .format(', '.join(map(repr, file_paths)))) # TODO: doc and maybe some tests?
Example #28
Source File: bdb.py From oss-ftp with MIT License | 5 votes |
def format_stack_entry(self, frame_lineno, lprefix=': '): import linecache, repr frame, lineno = frame_lineno filename = self.canonic(frame.f_code.co_filename) s = '%s(%r)' % (filename, lineno) if frame.f_code.co_name: s = s + frame.f_code.co_name else: s = s + "<lambda>" if '__args__' in frame.f_locals: args = frame.f_locals['__args__'] else: args = None if args: s = s + repr.repr(args) else: s = s + '()' if '__return__' in frame.f_locals: rv = frame.f_locals['__return__'] s = s + '->' s = s + repr.repr(rv) line = linecache.getline(filename, lineno, frame.f_globals) if line: s = s + lprefix + line.strip() return s # The following two methods can be called by clients to use # a debugger to debug a statement, given as a string.
Example #29
Source File: debugger.py From Computable with MIT License | 5 votes |
def do_list(self, arg): self.lastcmd = 'list' last = None if arg: try: x = eval(arg, {}, {}) if type(x) == type(()): first, last = x first = int(first) last = int(last) if last < first: # Assume it's a count last = first + last else: first = max(1, int(x) - 5) except: print('*** Error in argument:', repr(arg)) return elif self.lineno is None: first = max(1, self.curframe.f_lineno - 5) else: first = self.lineno + 1 if last is None: last = first + 10 self.print_list_lines(self.curframe.f_code.co_filename, first, last) # vds: >> lineno = first filename = self.curframe.f_code.co_filename self.shell.hooks.synchronize_with_editor(filename, lineno, 0) # vds: <<
Example #30
Source File: test_debugger.py From Computable with MIT License | 5 votes |
def test_longer_repr(): from repr import repr as trepr a = '1234567890'* 7 ar = "'1234567890123456789012345678901234567890123456789012345678901234567890'" a_trunc = "'123456789012...8901234567890'" nt.assert_equal(trepr(a), a_trunc) # The creation of our tracer modifies the repr module's repr function # in-place, since that global is used directly by the stdlib's pdb module. t = debugger.Tracer() nt.assert_equal(trepr(a), ar)