comparison list_organisms.py @ 10:dca2fb399ee6 draft

"planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/apollo commit 08015be1ee8a784e0619f961aaa724857debfd6f"
author gga
date Mon, 02 Dec 2019 05:45:36 -0500
parents 1a2976c6b161
children
comparison
equal deleted inserted replaced
9:d8bb1f9b85b2 10:dca2fb399ee6
2 from __future__ import print_function 2 from __future__ import print_function
3 3
4 import argparse 4 import argparse
5 import json 5 import json
6 6
7 from webapollo import WAAuth, WebApolloInstance, accessible_organisms 7 from apollo import accessible_organisms
8
9 from arrow.apollo import get_apollo_instance
10
11 from webapollo import UserObj, handle_credentials
8 12
9 if __name__ == '__main__': 13 if __name__ == '__main__':
10 parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance') 14 parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance')
11 WAAuth(parser)
12 parser.add_argument('email', help='User Email') 15 parser.add_argument('email', help='User Email')
13 args = parser.parse_args() 16 args = parser.parse_args()
14 17
15 wa = WebApolloInstance(args.apollo, args.username, args.password) 18 wa = get_apollo_instance()
16 19
17 gx_user = wa.users.assertOrCreateUser(args.email) 20 gx_user = UserObj(**wa.users._assert_or_create_user(args.email))
21 handle_credentials(gx_user)
18 22
19 all_orgs = wa.organisms.findAllOrganisms() 23 all_orgs = wa.organisms.get_organisms()
20 24
21 orgs = accessible_organisms(gx_user, all_orgs) 25 orgs = accessible_organisms(gx_user, all_orgs)
22 26
23 print(json.dumps(orgs, indent=2)) 27 print(json.dumps(orgs, indent=2))