kwargs['offset'] = args.offset # SET UP FILETYPE AND GET FILE NAME IN ARGS.FILE_NAME # -f (default) if args.file_name is not '' or args.jobfile_name is '': if args.file_name is None or '': args.file_name = vdjpy.prompt_user('file name') filetype = 'projectFile' # -j (only if flag given) else: if args.jobfile_name is None: args.jobfile_name = vdjpy.prompt_user('jobfile name') filetype = 'projectJobFile' args.file_name = args.jobfile_name # get metadata for extra path; exit if file not found project_files = vdjpy.get_project_files(project_uuid, filetype, {}, my_agave) file_metadata = vdjpy.get_file_metadata(project_files, args.file_name) if file_metadata is None: sys.exit() # if jobfile, get extra path; then build file path extra_path = '' if filetype == 'projectJobFile': extra_path += str(file_metadata['value']['relativeArchivePath']) + '/' kwargs['filePath'] = vdjpy.build_vdj_path(project_uuid, args.file_name, filetype, extra_path) # list permissions permissions = my_agave.files.listPermissions(**kwargs) # if -v if args.verbose:
if args.offset is None: args.offset = vdjpy.prompt_for_integer('offset value', 0) kwargs['offset'] = args.offset # SET UP FILETYPE # -f if args.projectfile is not '' and args.jobfile is '': filetype = 'projectFile' # -j elif args.jobfile is not '' and args.projectfile is '': filetype = 'projectJobFile' else: filetype = None # get files for metadata files = vdjpy.get_project_files(project_uuid, filetype, kwargs, my_agave) # filter to one file if name specified; quit if file not found if filetype == 'projectFile' and args.projectfile is not None: files = vdjpy.get_file_metadata(files, args.projectfile) elif filetype == 'projectJobFile' and args.jobfile is not None: files = vdjpy.get_file_metadata(files, args.jobfile) if files is None: sys.exit() # if -v or specific file given if args.verbose is True or type(files) is not list: print json.dumps(files, default = vdjpy.json_serial, sort_keys = True, indent = 4, separators = (',', ': ')) # if no -v and files is a list else: