def cmd_dumprepr(self, *args): """Print debugging information on netbeans and the debugger.""" unused = args self.console_print( 'netbeans:\n%s\n' % misc.pformat(self.__nbsock.__dict__) + '%s:\n%s\n' % (self.__class__.__name__.lower(), self)) self.print_prompt()
def __str__(self): """Return the string representation.""" shallow = copy.copy(self.__dict__) for name in list(shallow): if name in ('cmds', 'pyclewn_cmds', 'mapkeys'): del shallow[name] return misc.pformat(shallow)
def __str__(self): """Return the string representation.""" shallow = copy.copy(self.__dict__) for name in ('cmds', 'pyclewn_cmds', 'mapkeys'): if shallow.has_key(name): del shallow[name] return misc.pformat(shallow)
def cmd_dumprepr(self, *args): """Print debugging information on netbeans and the debugger.""" unused = args self.console_print('netbeans:\n%s\n' % misc.pformat(self.__nbsock.__dict__) + '%s:\n%s\n' % (self.__class__.__name__.lower(), self)) self.print_prompt()
def __str__(self): """Return the string representation.""" shallow = copy.copy(self.__dict__) for name in ("cmds", "pyclewn_cmds", "mapkeys"): if name in shallow: del shallow[name] return misc.pformat(shallow)
def cmd_dumprepr(self, cmd, args): """Print debugging information on netbeans and the debugger.""" unused = cmd # dumprepr is used by the testsuite to detect the end of # processing by pyclewn of all commands, so as to parse the # results and check the test if not (self.testrun and args): self.console_print( 'netbeans:\n%s\n' % misc.pformat(self.__nbsock.__dict__) + '%s:\n%s\n' % (self.__class__.__name__.lower(), self)) self.print_prompt()
def __str__(self): """Return the string representation.""" shallow = copy.copy(self.__dict__) for name in list(shallow): if name in ('cmds', 'pyclewn_cmds', 'mapkeys'): del shallow[name] # avoid "RuntimeError: dictionary changed size during # iteration" on socket_map when running pdb else: item = shallow[name] if isinstance(item, dict): item = dict(item) return misc.pformat(shallow)
def pformat(name, obj): """Pretty format an object __dict__.""" if obj: return '%s:\n%s\n' % (name, misc.pformat(obj.__dict__)) else: return ''
def __repr__(self): """Return the pretty formated self dictionary.""" return misc.pformat(self.__dict__)