Example #1
0
def list_local_suites(argv):
    """CLI command to list all the locally checked out suites"""
    opt_parser = RoseOptionParser().add_my_options(
        "no_headers", "prefixes", "print_format", "reverse", "sort", "user")
    opts = opt_parser.parse_args(argv)[0]
    report = Reporter(opts.verbosity - opts.quietness)

    if opts.user:
        alternative_roses_dir = SuiteId.get_local_copy_root(opts.user)
        report(UserSpecificRoses(alternative_roses_dir), prefix=None)

    ws_client = RosieWSClient(prefixes=opts.prefixes, event_handler=report)
    if ws_client.unreachable_prefixes:
        bad_prefix_string = " ".join(ws_client.unreachable_prefixes)
        report(
            RosieWSClientError(
                ERR_PREFIX_UNREACHABLE.format(bad_prefix_string)))
    _display_maps(opts, ws_client, ws_client.query_local_copies(opts.user))
Example #2
0
def list_local_suites():
    """CLI command to list all the locally checked out suites"""
    opt_parser = RoseOptionParser(description='''
List the local suites.

Search for locally checked out suites and print their details.

The default format includes a local working copy status field (`%local`)
in the first column.
A blank field means there is no related suite checked out.

* `=` means that the suite is checked out at this branch and revision.
* `<` means that the suite is checked out but at an older revision.
* `>` means that the suite is checked out but at a newer revision.
* `S` means that the suite is checked out but on a different branch.
* `M` means that the suite is checked out and modified.
* `X` means that the suite is checked out but is corrupted.
        ''', ).add_my_options("no_headers", "prefixes", "print_format",
                              "reverse", "sort", "user")
    opt_parser.modify_option(
        'verbosity',
        help=('Display full info for each returned suite.'),
    )
    opts = opt_parser.parse_args()[0]
    report = Reporter(opts.verbosity - opts.quietness)

    if opts.user:
        alternative_roses_dir = SuiteId.get_local_copy_root(opts.user)
        report(UserSpecificRoses(alternative_roses_dir), prefix=None)

    ws_client = RosieWSClient(prefixes=opts.prefixes, event_handler=report)
    if ws_client.unreachable_prefixes:
        bad_prefix_string = " ".join(ws_client.unreachable_prefixes)
        report(
            RosieWSClientError(
                ERR_PREFIX_UNREACHABLE.format(bad_prefix_string)))
    _display_maps(opts, ws_client, ws_client.query_local_copies(opts.user))