Did I find the right examples for you? yes no

All Samples(21)  |  Call(18)  |  Derive(0)  |  Import(3)
Prints a list with one element per line with an optional header

        def list_printer(header):
    """Prints a list with one element per line with an optional header"""
    
    def list_printer_helper(l, print_headers=True, kwargs={}):
        
        if print_headers:
            safe_print(header)
        
        for item in l:
            safe_print(item)
        
        if getattr(l,'truncated', False):
            print >> sys.stderr, '...Results are truncated...'        
        
    return list_printer_helper
        


src/s/c/scicloud-3.0.4/src/cli/main.py   scicloud(Download)
 
from . import argparsers
from .util import list_of_dicts_printer, dict_printer, list_printer,\
    key_val_printer, volume_ls_printer, cloud_info_printer,\
    cloud_result_printer, cloud_result_json_printer, bucket_info_printer,\
                       'result' : cloud_result_printer,
                       'ssh-info' : dict_printer(['address', 'port', 'username', 'identity']),
                       'rest.list' : list_printer('label'),
                       'rest.info' : dict_printer(['label', 'uri', 'signature', 'output_encoding', 'description']),
                       'realtime.request': dict_printer(['request_id', 'type', 'cores', 'start_time']),
                       'realtime.list': list_of_dicts_printer(['request_id', 'type', 'cores', 'start_time']),
                       'files.list': list_printer('filename'),
                       'bucket.list': list_printer('filename'),
                       'bucket.iterlist': list_printer('filename'),

src/s/c/sciscicloud-3.0.2/src/cli/main.py   sciscicloud(Download)
 
from . import argparsers
from .util import list_of_dicts_printer, dict_printer, list_printer,\
    key_val_printer, volume_ls_printer, scicloud_info_printer,\
    scicloud_result_printer, scicloud_result_json_printer, bucket_info_printer,\
                       'result' : scicloud_result_printer,
                       'ssh-info' : dict_printer(['address', 'port', 'username', 'identity']),
                       'rest.list' : list_printer('label'),
                       'rest.info' : dict_printer(['label', 'uri', 'signature', 'output_encoding', 'description']),
                       'realtime.request': dict_printer(['request_id', 'type', 'cores', 'start_time']),
                       'realtime.list': list_of_dicts_printer(['request_id', 'type', 'cores', 'start_time']),
                       'files.list': list_printer('filename'),
                       'bucket.list': list_printer('filename'),
                       'bucket.iterlist': list_printer('filename'),

src/c/l/cloud-2.8.5/src/cli/main.py   cloud(Download)
 
from . import argparsers
from .util import list_of_dicts_printer, dict_printer, list_printer,\
    key_val_printer, volume_ls_printer, cloud_info_printer,\
    cloud_result_printer, cloud_result_json_printer, bucket_info_printer,\
                       'result' : cloud_result_printer,
                       'ssh-info' : dict_printer(['address', 'port', 'username', 'identity']),
                       'rest.list' : list_printer('label'),
                       'rest.info' : dict_printer(['label', 'uri', 'signature', 'output_encoding', 'description']),
                       'realtime.request': dict_printer(['request_id', 'type', 'cores', 'start_time']),
                       'realtime.list': list_of_dicts_printer(['request_id', 'type', 'cores', 'start_time']),
                       'files.list': list_printer('filename'),
                       'bucket.list': list_printer('filename'),
                       'bucket.iterlist': list_printer('filename'),