diff list_organisms.py @ 10:a46a509386d3 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:50:13 -0500
parents 356b43302b16
children
line wrap: on
line diff
--- a/list_organisms.py	Mon Jul 29 10:10:43 2019 -0400
+++ b/list_organisms.py	Mon Dec 02 05:50:13 2019 -0500
@@ -4,19 +4,23 @@
 import argparse
 import json
 
-from webapollo import WAAuth, WebApolloInstance, accessible_organisms
+from apollo import accessible_organisms
+
+from arrow.apollo import get_apollo_instance
+
+from webapollo import UserObj, handle_credentials
 
 if __name__ == '__main__':
     parser = argparse.ArgumentParser(description='List all organisms available in an Apollo instance')
-    WAAuth(parser)
     parser.add_argument('email', help='User Email')
     args = parser.parse_args()
 
-    wa = WebApolloInstance(args.apollo, args.username, args.password)
+    wa = get_apollo_instance()
 
-    gx_user = wa.users.assertOrCreateUser(args.email)
+    gx_user = UserObj(**wa.users._assert_or_create_user(args.email))
+    handle_credentials(gx_user)
 
-    all_orgs = wa.organisms.findAllOrganisms()
+    all_orgs = wa.organisms.get_organisms()
 
     orgs = accessible_organisms(gx_user, all_orgs)