dao/client/shell.py
def _print_result(self, args, result):
        """Print result in a format defined by self.print_format"""
        if result is None:
            result = 'Accepted'
        if args.filter:
            fields = args.filter.split(',')
            #apply interfaces normalization, to make it user friendly
            if isinstance(result, dict):
                result = dict((k, self._filter(fields, v)[1])
                              for k, v in result.items())
            elif isinstance(result, list):
                result = list(self._filter(fields, v)[1] for v in result)
        if self.print_format == 'print':
            pprint.pprint(result)
        elif self.print_format == 'json':
            print json.dumps(result)
Print result in a format defined by self.print_format
Print result in a format defined by self.print_format
Print result in a format defined by self . print_format
def _print_result(self, args, result):
        if result is None:
            result = 'Accepted'
        if args.filter:
            fields = args.filter.split(',')
            if isinstance(result, dict):
                result = dict((k, self._filter(fields, v)[1])
                              for k, v in result.items())
            elif isinstance(result, list):
                result = list(self._filter(fields, v)[1] for v in result)
        if self.print_format == 'print':
            pprint.pprint(result)
        elif self.print_format == 'json':
            print json.dumps(result)
def _print_result ( self , args , result ) : if result is None : result = 'Accepted' if args . filter : fields = args . filter . split ( ',' ) if isinstance ( result , dict ) : result = dict ( ( k , self . _filter ( fields , v ) [ 1 ] ) for k , v in result . items ( ) ) elif isinstance ( result , list ) : result = list ( self . _filter ( fields , v ) [ 1 ] for v in result ) if self . print_format == 'print' : pprint . pprint ( result ) elif self . print_format == 'json' : print json . dumps ( result )
Print result in a format defined by self.print_format
Print result in a format defined by self . print_format
"""Print result in a format defined by self.print_format""" #apply interfaces normalization, to make it user friendly
self
args
result