Exemplo n.º 1
0
def bundles():
    """List all of the available data bundles.
    """
    for bundle in sorted(bundles_module.bundles.keys()):
        try:
            ingestions = sorted(
                (str(bundles_module.from_bundle_ingest_dirname(ing))
                 for ing in os.listdir(pth.data_path([bundle]))
                 if not pth.hidden(ing)),
                reverse=True,
            )
        except OSError as e:
            if e.errno != errno.ENOENT:
                raise
            ingestions = []

        # If we got no ingestions, either because the directory didn't exist or
        # because there were no entries, print a single message indicating that
        # no ingestions have yet been made.
        for timestamp in ingestions or ["<no ingestions>"]:
            print("%s %s" % (bundle, timestamp))
Exemplo n.º 2
0
def bundles():
    """List all of the available data bundles.
    """
    for bundle in sorted(bundles_module.bundles.keys()):
        try:
            ingestions = sorted(
                (str(bundles_module.from_bundle_ingest_dirname(ing))
                 for ing in os.listdir(pth.data_path([bundle]))
                 if not pth.hidden(ing)),
                reverse=True,
            )
        except IOError as e:
            if e.errno != errno.ENOENT:
                raise
            ingestions = []

        # If we got no ingestions, either because the directory didn't exist or
        # because there were no entries, print a single message indicating that
        # no ingestions have yet been made.
        for timestamp in ingestions or ["<no ingestions>"]:
            print("%s %s" % (bundle, timestamp))
Exemplo n.º 3
0
def bundles():
    """List all of the available data bundles.
    """
    for bundle in sorted(bundles_module.bundles.keys()):
        try:
            ingestions = sorted(
                (str(bundles_module.from_bundle_ingest_dirname(ing))
                 for ing in os.listdir(pth.data_path([bundle]))
                 if not pth.hidden(ing)),
                reverse=True,
            )
        except IOError as e:
            if e.errno != errno.ENOENT:
                raise
            ingestions = []

        print(
            '\n'.join(
                '%s %s' % (bundle, line)
                for line in (
                    ingestions if ingestions else ('<no ingestions>',)
                )
            ),
        )
Exemplo n.º 4
0
 def _ts_of_run(run):
     return from_bundle_ingest_dirname(run.rsplit(os.path.sep, 1)[-1])
Exemplo n.º 5
0
 def _ts_of_run(run):
     return from_bundle_ingest_dirname(run.rsplit(os.path.sep, 1)[-1])