(self, arg=None)
Change the messages that correspond to certain keys.
Change the messages that correspond to certain keys.
Change the messages that correspond to certain keys .
def update(self, arg=None):
        """Change the messages that correspond to certain keys."""
        if hasattr(arg, 'iteritems'):
            source = arg.iteritems()
        elif hasattr(arg, 'items'):
            source = arg.items()
        else:
            source = arg
        bad_key = False
        for key, message in source:
            try:
                self[key] = message
            except KeyError:
                bad_key = True
        if bad_key:
            raise KeyError('No message with key(s)')
def update ( self , arg = None ) : if hasattr ( arg , 'iteritems' ) : source = arg . iteritems ( ) elif hasattr ( arg , 'items' ) : source = arg . items ( ) else : source = arg bad_key = False for key , message in source : try : self [ key ] = message except KeyError : bad_key = True if bad_key : raise KeyError ( 'No message with key(s)' )