Ejemplo n.º 1
0
    print "   ID:", user.getId()
    print "   Username:"******"   Full Name:", user.getFullName()

    if( args.group is not None ):
        print("change group")
        new_group = args.group
        groups = [ g.getName() for g in conn.listGroups() ]
        print(groups)
        if( new_group not in groups ):
            print("{} not found in groups:".format(new_group))
            for gn in groups:
                print("    {}".format(gn))
            sys.exit(1)
        else:
            conn.setGroupNameForSession(group)
    print conn.getGroupFromContext().getName()
    path    = os.getcwd()

    mdict= setup_dict()

    def package_file( mdict,conn, group, Id, path, name ):
        print "processing {} {} as : {}/{}".format(group,Id,path,name)
        groups = [ g.getName() for g in conn.listGroups() ]
        if( group not in groups ):
            print "    no group found"
            return
        if( group != conn.getGroupFromContext().getName() ):
            conn.setGroupNameForSession(group)

        download_file(    conn, Id, path, name )
Ejemplo n.º 2
0
    print "   ID:", user.getId()
    print "   Username:"******"   Full Name:", user.getFullName()

    if( args.group is not None ):
        print("change group")
        new_group = args.group
        groups = [ g.getName() for g in conn.listGroups() ]
        print(groups)
        if( new_group not in groups ):
            print("{} not found in groups:".format(new_group))
            for gn in groups:
                print("    {}".format(gn))
            sys.exit(1)
        else:
            conn.setGroupNameForSession(new_group)
   
    path    = os.getcwd()
    print( args.dataset )
    for d_id in args.dataset:
        download_dataset( conn, d_id, path, orig=args.orig, tif=args.tif )

    print(args.project)
    for p_id in args.project:
        project = conn.getObject('Project',p_id)
        path_p = os.path.join(path,project.getName())
        if( project==None ):
            print("project ID {} not found in group {}".format(p_id, orig=args.orig, tif=args.tif))
            sys.exit(1)

        for ds in list(project.listChildren()):