Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(5)  |  Call(2)  |  Derive(0)  |  Import(3)

        def format_metadata(metadata_dict):
    metadata_str = ''

    count = len(metadata_dict)
    i = 0
    for key, value in metadata_dict.items():
        i += 1
        metadata_str += '%s: %s' % (key, value)

        if i < count:
            metadata_str += ', '

    return metadata_str
        


src/s/e/service-registry-cli-0.2.1/service_registry_cli/commands/services/get.py   service-registry-cli(Download)
from cliff.show import ShowOne
 
from service_registry_cli.utils import (
    BaseShowCommand,
    get_client,
    def take_action(self, parsed_args):
        client = get_client(parsed_args)
        value = client.services.get(parsed_args.object_id)
        metadata_str = format_metadata(value['metadata'])
        service_tuple = (value['id'],

src/s/e/service-registry-cli-0.2.1/service_registry_cli/commands/services/list.py   service-registry-cli(Download)
 
from service_registry_cli.utils import BaseListCommand, get_client
from service_registry_cli.utils import format_metadata, format_timestamp
 
 
                          format_timestamp(value['last_seen']),
                          ', '.join(value['tags']),
                          format_metadata(value['metadata']))
                          for value in values]
        return (('Service ID', 'Heartbeat Timeout', 'Last Seen', 'Tags',

src/s/e/service-registry-cli-0.2.1/service_registry_cli/commands/events/list.py   service-registry-cli(Download)
from cliff.lister import Lister
 
from service_registry_cli.utils import (
    BaseListCommand,
    get_client,