commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/088960e4d379/ changeset: 088960e4d379 user: Kyle Ellrott date: 2012-11-30 19:58:39 summary: Patch to make extended_metadata loader work better, and fixing library loader to catch non-ascii errors affected #: 2 files diff -r 88aba66bb81351cbd625ca7fb9ed39874016b36a -r 088960e4d3793d473ac0b657215a3336c9f1d263 lib/galaxy/webapps/galaxy/api/library_contents.py --- a/lib/galaxy/webapps/galaxy/api/library_contents.py +++ b/lib/galaxy/webapps/galaxy/api/library_contents.py @@ -181,7 +181,7 @@ else: #BUG: Everything is cast to string, which can lead to false positives #for cross type comparisions, ie "True" == True - yield prefix, str(meta) + yield prefix, ("%s" % (meta)).encode("utf8", errors='replace') @web.expose_api def update( self, trans, id, library_id, payload, **kwd ): diff -r 88aba66bb81351cbd625ca7fb9ed39874016b36a -r 088960e4d3793d473ac0b657215a3336c9f1d263 scripts/api/load_data_with_metadata.py --- a/scripts/api/load_data_with_metadata.py +++ b/scripts/api/load_data_with_metadata.py @@ -6,7 +6,7 @@ system in the library Sample call: -python load_data_with_metadata.py <api_key><api_url> /tmp/g_inbox/ /tmp/g_inbox/done/ "API Imports" +python load_data_with_metadata.py <api_key><api_url> /data/folder "API Imports" NOTE: The upload method used requires the data library filesystem upload allow_library_path_paste """ @@ -18,7 +18,7 @@ sys.path.insert( 0, os.path.dirname( __file__ ) ) from common import submit, display -def main(api_key, api_url, in_folder, out_folder, data_library): +def main(api_key, api_url, in_folder, data_library): # Find/Create data library with the above name. Assume we're putting datasets in the root folder '/' libs = display(api_key, api_url + 'libraries', return_formatted=False) library_id = None @@ -36,11 +36,11 @@ if not library_id or not library_folder_id: print "Failure to configure library destination." sys.exit(1) - # Watch in_folder, upload anything that shows up there to data library and get ldda, - # invoke workflow, move file to out_folder. + for fname in os.listdir(in_folder): fullpath = os.path.join(in_folder, fname) if os.path.isfile(fullpath) and os.path.exists(fullpath + ".json"): + print "Loading", fullpath data = {} data['folder_id'] = library_folder_id data['file_type'] = 'auto' @@ -49,6 +49,8 @@ data['filesystem_paths'] = fullpath data['create_type'] = 'file' + data['link_data_only'] = 'link_to_files' + handle = open( fullpath + ".json" ) smeta = handle.read() handle.close() @@ -61,10 +63,9 @@ api_key = sys.argv[1] api_url = sys.argv[2] in_folder = sys.argv[3] - out_folder = sys.argv[4] - data_library = sys.argv[5] + data_library = sys.argv[4] except IndexError: - print 'usage: %s key url in_folder out_folder data_library' % os.path.basename( sys.argv[0] ) + print 'usage: %s key url in_folder data_library' % os.path.basename( sys.argv[0] ) sys.exit( 1 ) - main(api_key, api_url, in_folder, out_folder, data_library ) + main(api_key, api_url, in_folder, data_library ) https://bitbucket.org/galaxy/galaxy-central/changeset/0c1f8a06eb56/ changeset: 0c1f8a06eb56 user: dannon date: 2012-12-04 15:07:31 summary: Merged in kellrott/galaxy-central (pull request #90) affected #: 2 files diff -r 89deda81b0c949de68941f37e77c4c55097199f0 -r 0c1f8a06eb563f312d5e90818b34358430c6edf9 lib/galaxy/webapps/galaxy/api/library_contents.py --- a/lib/galaxy/webapps/galaxy/api/library_contents.py +++ b/lib/galaxy/webapps/galaxy/api/library_contents.py @@ -181,7 +181,7 @@ else: #BUG: Everything is cast to string, which can lead to false positives #for cross type comparisions, ie "True" == True - yield prefix, str(meta) + yield prefix, ("%s" % (meta)).encode("utf8", errors='replace') @web.expose_api def update( self, trans, id, library_id, payload, **kwd ): diff -r 89deda81b0c949de68941f37e77c4c55097199f0 -r 0c1f8a06eb563f312d5e90818b34358430c6edf9 scripts/api/load_data_with_metadata.py --- a/scripts/api/load_data_with_metadata.py +++ b/scripts/api/load_data_with_metadata.py @@ -6,7 +6,7 @@ system in the library Sample call: -python load_data_with_metadata.py <api_key><api_url> /tmp/g_inbox/ /tmp/g_inbox/done/ "API Imports" +python load_data_with_metadata.py <api_key><api_url> /data/folder "API Imports" NOTE: The upload method used requires the data library filesystem upload allow_library_path_paste """ @@ -18,7 +18,7 @@ sys.path.insert( 0, os.path.dirname( __file__ ) ) from common import submit, display -def main(api_key, api_url, in_folder, out_folder, data_library): +def main(api_key, api_url, in_folder, data_library): # Find/Create data library with the above name. Assume we're putting datasets in the root folder '/' libs = display(api_key, api_url + 'libraries', return_formatted=False) library_id = None @@ -36,11 +36,11 @@ if not library_id or not library_folder_id: print "Failure to configure library destination." sys.exit(1) - # Watch in_folder, upload anything that shows up there to data library and get ldda, - # invoke workflow, move file to out_folder. + for fname in os.listdir(in_folder): fullpath = os.path.join(in_folder, fname) if os.path.isfile(fullpath) and os.path.exists(fullpath + ".json"): + print "Loading", fullpath data = {} data['folder_id'] = library_folder_id data['file_type'] = 'auto' @@ -49,6 +49,8 @@ data['filesystem_paths'] = fullpath data['create_type'] = 'file' + data['link_data_only'] = 'link_to_files' + handle = open( fullpath + ".json" ) smeta = handle.read() handle.close() @@ -61,10 +63,9 @@ api_key = sys.argv[1] api_url = sys.argv[2] in_folder = sys.argv[3] - out_folder = sys.argv[4] - data_library = sys.argv[5] + data_library = sys.argv[4] except IndexError: - print 'usage: %s key url in_folder out_folder data_library' % os.path.basename( sys.argv[0] ) + print 'usage: %s key url in_folder data_library' % os.path.basename( sys.argv[0] ) sys.exit( 1 ) - main(api_key, api_url, in_folder, out_folder, data_library ) + main(api_key, api_url, in_folder, data_library ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket