def testParserFormatList(self):
     """
     This failed for DropBox while working
     on #3200
     """
     from omero.cli import Parser
     p = Parser()
     p._format_list([])
     p._format_list(["a"])
Exemple #2
0
def main():
    parser = Parser()
    parser.add_login_arguments()
    parser.add_argument("file")
    parser.add_argument("object")
    ns = parser.parse_args()

    cli = CLI()
    cli.loadplugins()
    client = cli.conn(ns)
    try:
        screen_metadata(client, ns.file, ns.object)
    finally:
        cli.close()
Exemple #3
0
def main():
    parser = Parser()
    parser.add_login_arguments()
    parser.add_argument("file")
    parser.add_argument("object")
    ns = parser.parse_args()

    cli = CLI()
    cli.loadplugins()
    client = cli.conn(ns)
    try:
        screen_metadata(client, ns.file, ns.object)
    finally:
        cli.close()
Exemple #4
0
def main():
    parser = Parser()
    parser.add_login_arguments()
    parser.add_argument("--orphans", action="store_true")
    parser.add_argument("--unknown", action="store_true")
    parser.add_argument("--search", action="store_true")
    parser.add_argument("--images", action="store_true")
    parser.add_argument("--copy-from", type=long, default=None)
    parser.add_argument("--copy-type", default="Image")
    parser.add_argument("--copy-to", type=long, default=None)
    parser.add_argument("screen", nargs="?")
    ns = parser.parse_args()

    cli = CLI()
    cli.loadplugins()
    client = cli.conn(ns)
    try:
        query = client.sf.getQueryService()
        if ns.orphans:
            orphans(query)
        elif ns.unknown:
            unknown(query)
        elif ns.search:
            search = client.sf.createSearchService()
            check_search(query, search)
        elif not ns.screen:
            stat_screens(query)
        else:
            if ns.copy_to:
                copy(client, ns.copy_from, ns.copy_type, ns.copy_to)
            else:
                for x in stat_plates(query, ns.screen, ns.images):
                    print x
    finally:
        cli.close()
Exemple #5
0
def main():
    parser = Parser()
    parser.add_login_arguments()
    parser.add_argument("--orphans", action="store_true")
    parser.add_argument("--unknown", action="store_true")
    parser.add_argument("--search", action="store_true")
    parser.add_argument("--images", action="store_true")
    parser.add_argument("--copy-from", type=long, default=None)
    parser.add_argument("--copy-type", default="Image")
    parser.add_argument("--copy-to", type=long, default=None)
    parser.add_argument("screen", nargs="?")
    ns = parser.parse_args()

    cli = CLI()
    cli.loadplugins()
    client = cli.conn(ns)
    try:
        query = client.sf.getQueryService()
        if ns.orphans:
            orphans(query)
        elif ns.unknown:
            unknown(query)
        elif ns.search:
            search = client.sf.createSearchService()
            check_search(query, search)
        elif not ns.screen:
            stat_screens(query)
        else:
            if ns.copy_to:
                copy(client, ns.copy_from, ns.copy_type, ns.copy_to)
            else:
                for x in stat_plates(query, ns.screen, ns.images):
                    print x
    finally:
        cli.close()
Exemple #6
0
def main():
    parser = Parser()
    parser.add_login_arguments()
    parser.add_argument("--orphans", action="store_true")
    parser.add_argument("--unknown", action="store_true")
    parser.add_argument("--search", action="store_true")
    parser.add_argument("--images", action="store_true")
    parser.add_argument("--release",
                        default="TODO",
                        help="The name of the release, e.g. 'prod88'")
    parser.add_argument(
        "--disable-fsusage",
        action="store_true",
        help=("Disable fs usage file size and counts. "
              "Use this flag if the script is taking too long."))
    parser.add_argument(
        "--format",
        default="tsv",
        help=(
            "Output format, includes 'string', 'csv', 'tsv' (default), and "
            "'json'. "
            "'tsv' can be appended to the IDR studies.csv file with no further "
            "processing. "
            "All other formats include headers and totals. "
            "'string' is the most human readable (fixed width columns). "))
    parser.add_argument("studies",
                        nargs='*',
                        help="Studies to be processed, default all (idr*)")
    parser.add_argument('-v', '--verbose', action='count', default=0)
    ns = parser.parse_args()

    levels = [logging.WARNING, logging.INFO, logging.DEBUG]
    level = levels[min(len(levels) - 1, ns.verbose)]
    logging.basicConfig(level=level,
                        format="%(asctime)s %(levelname)s %(message)s")

    cli = CLI()
    cli.loadplugins()
    client = cli.conn(ns)
    try:
        query = client.sf.getQueryService()
        if ns.orphans:
            orphans(query)
        elif ns.unknown:
            unknown(query, ns.studies)
        elif ns.search:
            search = client.sf.createSearchService()
            check_search(query, search)
        else:
            df = stat_top_level(client,
                                ns.studies,
                                release=ns.release,
                                fsusage=(not ns.disable_fsusage),
                                append_totals=(ns.format != 'tsv'))
            print_stats(df, ns.format)
    finally:
        cli.close()