[hg] galaxy 2453: Fixes and functional tests for uploading direc...
details: http://www.bx.psu.edu/hg/galaxy/rev/e899101e63d1 changeset: 2453:e899101e63d1 user: Greg Von Kuster <greg@bx.psu.edu> date: Tue Jun 16 09:55:15 2009 -0400 description: Fixes and functional tests for uploading directories of files from both the Admin view and the Libraries view ( requires new config setting ). In addition to the config setting "library_import_dir" for the Admin view, the new config setting "user_library_import_dir" for the Libraries view will allow non-amin users to upload a directory of files. The configured directory must contain sub-directories named the same as the non-admin user's Galaxy login ( email ). The non-admin user is restricted to uploading files or sub-directories of files contained in their directoy. 10 file(s) affected in this change: lib/galaxy/config.py lib/galaxy/web/controllers/library_dataset.py templates/admin/library/new_dataset.mako templates/library/new_dataset.mako test-data/users/test1@bx.psu.edu/1.fasta test-data/users/test3@bx.psu.edu/run1/2.fasta test/base/twilltestcase.py test/functional/__init__.py test/functional/test_security_and_libraries.py universe_wsgi.ini.sample diffs (1056 lines): diff -r c44567359a03 -r e899101e63d1 lib/galaxy/config.py --- a/lib/galaxy/config.py Fri Jun 12 09:56:23 2009 -0400 +++ b/lib/galaxy/config.py Tue Jun 16 09:55:15 2009 -0400 @@ -81,6 +81,9 @@ self.library_import_dir = kwargs.get( 'library_import_dir', None ) if self.library_import_dir is not None and not os.path.exists( self.library_import_dir ): raise ConfigurationError( "library_import_dir specified in config (%s) does not exist" % self.library_import_dir ) + self.user_library_import_dir = kwargs.get( 'user_library_import_dir', None ) + if self.user_library_import_dir is not None and not os.path.exists( self.user_library_import_dir ): + raise ConfigurationError( "user_library_import_dir specified in config (%s) does not exist" % self.user_library_import_dir ) # Configuration options for taking advantage of nginx features self.nginx_x_accel_redirect_base = kwargs.get( 'nginx_x_accel_redirect_base', False ) self.nginx_upload_location = kwargs.get( 'nginx_upload_store', False ) diff -r c44567359a03 -r e899101e63d1 lib/galaxy/web/controllers/library_dataset.py --- a/lib/galaxy/web/controllers/library_dataset.py Fri Jun 12 09:56:23 2009 -0400 +++ b/lib/galaxy/web/controllers/library_dataset.py Tue Jun 16 09:55:15 2009 -0400 @@ -1,4 +1,4 @@ -import os, shutil, urllib, StringIO, re, gzip, tempfile, shutil, zipfile +import os, os.path, shutil, urllib, StringIO, re, gzip, tempfile, shutil, zipfile from galaxy.web.base.controller import * from galaxy import util, jobs from galaxy.datatypes import sniff @@ -193,7 +193,7 @@ file_format = params.get( 'file_format', 'auto' ) data_file = params.get( 'file_data', '' ) url_paste = params.get( 'url_paste', '' ) - server_dir = params.get( 'server_dir', None ) + server_dir = util.restore_text( params.get( 'server_dir', '' ) ) if replace_dataset is not None: replace_id = replace_dataset.id else: @@ -222,10 +222,17 @@ elif upload_option == 'upload_directory': if server_dir in [ None, 'None', '' ]: err_redirect = True - if trans.app.config.library_import_dir: - msg = 'Select a server directory' - else: - msg = '"library_import_dir" is not defined in the Galaxy configuration file' + # See if our request is from the Admin view or the Libraries view + if trans.request.browser_url.find( 'admin' ) >= 0: + import_dir = trans.app.config.library_import_dir + import_dir_desc = 'library_import_dir' + else: + import_dir = trans.app.config.user_library_import_dir + import_dir_desc = 'user_library_import_dir' + if import_dir: + msg = 'Select a directory' + else: + msg = '"%s" is not defined in the Galaxy configuration file' % import_dir_desc if err_redirect: trans.response.send_redirect( web.url_for( controller=controller, action='library_dataset_dataset_association', @@ -264,7 +271,7 @@ created_ldda_ids = str( created_ldda.id ) except Exception, e: log.exception( 'exception in upload_dataset using file_name %s: %s' % ( str( file_name ), str( e ) ) ) - return self.upload_empty( trans, controller, library_id, "Error:", str( e ) ) + return self.upload_empty( trans, controller, library_id, folder_id, "Error:", str( e ) ) elif url_paste not in [ None, "" ]: if url_paste.lower().find( 'http://' ) >= 0 or url_paste.lower().find( 'ftp://' ) >= 0: url_paste = url_paste.replace( '\r', '' ).split( '\n' ) @@ -292,7 +299,7 @@ created_ldda_ids = '%s,%s' % ( created_ldda_ids, str( created_ldda.id ) ) except Exception, e: log.exception( 'exception in upload_dataset using url_paste %s' % str( e ) ) - return self.upload_empty( trans, controller, library_id, "Error:", str( e ) ) + return self.upload_empty( trans, controller, library_id, folder_id, "Error:", str( e ) ) else: is_valid = False for line in url_paste: @@ -318,13 +325,36 @@ created_ldda_ids = '%s,%s' % ( created_ldda_ids, str( created_ldda.id ) ) except Exception, e: log.exception( 'exception in add_file using StringIO.StringIO( url_paste ) %s' % str( e ) ) - return self.upload_empty( trans, controller, library_id, "Error:", str( e ) ) + return self.upload_empty( trans, controller, library_id, folder_id, "Error:", str( e ) ) elif server_dir not in [ None, "", "None" ]: - full_dir = os.path.join( trans.app.config.library_import_dir, server_dir ) + # See if our request is from the Admin view or the Libraries view + if trans.request.browser_url.find( 'admin' ) >= 0: + import_dir = trans.app.config.library_import_dir + import_dir_desc = 'library_import_dir' + full_dir = os.path.join( import_dir, server_dir ) + else: + imrport_dir = trans.app.config.user_library_import_dir + import_dir_desc = 'user_library_import_dir' + # From the Libraries view, users are restricted to the directory named the same as + # their email within the configured user_library_import_dir. If this directory contains + # sub-directories, server_dir will be the name of the selected sub-directory. Otherwise + # server_dir will be the user's email address. + if server_dir == trans.user.email: + full_dir = os.path.join( import_dir, server_dir ) + else: + full_dir = os.path.join( import_dir, trans.user.email, server_dir ) + files = [] try: - files = os.listdir( full_dir ) - except: - log.debug( "Unable to get file list for configured library_import_dir %s" % full_dir ) + for entry in os.listdir( full_dir ): + # Only import regular files + if os.path.isfile( os.path.join( full_dir, entry ) ): + files.append( entry ) + except Exception, e: + msg = "Unable to get file list for configured %s, error: %s" % ( import_dir_desc, str( e ) ) + return self.upload_empty( trans, controller, library_id, folder_id, "Error:", msg ) + if not files: + msg = "The directory '%s' contains no valid files" % full_dir + return self.upload_empty( trans, controller, library_id, folder_id, "Error:", msg ) for file in files: full_file = os.path.join( full_dir, file ) if not os.path.isfile( full_file ): @@ -346,7 +376,7 @@ created_ldda_ids = '%s,%s' % ( created_ldda_ids, str( created_ldda.id ) ) except Exception, e: log.exception( 'exception in add_file using server_dir %s' % str( e ) ) - return self.upload_empty( trans, controller, library_id, "Error:", str( e ) ) + return self.upload_empty( trans, controller, library_id, folder_id, "Error:", str( e ) ) if created_ldda_ids: created_ldda_ids = created_ldda_ids.lstrip( ',' ) return created_ldda_ids @@ -425,11 +455,12 @@ if chunk is None: temp.close() return False - def upload_empty( self, trans, controller, library_id, err_code, err_msg ): + def upload_empty( self, trans, controller, library_id, folder_id, err_code, err_msg ): msg = err_code + err_msg return trans.response.send_redirect( web.url_for( controller=controller, - action='browse_library', - id=library_id, + action='library_dataset_dataset_association', + library_id=library_id, + folder_id=folder_id, msg=util.sanitize_text( msg ), messagetype='error' ) ) class BadFileException( Exception ): diff -r c44567359a03 -r e899101e63d1 templates/admin/library/new_dataset.mako --- a/templates/admin/library/new_dataset.mako Fri Jun 12 09:56:23 2009 -0400 +++ b/templates/admin/library/new_dataset.mako Tue Jun 16 09:55:15 2009 -0400 @@ -2,13 +2,15 @@ <%namespace file="/message.mako" import="render_msg" /> <%namespace file="/admin/library/common.mako" import="render_available_templates" /> -<% import os %> +<% import os, os.path %> <b>Create new library datasets</b> <a id="upload-librarydataset--popup" class="popup-arrow" style="display: none;">▼</a> <div popupmenu="upload-librarydataset--popup"> <a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_file' )}">Upload files</a> - <a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_directory' )}">Upload directory of files</a> + %if trans.app.config.library_import_dir and os.path.exists( trans.app.config.library_import_dir ): + <a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_directory' )}">Upload directory of files</a> + %endif <a class="action-button" href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='import_from_history' )}">Import datasets from your current history</a> </div> <br/><br/> @@ -26,135 +28,149 @@ <div class="toolForm" id="new_dataset"> %if upload_option == 'upload_file': <div class="toolFormTitle">Upload files</div> - %elif upload_option == 'upload_directory': + %else: <div class="toolFormTitle">Upload a directory of files</div> %endif - %if upload_option == 'upload_directory' and not trans.app.config.library_import_dir: - <p/> - "library_import_dir" is not defined in the Galaxy configuration file - <p/> - %else: - <div class="toolFormBody"> - <form name="tool_form" action="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id )}" enctype="multipart/form-data" method="post"> - <input type="hidden" name="folder_id" value="${folder_id}"/> - <input type="hidden" name="upload_option" value="${upload_option}"/> - %if replace_dataset: - <input type="hidden" name="replace_id" value="${replace_dataset.id}"/> - <div class="form-row"> - You are currently selecting a new file to replace '<a href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, id=replace_dataset.library_dataset_dataset_association.id )}">${replace_dataset.name}</a>'. - <div style="clear: both"></div> - </div> - %endif - %if upload_option == 'upload_file': - <div class="form-row"> - <label>File:</label> - <div style="float: left; width: 250px; margin-right: 10px;"> - <input type="file" name="file_data"/> - </div> - <div style="clear: both"></div> - </div> - <div class="form-row"> - <label>URL/Text:</label> - <div style="float: left; width: 250px; margin-right: 10px;"> - <textarea name="url_paste" rows="5" cols="35"></textarea> - </div> - <div class="toolParamHelp" style="clear: both;"> - Specify a list of URLs (one per line) or paste the contents of a file. - </div> - <div style="clear: both"></div> - </div> - %elif upload_option == 'upload_directory': - <div class="form-row"> - <label>Server Directory</label> - <div style="float: left; width: 250px; margin-right: 10px;"> - <select name="server_dir"> - <option>None</option> - %for dir in os.listdir( trans.app.config.library_import_dir ): - <option>${dir}</option> - %endfor - </select> - </div> - <div class="toolParamHelp" style="clear: both;"> - Upload all files in a subdirectory of <strong>${trans.app.config.library_import_dir}</strong> on the Galaxy server. - </div> - <div style="clear: both"></div> - </div> - %endif + <div class="toolFormBody"> + <form name="tool_form" action="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id )}" enctype="multipart/form-data" method="post"> + <input type="hidden" name="folder_id" value="${folder_id}"/> + <input type="hidden" name="upload_option" value="${upload_option}"/> + %if replace_dataset: + <input type="hidden" name="replace_id" value="${replace_dataset.id}"/> <div class="form-row"> - <label>Convert spaces to tabs:</label> + You are currently selecting a new file to replace '<a href="${h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, id=replace_dataset.library_dataset_dataset_association.id )}">${replace_dataset.name}</a>'. + <div style="clear: both"></div> + </div> + %endif + %if upload_option == 'upload_file': + <div class="form-row"> + <label>File:</label> <div style="float: left; width: 250px; margin-right: 10px;"> - <div> - <input type="checkbox" name="space_to_tab" value="Yes"/>Yes - </div> - </div> - <div class="toolParamHelp" style="clear: both;"> - Use this option if you are manually entering intervals. + <input type="file" name="file_data"/> </div> <div style="clear: both"></div> </div> <div class="form-row"> - <label>File Format:</label> + <label>URL/Text:</label> <div style="float: left; width: 250px; margin-right: 10px;"> - <select name="file_format"> - <option value="auto" selected>Auto-detect</option> - %for file_format in file_formats: - <option value="${file_format}">${file_format}</option> - %endfor - </select> + <textarea name="url_paste" rows="5" cols="35"></textarea> + </div> + <div class="toolParamHelp" style="clear: both;"> + Specify a list of URLs (one per line) or paste the contents of a file. </div> <div style="clear: both"></div> </div> + %elif upload_option == 'upload_directory': <div class="form-row"> - <label>Genome:</label> + <% + # See if we have any contained sub-directories, if not the only option + # in the server_dir select list will be library_import_dir + contains_directories = False + for entry in os.listdir( trans.app.config.library_import_dir ): + if os.path.isdir( os.path.join( trans.app.config.library_import_dir, entry ) ): + contains_directories = True + break + %> + <label>Server Directory</label> <div style="float: left; width: 250px; margin-right: 10px;"> - <select name="dbkey"> - %for dbkey in dbkeys: - %if dbkey[1] == last_used_build: - <option value="${dbkey[1]}" selected>${dbkey[0]}</option> - %else: - <option value="${dbkey[1]}">${dbkey[0]}</option> - %endif - %endfor + <select name="server_dir"> + %if contains_directories: + <option>None</option> + %for entry in os.listdir( trans.app.config.library_import_dir ): + ## Do not include entries that are not directories + %if os.path.isdir( os.path.join( trans.app.config.library_import_dir, entry ) ): + <option>${entry}</option> + %endif + %endfor + %else: + <option>${trans.app.config.library_import_dir}</option> + %endif </select> + </div> + <div class="toolParamHelp" style="clear: both;"> + %if contains_directories: + Upload all files in a sub-directory of <strong>${trans.app.config.library_import_dir}</strong> on the Galaxy server. + %else: + Upload all files in <strong>${trans.app.config.library_import_dir}</strong> on the Galaxy server. + %endif </div> <div style="clear: both"></div> </div> - <div class="form-row"> - <label>Message:</label> - <div style="float: left; width: 250px; margin-right: 10px;"> - <textarea name="message" rows="3" cols="35"></textarea> - </div> - <div class="toolParamHelp" style="clear: both;"> - This information will be displayed in the "Information" column for this dataset in the library browser - </div> - <div style="clear: both"></div> - </div> - <div class="form-row"> - <div style="float: left; width: 250px; margin-right: 10px;"> - <label>Restrict dataset access to specific roles:</label> - <select name="roles" multiple="true" size="5"> - %for role in roles: - <option value="${role.id}">${role.name}</option> - %endfor - </select> - </div> - <div class="toolParamHelp" style="clear: both;"> - Multi-select list - hold the appropriate key while clicking to select multiple roles. More restrictions can be applied after the upload is complete. Selecting no roles makes a dataset public. + %endif + <div class="form-row"> + <label>Convert spaces to tabs:</label> + <div style="float: left; width: 250px; margin-right: 10px;"> + <div> + <input type="checkbox" name="space_to_tab" value="Yes"/>Yes </div> </div> + <div class="toolParamHelp" style="clear: both;"> + Use this option if you are manually entering intervals. + </div> <div style="clear: both"></div> - <% folder = trans.app.model.LibraryFolder.get( folder_id ) %> - %if folder.library_folder_info_template_associations: - ${render_available_templates( folder, library_id, restrict=True, upload=True )} - %else: - ${render_available_templates( folder, library_id, restrict=False, upload=True )} - %endif - <div class="form-row"> - <input type="submit" class="primary-button" name="new_dataset_button" value="Upload to library"/> + </div> + <div class="form-row"> + <label>File Format:</label> + <div style="float: left; width: 250px; margin-right: 10px;"> + <select name="file_format"> + <option value="auto" selected>Auto-detect</option> + %for file_format in file_formats: + <option value="${file_format}">${file_format}</option> + %endfor + </select> </div> - </form> - </div> - %endif + <div style="clear: both"></div> + </div> + <div class="form-row"> + <label>Genome:</label> + <div style="float: left; width: 250px; margin-right: 10px;"> + <select name="dbkey"> + %for dbkey in dbkeys: + %if dbkey[1] == last_used_build: + <option value="${dbkey[1]}" selected>${dbkey[0]}</option> + %else: + <option value="${dbkey[1]}">${dbkey[0]}</option> + %endif + %endfor + </select> + </div> + <div style="clear: both"></div> + </div> + <div class="form-row"> + <label>Message:</label> + <div style="float: left; width: 250px; margin-right: 10px;"> + <textarea name="message" rows="3" cols="35"></textarea> + </div> + <div class="toolParamHelp" style="clear: both;"> + This information will be displayed in the "Information" column for this dataset in the library browser + </div> + <div style="clear: both"></div> + </div> + <div class="form-row"> + <div style="float: left; width: 250px; margin-right: 10px;"> + <label>Restrict dataset access to specific roles:</label> + <select name="roles" multiple="true" size="5"> + %for role in roles: + <option value="${role.id}">${role.name}</option> + %endfor + </select> + </div> + <div class="toolParamHelp" style="clear: both;"> + Multi-select list - hold the appropriate key while clicking to select multiple roles. More restrictions can be applied after the upload is complete. Selecting no roles makes a dataset public. + </div> + </div> + <div style="clear: both"></div> + <% folder = trans.app.model.LibraryFolder.get( folder_id ) %> + %if folder.library_folder_info_template_associations: + ${render_available_templates( folder, library_id, restrict=True, upload=True )} + %else: + ${render_available_templates( folder, library_id, restrict=False, upload=True )} + %endif + <div class="form-row"> + <input type="submit" class="primary-button" name="new_dataset_button" value="Upload to library"/> + </div> + </form> + </div> </div> %elif upload_option == 'import_from_history': <div class="toolForm"> diff -r c44567359a03 -r e899101e63d1 templates/library/new_dataset.mako --- a/templates/library/new_dataset.mako Fri Jun 12 09:56:23 2009 -0400 +++ b/templates/library/new_dataset.mako Tue Jun 16 09:55:15 2009 -0400 @@ -2,13 +2,15 @@ <%namespace file="/message.mako" import="render_msg" /> <%namespace file="/library/common.mako" import="render_available_templates" /> -<% import os %> +<% import os, os.path %> <b>Create new library datasets</b> <a id="upload-librarydataset--popup" class="popup-arrow" style="display: none;">▼</a> <div popupmenu="upload-librarydataset--popup"> <a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_file' )}">Upload files</a> - <a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_directory' )}">Upload directory of files</a> + %if trans.app.config.user_library_import_dir and os.path.exists( os.path.join( trans.app.config.user_library_import_dir, trans.user.email ) ): + <a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_directory' )}">Upload directory of files</a> + %endif <a class="action-button" href="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='import_from_history' )}">Import datasets from your current history</a> </div> <br/><br/> @@ -31,135 +33,153 @@ <div class="toolForm" id="new_dataset"> %if upload_option == 'upload_file': <div class="toolFormTitle">Upload files</div> - %elif upload_option == 'upload_directory': + %else: <div class="toolFormTitle">Upload a directory of files</div> %endif - %if upload_option == 'upload_directory' and not trans.app.config.library_import_dir: - <p/> - "library_import_dir" is not defined in the Galaxy configuration file - <p/> - %else: - <div class="toolFormBody"> - <form name="tool_form" action="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id )}" enctype="multipart/form-data" method="post"> - <input type="hidden" name="folder_id" value="${folder_id}"/> - <input type="hidden" name="upload_option" value="${upload_option}"/> - %if replace_dataset: - <input type="hidden" name="replace_id" value="${replace_dataset.id}"/> - <div class="form-row"> - You are currently selecting a new file to replace '<a href="${h.url_for( controller='library', action='library_dataset', id=replace_dataset.id )}">${replace_dataset.name}</a>'. - <div style="clear: both"></div> - </div> - %endif - %if upload_option == 'upload_file': - <div class="form-row"> - <label>File:</label> - <div style="float: left; width: 250px; margin-right: 10px;"> - <input type="file" name="file_data"/> - </div> - <div style="clear: both"></div> - </div> - <div class="form-row"> - <label>URL/Text:</label> - <div style="float: left; width: 250px; margin-right: 10px;"> - <textarea name="url_paste" rows="5" cols="35"></textarea> - </div> - <div class="toolParamHelp" style="clear: both;"> - Specify a list of URLs (one per line) or paste the contents of a file. - </div> - <div style="clear: both"></div> - </div> - %elif upload_option == 'upload_directory': - <div class="form-row"> - <label>Server Directory</label> - <div style="float: left; width: 250px; margin-right: 10px;"> - <select name="server_dir"> - <option>None</option> - %for dir in os.listdir( trans.app.config.library_import_dir ): - <option>${dir}</option> - %endfor - </select> - </div> - <div class="toolParamHelp" style="clear: both;"> - Upload all files in a subdirectory of <strong>${trans.app.config.library_import_dir}</strong> on the Galaxy server. - </div> - <div style="clear: both"></div> - </div> - %endif + <div class="toolFormBody"> + <form name="tool_form" action="${h.url_for( controller='library', action='library_dataset_dataset_association', library_id=library_id )}" enctype="multipart/form-data" method="post"> + <input type="hidden" name="folder_id" value="${folder_id}"/> + <input type="hidden" name="upload_option" value="${upload_option}"/> + %if replace_dataset: + <input type="hidden" name="replace_id" value="${replace_dataset.id}"/> <div class="form-row"> - <label>Convert spaces to tabs:</label> + You are currently selecting a new file to replace '<a href="${h.url_for( controller='library', action='library_dataset', id=replace_dataset.id )}">${replace_dataset.name}</a>'. + <div style="clear: both"></div> + </div> + %endif + %if upload_option == 'upload_file': + <div class="form-row"> + <label>File:</label> <div style="float: left; width: 250px; margin-right: 10px;"> - <div> - <input type="checkbox" name="space_to_tab" value="Yes"/>Yes - </div> - </div> - <div class="toolParamHelp" style="clear: both;"> - Use this option if you are manually entering intervals. + <input type="file" name="file_data"/> </div> <div style="clear: both"></div> </div> <div class="form-row"> - <label>File Format:</label> + <label>URL/Text:</label> <div style="float: left; width: 250px; margin-right: 10px;"> - <select name="file_format"> - <option value="auto" selected>Auto-detect</option> - %for file_format in file_formats: - <option value="${file_format}">${file_format}</option> - %endfor - </select> + <textarea name="url_paste" rows="5" cols="35"></textarea> + </div> + <div class="toolParamHelp" style="clear: both;"> + Specify a list of URLs (one per line) or paste the contents of a file. </div> <div style="clear: both"></div> </div> + %elif upload_option == 'upload_directory': <div class="form-row"> - <label>Genome:</label> + <% + # Directories of files from the Libraries view are restricted to a + # sub-directory named the same as the current user's email address + # contained within the configured setting for user_library_import_dir + user_library_import_dir = os.path.join( trans.app.config.user_library_import_dir, trans.user.email ) + # See if we have any contained sub-directories, if not the only option + # in the server_dir select list will be user_library_import_dir + contains_directories = False + for entry in os.listdir( user_library_import_dir ): + if os.path.isdir( os.path.join( user_library_import_dir, entry ) ): + contains_directories = True + break + %> + <label>Server Directory</label> <div style="float: left; width: 250px; margin-right: 10px;"> - <select name="dbkey"> - %for dbkey in dbkeys: - %if dbkey[1] == last_used_build: - <option value="${dbkey[1]}" selected>${dbkey[0]}</option> - %else: - <option value="${dbkey[1]}">${dbkey[0]}</option> - %endif - %endfor + <select name="server_dir"> + %if contains_directories: + <option>None</option> + %for entry in os.listdir( user_library_import_dir ): + ## Do not include entries that are not directories + %if os.path.isdir( os.path.join( user_library_import_dir, entry ) ): + <option>${entry}</option> + %endif + %endfor + %else: + <option>${trans.user.email}</option> + %endif </select> + </div> + <div class="toolParamHelp" style="clear: both;"> + %if contains_directories: + Upload all files in a subdirectory of <strong>${user_library_import_dir}}</strong> on the Galaxy server. + %else: + Upload all files in <strong>${user_library_import_dir}}</strong> on the Galaxy server. + %endif </div> <div style="clear: both"></div> </div> - <div class="form-row"> - <label>Message:</label> - <div style="float: left; width: 250px; margin-right: 10px;"> - <textarea name="message" rows="3" cols="35"></textarea> - </div> - <div class="toolParamHelp" style="clear: both;"> - This information will be displayed in the "Information" column for this dataset in the library browser - </div> - <div style="clear: both"></div> - </div> - <div class="form-row"> - <div style="float: left; width: 250px; margin-right: 10px;"> - <label>Restrict dataset access to specific roles:</label> - <select name="roles" multiple="true" size="5"> - %for role in roles: - <option value="${role.id}">${role.name}</option> - %endfor - </select> - </div> - <div class="toolParamHelp" style="clear: both;"> - Multi-select list - hold the appropriate key while clicking to select multiple roles. More restrictions can be applied after the upload is complete. Selecting no roles makes a dataset public. + %endif + <div class="form-row"> + <label>Convert spaces to tabs:</label> + <div style="float: left; width: 250px; margin-right: 10px;"> + <div> + <input type="checkbox" name="space_to_tab" value="Yes"/>Yes </div> </div> + <div class="toolParamHelp" style="clear: both;"> + Use this option if you are manually entering intervals. + </div> <div style="clear: both"></div> - <% folder = trans.app.model.LibraryFolder.get( folder_id ) %> - %if folder.library_folder_info_template_associations: - ${render_available_templates( folder, library_id, restrict=True, upload=True )} - %else: - ${render_available_templates( folder, library_id, restrict=False, upload=True )} - %endif - <div class="form-row"> - <input type="submit" class="primary-button" name="new_dataset_button" value="Upload to library"/> + </div> + <div class="form-row"> + <label>File Format:</label> + <div style="float: left; width: 250px; margin-right: 10px;"> + <select name="file_format"> + <option value="auto" selected>Auto-detect</option> + %for file_format in file_formats: + <option value="${file_format}">${file_format}</option> + %endfor + </select> </div> - </form> - </div> - %endif + <div style="clear: both"></div> + </div> + <div class="form-row"> + <label>Genome:</label> + <div style="float: left; width: 250px; margin-right: 10px;"> + <select name="dbkey"> + %for dbkey in dbkeys: + %if dbkey[1] == last_used_build: + <option value="${dbkey[1]}" selected>${dbkey[0]}</option> + %else: + <option value="${dbkey[1]}">${dbkey[0]}</option> + %endif + %endfor + </select> + </div> + <div style="clear: both"></div> + </div> + <div class="form-row"> + <label>Message:</label> + <div style="float: left; width: 250px; margin-right: 10px;"> + <textarea name="message" rows="3" cols="35"></textarea> + </div> + <div class="toolParamHelp" style="clear: both;"> + This information will be displayed in the "Information" column for this dataset in the library browser + </div> + <div style="clear: both"></div> + </div> + <div class="form-row"> + <div style="float: left; width: 250px; margin-right: 10px;"> + <label>Restrict dataset access to specific roles:</label> + <select name="roles" multiple="true" size="5"> + %for role in roles: + <option value="${role.id}">${role.name}</option> + %endfor + </select> + </div> + <div class="toolParamHelp" style="clear: both;"> + Multi-select list - hold the appropriate key while clicking to select multiple roles. More restrictions can be applied after the upload is complete. Selecting no roles makes a dataset public. + </div> + </div> + <div style="clear: both"></div> + <% folder = trans.app.model.LibraryFolder.get( folder_id ) %> + %if folder.library_folder_info_template_associations: + ${render_available_templates( folder, library_id, restrict=True, upload=True )} + %else: + ${render_available_templates( folder, library_id, restrict=False, upload=True )} + %endif + <div class="form-row"> + <input type="submit" class="primary-button" name="new_dataset_button" value="Upload to library"/> + </div> + </form> + </div> </div> %elif upload_option == 'import_from_history': <div class="toolForm"> diff -r c44567359a03 -r e899101e63d1 test-data/users/test1@bx.psu.edu/1.fasta --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/users/test1@bx.psu.edu/1.fasta Tue Jun 16 09:55:15 2009 -0400 @@ -0,0 +1,2 @@ +>hg17 +gtttgccatcttttgctgctctagggaatccagcagctgtcaccatgtaaacaagcccaggctagaccaGTTACCCTCATCATCTTAGCTGATAGCCAGCCAGCCACCACAGGCAtgagtcaggccatattgctggacccacagaattatgagctaaataaatagtcttgggttaagccactaagttttaggcatagtgtgttatgtaTCTCACAAACATATAAGACTGTGTGTTTGTTGACTGGAGGAAGAGATGCTATAAAGACCACCTTTTAAAACTTCCC-------------------------------AAATACT-GCCACTGATGTCCTG-----ATGGAGGTA-------TGAA-------------------AACATCCACTAAAATTTGTGGTTTATTCATTTTTCATTATTTTGTTTAAGGAGGTCTATAGTGGAAGAGGGAGATATTTGGggaaatt---ttgtatagactagctttcacgatgttagggaattattattgtgtgataatggtcttgcagttaca-cagaaattcttccttattttttgggaa---gcaccaaag----tagggat---aaaatgtcatgatgtgtgcaatacactttaaaatgtttttg-----ccaaaataatt----------------aatgaagc--aaatatggaaa-ataataattattaaatctaggtgatgggtatattgtagttcactatagtattgcacacttttctgtatgtttaaatttttcatttaaaaaaaaactttgagc-----tagacaccaggctatgagctaggagcatagcaatgaccaa----------------------------------------------------------------------------------------------atagactcctaccaa---------------------------------------------- ----ctc-aaagaatgcacattctCTGGGAAACATGTTTCCATTAGGAAGCCTCGAATGCAATGTGACTGTGGTCTCCAGGACCTG-TGTGATCCTGGCTTTTCCTGTTCCCTCCG---CATCATCACTGCAGGTGTGTTTTCCCAAGTTTTAAACATTTA------CCTTCCCAGTGGCCTTGCGTCTAGAGGAATCCCTGTATAGTGGT-ACATGAATATAACACATAACAAA-AATCATCTCTATGGTGTGTGTTGTTCCTGGGGTTCAattcagcaaattttccctg-ggcacccatgtgttcttggcactggaaaagtaccgggactgaaacagttgatggccca-atccctgtcctct---taaaacctaagggaggagaTGGAAAGGGG-CACCCAACCCAGACTGAGAGACAGGAATTAGCTGCAAGGGGAACTAGGAAAAGCTTCTTTA---AGGATGGAGAGGCCCTAGTGGAAT-GGGGAGATTCTTCCGGGAGAAGCGATGGATGCACAGTTGGGCATCCCCACAGACGGACTGGAAAGAAAAAAGGCCTGGAGGAATCAATGTG-------CAATGTATGTGTGTTCCCTGGTTcaagggctgg-gaactttctcta-aagggccaggtagaaaacattttaggctttctaagccaag--gcaaaat-tgaggatattacatgggtacttatacaacaagaataaacaatt---tacacaattttttgttgacagaattcaaaactttat----agacacagaaatgcaaatttcctgtaattttcccat-gagaactattcttct--tttgttttgttttgcgacAGGGTTGCGCtgatcctcccgcctcagtctccctaagtgctgagatgttgcaggaagtcagggaccccgaacagagagatcggctggagccgtggcagaggaacataaattttgaagatttcattttaatatggacacttatcagttccc aaataatacttttataattttttatgcctgtctttgctttaatctcttaatcctgttatcttcataagctaaggatgtacgtcacctcaggaccactgtgataattgtgttaactgtacagattgattgcaaaacatgtgtgtttgaacaatatgaaatcagtgcaccttgaaaaagagcagaataacagcaatttttagggaacaagggaagacaactataaggtctgactgcctgcggggtcgggcaaagggagccatatttttcttcttgcagagagcctataaatagacctgcaagtaggagagatattgctaatttcttttgctagcatggaatattaatattaacaccctgggaaaggaatgcattcctggggggaggtctataaatggccgctctgggaatgtctatcctacgcaatggagataaggactgagatacgccctggtctcctgcagtaccctcaggcttactagggtggtgaaaaactccgccctggtaaatttgtggtcagaccagttttctgctctcgaacactgttttctgttgtttaagatgtttatcaagacaatacgtgcaccgctgaacacagacccttatcagtagttctcctttttgccctttgaagcatgtgatctactccctgttttacaccccctcaccttttgaaacccttaataaaaaacttgctggttt-gaggctcaggtgggcatcacagtactaccgatatgtgatgtcacccccggcggcccagctgtaaaattcctctctttgtactctctctctttatttctcagccagctgacacttatggaaaatagaaagaacctacgttgaaatattgggggcaggttcccccaataTCTGGTGCCCAACGTGGGAtactgagattacaagcatgagccactgcatctggcctcttcttttgatttttttttttcaaacttttacaaatgtagaaaccattcttagcttttgggcatta ccaaacccggcagtgg-caggctcggttcaccaacgtcatttgcagttccccgCTTTATGTTATGGgttttgttttgttttgtttttttt-attgagacagagtttcactcttgttgcccaggctgtagtgcaatggtctgatcttggctcactgcaacctccacttcccaggttcaagccattctcctgcctcagcctctcaagtagctgggattacagacactcaccaccacacctggctaattttgtatttttagtagagatgaggtttcaccatgttggccaggctggtctcgaaatcctgacctcaggtgatccacccaccttggcctcccaaagtgctgggattacaggcttgagctaccacgcctggctGGGTTGGTTCTCAATGGAGTGGTTTGTTTTTGGAGCTGCTCT-GCGCAGtggggaccagaataggcctg-------------------ggttcctagcccattgctattcctt----accagctgtggattctaaggaaagtcatttaacctcgctggaccttag-attcctcatccctgaaGCCCAAGGGTaaaacaaaacaaaacaaaacaaaacaaaccaaCCCATCATGTAAAGCGGGGAACTACAAACGATACAGGTGAAACATGCCTACCACACCACTCACAGGCT--ATGATGACAAAAACGTGGCTACATCTGGGACCACCCCCCAACCCCCACTTTGTACGTAGGAAATACGGAGTTGAGGATGGAGACCCACAGTATGTCCAGAGTGTCCCCAAAGGCCACAGTGCCCGCCTGGAGCCCTCCAGAGAGCGTGCACTCCCTGGGGTGCCAGCCAGAGACAACTTGCCCTGAGGCTTGGAACTCGATTCTCCGCGTGCCAGAGAAGGGGTGGGACTTCAGAACCCCCAACCCCGCAATCTGGGTCGGGGAGCCTGGCGCACTGCGGGCCGCTCCCTCTAACCCTGGGCTTCCCTG------GCGT CCAGGGCCGTCGG-----------GGCCGAGTCCCGATTCGCTCCCACCCCGAAGCCGCGCCAGGACCAACGAGGGCGCAGCCGTATGCCCCAGCCCGCTCCGCGGAGCCCCTCACAGCCAcccccgccccgaccgcgccccgcgcggcTCGAAGCACCTTCCCAAGGGGCTGGTCCTTGC----------GCCATAGTCGCGCCGGAGCCTCTGGAGGGACATCAAGGATTTCTC-GCTCCTACCAGCCACCCCCAAATTTTTGGGAGGTACCCAAGGGTGCGCGCGTGGCTCCTGGCGCGCCGAGGCCCTCCCTCGAGGCCCCGCGAGGTGCACACTGC---------GGGCCCAGGGCTAGCAGCCGCCCGGCACGTCGCTACCCTGAGGGGCGGGGCGGGAGCTGGCGCTAGAAATGCGCCGGGGCCTGCGGGGCAGTTGCGCAAGTTGTGATCGGGCCGCTATAAGAGGGGCGGGCAGGCATGGAGCCCCGTAGGAATCGCAGCGCCAGCGGTTGCAAGGTAAGGCCC-CGGCGCGCTCCTTCCTCCTTCTCTGCTGGTCTTTCTTGGCAGGCCACAGGGCCCCACACAACTCTGGATCCCGGGGAAACTGAGTCAGG-AGGGATGCAGGGCGGATGGCTTAGTTCTGGACTATGATAGCTTTGTACCGAG-----TTCTAGCCAGATAGAAGGTTACCGGGAGCTGGGGAGCGTTGGATTTGCTGCTGGGCTGTGCCGGTGCCCAGAAGGCA------GGACCTTGCAGAACCAGCCAGGTCCCTGGGAGACTGTCAGACCCACCAACCTGGTGGCATTCGCAGAGCTGAGATGCATTGGAAATTGCCTTGGGCACATCCCCAAAGATCAGGATGTCCCACCCCAGTCTGAAGGAGA---TAAAGTTGGGGGTAGGAGAGACGCAG-ATGCAAGTGATCAGTCTC---AGTCCCAGACATTGCCTTGCTCTGCGGGTAGGAAT TCAGGATTCATTTTCCAGGGAAG--------TTCCTGACCTCTGAATGAGAGGGGCTGTGTAAGGCCAATGCCTGGG-AGGAAGGCAAGGATGAGTAGAGGTGGGGGGAAACAAGTGTCAGGAAGA--------------------------------------------CTCAAA---------ATCTTC--------------------------------------------------------------CAGAGAAATTGT-----GCAGGGTCTTACCAGATCTGTCCTCAAAGCCATGCAAATTGCCTTCTTTGCAATGCAT-ACAATGAGGTGTCTCTGGGGGTCAGAACTGG-----------------------TTATTAGGGAACTTCTAGCCAGGACTGCTAAATACGCGCTGTTGG---------CCCACCAGGCTCACCTATAGCCT-TCCTTCAGTCTGGGCTTGGTTTGGATTTCACTGTGGGTGCCATCGCCTTTACACTCCTGTTTCTATAGTTTAAAGATAGTGGTGCTTTGGGAAAG---TGACTCCTTAAATACAGTTAGGTCCAAGTGA-GACAAGTGGCCTGGCTGTCATTTCAGAATAGCAGCTTCCAAGAGG----------TGATTAATTTCTGTTGGAAGGGTGAT-CTTTGGGGAGGT--GGGTGAAGAGCAGAGACTTGGTGGTACCGTTCCAGGAGCACAGGCTCTCT-----TCCTTTGCA--GTGCAGAATGACCTCTGGCAGCCGGAGTTGTGTTTGTT--------CTGTAGGATTCTGAGGTGGGCCATGGGCAGCTGGAACTGGG-----GAATTTTGCCAATCTCTTTCATATTAGGATTGTCTGCAGAACCAGATATGGAGG------CTTCTAGCAACGTGAGTGCTCCTGTTCTAATGCCCTTAGAAACAAGAAGGCCACACTGATCATTTCTCTCACTTAGGCAGGGAG ACAAGGCAAGAGAGAAACAGT-----------------GGATGC--TTTTAGGTTCTTTCCCTTCCCAAGCAGTTGTGGACATTGGGCTGA-GGGGAACATTTCCACATTGGCTAAAGGAGCGTCCTCCTCATATTTTGTACATTTTATACCCAA--AATAA-CTCTTCTTGGTATTT-GGGGAAATATTTTCCTCCCCGTCC------------ATTCCAGGAAATGGCTCCAAGTGCCAAGGACAGAGCCAGGGAAGTTGCAATGAATTCCTGCCCGTCAGCCCCAGGCAGATGCCTTGCACGTCTGAGTGGCCCATGCAGAGCGTGGAGGTGGCCGCC----------------ACGGAACC-TGGGTCAATGT-CCCACCCCCG----CTTAGATGCCA-CCAGGGG--CGTGGGAGCCAAGGAG--AGAAGAGGGGCTCCAGGAAGGTAGAGTCCTTGTGTCTTGTGCATCTGTGAACAGCACTGGTATGATTTAAAGGAAAATTGAGCCAAATTTTCCGGCAGTCAGTT-----ACCCCATCCCCACCGGGGTAGGAGTCTGGCAGCCGCAGCTCCATTCTGGCCAGTCGGCAGAGAGCCTTGAAATTCTTCTTTGTCCACACAGTTGTCTCAGAGAAACAG--AGAGGTT-GTTTCTGCTTAAAAACAACACACTTGGTGTCTGGGCCCACAGACTCCTTTGCACTTATTCCACGTGTGACAGCCAATGTGCCTCGTTGCTTAGCAGACAGCATGTTACCGTCTTTCCTGCTCAGTTTGTTAG--------------CTCTATGGAATGGAATTTATAATCAATGCCCATACCAACATTTCACTAATATCATAGGAGATTTAGTCTCCATCTGGGTGTACATTACATTTGC--TCTGGGG-TGCTCCAGGC--TGGGGGGTTGCCAAGGAAGAGAAGAGAAACCGCAGAGAAGAC---GGGAGGGCAGGGCAGGGGTCTCTG AGAAGGGGAGGGGTCCCAGAGTGCAGGAGCAGGAGCCAGGCTC---------ATGAAAGGGGCCACGGGCGGGAGTATCCAGGGACGGCAGTCAAGATGGAGCACAGCTTAGG--AAGCTGAAGGGAATCCTGGCCCACCTGGGTGCTAGAGGGCACATAGGAAGTGCAGGAAGCAGACCAAGGTCCCCAAGAGAGGGAGACCTGGACGCTGAAGCATTTTCTGTCTTTATTAAG-------------ACAACTCCGTAAGAATTCCTGCTGGGCCAAAGTGAATTCTAGGATGCGACTTTAAGATGGGAGCAAGCGAACCATTGAGGAGGCAGGTTACCCTAGTTAGCCAATGCAGATCGAGAATGGGAAATCTTTCatttattcatgcaacagatatttaacgaagccctgccgtgttccaggcctgtgatagatgctggaacaggtacagaga----------tAc-------aggtgtcattaattgatcaggg--caacctctc---cttctgagt--cttgctggagcttcagatgc-ccctcacacagagctcgagggagcctc-aacaattgatcagaagtcaggcaccatggctcacgcatataatcccagcactttgggaggccaaggcaggtggatcactggagcccaggagttccagatcagctggggcaacatggcaaaaccccatctctattaaaaaaaaaaaaagtaactggatgtgatggtacacacctgtagtcccagctacttgggaggctgagaggtgggagaattgcttgagcccgggaagtcgggggtccagtgagccttgatcacaccactgcactccagcctgagtgacagagcaagaccctgacacacacacacacacacacacacacacacacacagattagagctgaaacaggagtagaaacctatctg-tatctctgATGA-GATCAGATC---------TTTCTGATGAACAGAAAGAATG TAACCCCTGTACTCACACCCTCTCTGCTGGTTACATATGTTAACACGATTTCTCAAATGAGGCTTTTGGTTGCAAATAAGAGAAAATCACTCACGCT-GGCCCTGTG--TTTTTCAAATTGTTTATTGTGATCAACATTTGAAAAAAGAGCCGAGACTCTCAAGAGTGCATTACCCACGGTAAGGGTGAATTTT-ACTTCTTGACACTTATTTCTCTTACATGTATCTATCTGTCTC-----AAATGAAAAATATATTTAGAAAGTTGAAAGCTATCCAAGTGAGTATAAGAAAAGAGTATCTCACCCTGAAGGCTAAGGACAGGGAGGGC---------------------------CACCAGGCCTCACGAGGACCCAGGAACCACAAAGAAGGCT-AGGAAGGAGCACAGGCGGTGACCATACTCTGGCTCAGTGGCTATGTGGGCTCTGGTCTCTCTCAGCTGTTCCATGCATATGAGGCCAAATGTGGCTACCCTAGAGCTTCTGAGCCCTCAACAGAGATGAACTGGACTCTCTGCAGCCCCACTCTAAATTCCTAAGAGAGAAGTTGATTGACCCAATCAGGGTCAGGAGAAGGAAGGGAGGAGGAAAGGGAGGAGAGAAGAGCCTCTTCGTCTCTTGCCTACCACTGGCCAGGCAATTGTAGCCAAGGGGGCTGGAGTGTAAATGCAAACATAGCCATCAAGGGTtgtgtatgtgtgtgtgtgtgtctgtgtgtgtgtatgtgtgtCTCTTGGGTAGGTTAGA-TCTCCCAGGAGGTCCCTACTAAACAGACTTAAGCCCGCAAAATTTTAGCTCTCCAGCCTCACACACTCCACCCCTCTACCATATTGAATCTTCCCAAACCAACTATGGCTTTCCCTAACTCCGGAGc------ttggcctggaatgccctgcttcccctctttcccctggggaacgcctgtccttcaggcctcagttcacacactgcctcccttgca aagctctccTCCCATCCCCGGAGTCCCT--CTTCCCCTTTGTTCTTTGGGTTCTATGCTTCTTCCCTCATAACTCCCACCAGGTTGTGTTAAAATGAGTTGTTCAAGGTCCTGTCTGTTCCACTAGATTCTGAGCAACTTGGAGAACGAAGATCCAAACTTCGCTGCCTTTATTTCCTCCTTTGTTCTTTTCTCATCCCCAAGTCCCTTCCAACTTGGAGTTATgaagaaaggaaggaaggaagggtgggagggaagaaCAGGAGGGGATCCCACAGG-AGAATGTGTATAGGGAGAGGACTCAGACTAGCTAAAGCTTTTCCCTCATAATTAATAGCAAATACCATGTTACCTGAATTTAATTCACAGTAGCATACAAAAGACTCGCTTTGTTCT-------CCCCA---------TTGATGTCATCAGAGG--------------------GCTGTGGG--------------CAGGCCTAATCTTGGCTCAGGAGGCCCTCCAGCCTGGATCTAAAGAGCAGCAGATGggccaggctcggtggctcatgcctgtaatcccagcattttgggaggccgaggcgggtggatcacgaggtcaggagtttgagaccagcctggccaagatggtgaagcctcgtctctactaaaaatacaaaaattagccaggtgcggtggtgggcgcctgtatttccagctacccgggaggctgaggaggctgaggcaggagaatcgcttgaacccgggaggcggaggttgcagtgagccgaggtcacgccactgcactctagcctgggcaacagagcaagactccgtcaaaaaaaaaataaaaaaataaaaaaataaaaaaaataaaGAGGAGCACACATCTCTGCCCATCCTAACTCCCACTTTGACATTGAGGTCCCCAGGATGGAGGGTCTGCCTCCATCTGCCTTGTCCCCTG-CAATGGTGGGAAGGTGATGGAGCTCAAGTCTAGAGGCCACC AGCTTCTTAGGGAGG--TAGGAGGTG---------------GAGGGTGGGGTGC-GGGCCCTGCACACAACTGCCAAGTGAGGATGGGGGTGGG-GTCCACCTGAGGATAAGTAACAGTGAGGCTGGTGCAGAGGACCCAGGTGGAGGTAGACAGCAGAATTTGTGGTGGGGT--GGATGGCAC-ATTATATAAGCCTCTCTTGC------TGCCCTGT---TTACTGAGATTGTTTCAttatcttttttggcttttgtttttaagagatggggtcttgctgtgtcacacaggctggagtgcactgtgtgatcatacctcactgcagcctcgacatcctgggctcaggcaaacctcccaccttggcctcccaagtagctgggaccacaagcgtttgccaccacactcagctatttttatttttattttta--ttttttttagagatggggtcttgctgtgtcgcccaggctggtcttgaactcctgggctcaagcgatcctcctgccttggcctcccaaagccctgggattataggctgagccaccacacccagccACATTTCATCTGTGCAGCTCCAGGGGCTCCACATTCT-ACTCTTCTCATTTCTTCTCCAGGGTACCC----------ATGGCAAGGGATGAGGGT--AGAAGATGGGGCA--GCCAGGCCTTGATTAAAGGAGAAGGAAGGCAGCCTGTGGAGAGG---GCAGCC---C---AGGGAG---TGCAGAGAGAAGTGGGCCATGAGGGAGA---CAGCAGAGTGCAGGCTGCGTCC---CAAATGAGCATACAGCCCACTGTGAGCCCACC--ATCTTCCTAGA-GA--CCCCTCTCCTCTCC-AGGAGCTGCTTCAGTAGCACTCA---------GAGGAAAGAATGATGC--------TGTATCAACATTTCAGCAGCTCATCTTTTAACTCTAAGAAAATGGCAGCTCCTAAATGTTCAA--AACTGCTTTG GAAACTTCT---GGAGAGAGGTTTTGCAGCTCAGGCAGACAGCTGATCGCGGCCTTTCTTCCACCCCAACCCATGCTCTCCCCATGCT--CTCCTGCCACAGCTGCAGCGGGCCCCTGGGTCCTACATTTGCAG-CCCTTTGTCTCTGAGCT-----CAGACTTCCAATTCCAAGCGGCAGCTGGGCAGGCTCACCAGCATGT---CCAGCCAGTACTAGGACATCAGCAGGAGC----CCAACCACCTCTTTCCAAAATCTCTCCTCATGTCTCTCCTAGTTTCCATCTCCATCCTTCTAGTCAGCCAGGCTGAAAACATT-----------------TGCTCCTCAGGGTGCAGAAGGGAAAGCTTTGCCTCCCTTCCTGGTGCTCACTGCCCCTGCGATTCCAGCCCAAGCCCTCCCCGGCTCCTCACC----------CTGGTGTCAGCTGGAAGCCACCATCTCCTAAACCCACCTGtgttcttccacctctgc--------cagggctgc-cctctcctccaccttcacaaactcaattcctacccattctcaggtcccttatcaaatgccatctcctccatgatgcctccctgattccccTGCTGGAaataatggtgataacagctaag--gcattggggttggctacgtgccaggcaaggagttggcactttacatgctttatctcatttcagccacataacatcgacaggt-ggcattatgattcatatcatccccatctgatagccaggaaaactgagtcccagagaggttagc-cactttcctagggccCTGTGCTCTGACTCAAGCATAGCTCTGAGGAACTCTAGCATTCATCAGTTTAAGCACCATGACTTTCTTTGCTGAGTCACCCAAGGCAT-TTCTTCATTTAAATGTTCTTCCTTGGCCAGGCGCAGTGGCTCAggcccaatgcggtggctcacgcctgtaatctcaacactttgggaggccgaggtggg cagataatctgaggtcaggagttcaagaccagcctggccaacatggtgaaaccccatctctactaaaaatacaaaaaaatgaggctgggcgtgatgactcacacctgtaatcccagcactttgggaggccaaggcaggtggattacatgaggtcaggagttcgagaccagcctggccaacatggtgaaatcctatctctattaaaaatacaaaaaattagccaggcatggtggcaggcacctgtaatcccagctacttgggaggctgaggcaggaaaatggcttgaacccgggaggtggaggttgcagtgagccaaggttgcaccattgcactccagcctgggcaaaaagagggaaacatcgtctaaaaaagaaaaaaaaaaaattagccaggctgggtggtgcatgcccgtaattccagctactcaggaggatgaagcaagagaattgcttgaacccaggaggcagagattacagtgagctgagatcacaacactgcactccagcctaggtaaagaacaagactccatctcaaaaataaataaataaaaataaaTGTTCTTCCTTGCAATGAAGTTAAATATGTAAATTCTCAAACCAGTTGCTTAAGGGCACAGTTTTGTTCTTTACCTATATTTTTAACAAATATTTTATGTAAGTAGTTGAC-AAAATCAAATACTGT-GTACACTACCGAGGCTTCCCTGGGAAAGCCATCAG-CCTCTGCCCCATCCCTTCCCACTCCTGATT-CCACTTTCCTGTGTTTCCATATCTTTTTCATGTCTGTTTCTGGCCCACAGTGGGCGATCAATACATGTTAGCCACCAACCATCAAACCTATATTGAGTAATTATGGTATGTCAGGCACTATGCTCAATGAAATTGTAttaggcttgtacaaaagtaattgtggtttttaagagtaatggcaaaaacggcagttactttcgcaccaacTATTTGCTGCCTTGAATTATTCCTCCTCTC-C TCATCCCTAAACCCTGCTCCTCCCAGCCATTCTTCCTCCCCTTCTTGGGCCATGGCCAGGCCCCACCCAGGTACTAAGACTCAGGTGAACCAAGGAAGACTTAATGCCCACTCTTTTCTGATGCCCATGTT--GGCATGTGTTAAGtcggttagcattaagtttggctgcatttagcagagacccaaaagaacagtgccttttaaaaggcagaggttatgtctctcacacacacccagcacaagtccaag-------------------------accagcatggcatctcagctccatcaa--cctcaggaaccgagctcctgcagctccctgccctgcagttgataaggtgaggtctttgtcctcctggttcaagatggtgctagaatgttggctaccatatctatagtccaggcatcagaatggagcaagggatgaaaaaggaagagatgaaggcacacgacaggttcctgagagctggcacaggacacttctgcttatatttcactggccagaacttagtcacatggtcacacctagttgggagactctgagaagtaa----agtatttattctagatggccatatccctacc-taagacttggagttttctatgactggggaagaacggaagacaagatattgggaaagactagcagcctctactaAAAGGGTGATCtgtgttgatgtgcgtgtgtgtgtgatgtttgtatg---agcatgtgtgt-tatgtgttgt--gtgtTGGTGGGGCA--GATTCTTGCGAGCACTTTGGTCTCAGATGGACCTGCTACCAGTTCTCTCTGCAGACCCCCATAGGTTTCTCCTAAACCTGGCCT-CTCCTATTAGGCAGCCTTACTCAGCGGCAGCTTCTCAGCTCCATGTTTTCAAGGAACCACAATTTATTTCCAGCATCCACTGAAGCATATTATCAGTGGTGATAGAGGGGGCTTGTAAAACTGTTTTTCCACTTAGGTATTAGA GGGTGGCCATTATTTGAGAGTGAC-----TATGACCACAGTTAATCTGGTAATAAATTCTCTTGGGTAGGAGGGGGAAAGGAAAGGATGCTTTAAGGAAGCATCTTGCCAGGAGACACAAAGCTAACAAGAGTGGAGCCTGCAG----------------------------CTGGAGCCGCAGAGCCTAATCACTACACCCGCCCATCTCTGCTAGGGTTTCATGACTTCGTATCGGGGATTAGCAGTATTTAACTCTGTTGCACAAACATTTGGTGTA-----TTATTCAGGTAACAAGTAGCTAATAGAGGAAGTTTTACTTTTTTAAGACATAA--------------------ATTTGCCTTTTCCCAAATTACTTGGTACATAGTAC-TTTTCATGTTTGAAGTTGAGATGTGGGTACAATACCATAGCTTTATTCCAGAGCAGGGTATTTGTTTCCAAATGCCATGTTCCCAGCAGCTGCCCTTGACTGGGAATTGGGGTG-----TGATTTGGGCTTTTCCTTAAATCCTTGA-----GGAGCTGGA---GGGGTGGGTGGCTCGCACTCCTGCTTTctgg---------atctgaatc--------------ctgactctgtcatggacctgtt-tgactttgggcaagttgactcctattcctgagccccatat-ttttctcttctgtgaaattcagattaaaaA-AACATGGCTTTGATCAAACATTATAAATAATATATAGACAGACTGCTTGTTTTTATTGTATTGCCAG-AAATGAATCCTACTAATATTGCCATCTATGGACAGAAAATGTATTACCTGTCTTCATCAAGACCCAGACGAGGAAGAACACGAAAAGCGGAGATTAATTTTACTGCCATCTCCAGAACCGTCATCCTAATATTTACTTACAT-TTTATTATTATTTCAGGCTCATGCACATATACTTAGCATGGATCATTGGCCACAGACTCGCA TACATTTAACTTTATTACCTTT-TGCCTCATGTATCTCATTAAAATTTTGCTGCTTAATCAAGGATCTGCATATTATTTTAATTTTAGAATTCACAGTTCCAAGACTTTGAAAGTTTCAAGCGTTCTGGGTGaatgtgttatgc--tctctcccgccaccatgtctttataccccctgatttctcagccact-atggcaaccactttctactcttagtagcccatatttag--tccaatccccagctcaggagacacttcttccaggg--agccccctgtgccttccagtagtatcttgtacctgccctttttgcaaagctctttcctcctggcttagaatggcccattgacctgtttgtttctcctattaaactgtaagccactcgagggtagagagcatctgttgttcaccattgcatcctcggtgctgagcactgcgtctgacatattatttagaaggtcagtaagtgctagtgggatTCAGGCTCCCAGTGGGTGGGAGAGAAAGGACGTAAGGAAGCAAGTGGTAAAGGCCCTCACAGA-GTATCAGCAGGCTGGTGTGA-GGGAGAAATGCAGAGGATGGGTGAGTAGCA-----TAATCGCTAATGAT-AGGGTAATGATAGAGCACATTTCACAACACCTTt-aagccctttcacgtgcatcagataatttgatcctcataaaagcctagagatagatatattacagg-gatgaaggtggagtattttgtggttatgtgatatg-tttaaaattatgcagtgagtaaatgactgggttcaaaccagaccttaaaagtctgttatctttccCTCG-AGCATGCAATGAAGTCTACATCATCCCTACCATGTCCATTTGATCACACCCTGGCCTCACAGCTCTGTGGTCTACAGGATACCTCATGGTGGTTTTATTGACCAGACAATAATCCTCTTTCTAAGGGGATGCATTTCATTAATACATATGTAGATCATGAATTGTC TTTGACTTTGAGGGGATGGTAGC----CAGAGCAGAAAGCAAAGCTGATTTTCATCCCCGTCTGGTAATGTGGTTGGTAATGTGAAGA-TGGGTGTATTCTGAGATACCGGCTCCTTGCAGTGTGTGGTTCCTTCTGTTTTCAGGCCC------AAGAAGCCCATCCTGGGAAGGAAAATGCATTGGGGAACCCTGTGCGGATTCTTGTGGCTTTGGCCCTATCTTTTCTATGTCCAAGCTGTGCCCATCCAAAAAGTCCAAGATGACACCAAAACCCTCATCAAGACAATTGTCACCAGGATCAATGACATTTCACACACGGTAAGGAG---AGTATGCGGGGACAAA---GTAGAACTGCAGCCAGCCCAGCACTGGCTCCTAGTGGCACT-GGACC-CAGATAGtccaagaaacatttattgaacgcctcctgaatgccaggcacctactggaagctgagaaGGATTTGAAAGCACAGGGC-TCCACTCTTTCTGGTTGTTTCTTTTGGCCCCTCTGCCTGCTGAGATTCCAGGGGTTAGTGG--------------------------------------------------------TTCTAATTCTAAACCACTCCAAGAACATTTGATTTTGCTACATGTTTCCATTTAAAAATCATAGGATTTGggctgggtgtggtggcttgtacctgtcatcccagcactttgggaggccaaagcaggaggatcattcgagcccaagagttcgagaccagcctgggcagcatagggagaccccatctctacaaaaataataaaaaatgttagctgggcatggtggtgtgtacctgtggtcccagctaggggaggctgagatggaaggatcacctgagcctgggaggttgaggctgcagtgggccctgatcatgccaccgtgctccagcctgggtgacagagtgagaccttgtctcaaaataaataaataaataaataaaAGTCATAGGA TTTgatcaggcatgatgggtcacatctgtaagcccattgctttaggaggccaaggtaggaggatcagttgaggccaggagttcaagaccagcctgggcaacatggcaagacctctctctctaatttttaaaaaaataaaaaTTAAAGATAAGAAAAAAATCATAGGATTCTCATGAGGCCTCACGTGCTTATTTTCAACCTACCAAGGGGAAACCCAGGCCTCAGCGATTAGCTGAGC----------CACATGCAGGCACAG------------------------CCACTG-----TCTCTTTCCTTCCTGTCCCCTCTGTCCCCACCTTCTGCGCTCGCCTTCCTCCCTGACTTCACTTCCTTGAATCTTAGTGCCTACGACCAGAGGGAGCTGTGAAGTTCCTTG----TGTCCCATTGGCAGGAA-CAAGACCCCCAGAAGCATCTCCTCAGGGC------CTCTA-----TCCCATCTC-TAGATGTGCTTGTCATTAGG-Gttct-------------tgtagttccagctgatctctggccctgccgctcaaagatacccaaaagagcgagtctaccctttttcacattcaaccctctactgatttgcaaatagcagtcagtgcccaccctggtcttttctctggggtccagcaggcctagaccttcagccattttcctgatgaGGTCTGTAtttgaaattaggaagattaagtttgaatcttcacacttctgat----gtctgtgagatcttcagcaagttccttact--gtctttaagccttgt-tttcatcatctggataatggggatatcacacacta-ttcacaaggttgttatgaggcctaaattagctaaagcaATTGAATCCTCCTTACCCCCTGCATGGAGCTCTCTGGAGACTTCCACGTCTCCTGGTCATTGTGGGTGTCTTATGGTA-GTCTTGGGCAGTTAGGGAGAAGTTAGGTGTCTGGAAGCAAA GATGGCTCAGAACTAGATAGAGTC-TTGGGCATTTTATA-GATAAAAACTCTT--GTCTCCtttaaaaataataaaaaaaaattaGCTGGGCATATTAGCCACTCAGCAAGACTGCACGTGATAGATCCCGAGTGCCCCACCTTGGGTGGTGTAATACACAATATCACGGGAGCCCCGGGTAGTAACCACGGAGGTGTCAGCCTCAGTGCTGTGGGCAGATG-GATGGGGAGAGCC--TCCCGG-AACTGGAGTCACTGGAGCA----------------------------GGGTTGGGGGGCCTCACTGAGGGTACGGCCTTGATCTCTAAGGAGGAGGGACTGCCTGGAAAAGC-TGACTGGGAGGGAGGACTCGGCTGGGGGTAGAAGGGA----------CTAGGGAAGGCTGGGGGTGGGGGTGCTTATGGAGGACCTCAGATGCCTGGGGAACAGACTCCACTAAATAAAACATATGAAACCATGGCTGGTTCTTCAGCAGAGGCCATGTAGAGAAAGGAATGACCTAGGAAAGTTGGCCTGGAAGTGGAGGGAAGGATGGTGTGGGAAAAGCAGGAA--------TCTCGGAGACCAGCTTAGAGGCTTGGCAGTCACCTGGGTGCAGG-ATACAAGGGCCTGAGCCAAAGTGGTGAGGGAGGGTGGAAGGAGGCAGCCCAGAGAATGACCCTCCATGCCCACGGGGAAGGCAGAGGGCTCT-GAGAGCGA--TTCCTCCCACATG-CT-GAGCACTTGTTCTCCCTCTTCCTCCTGCATAGCAGTCAGTCTCCTCCAAACAGAAAGTCACCGGTTTGGACTTCATTCCTGGGCTCCACCCCATCCTGACCTTATCCAAGATGGACCAGACACTGGCAGTCTACCAACAGATCCTCACCAGTATGCCTTCCAGAAACGTGATCCAAATATCCAACGACCTGGAGAACCTCCGGGATCTTCTTCACGTGCTGGCCTTCTCTA AGAGCTGCCACTTGCCCTGGGCCAGTGGCCTGGAGACCTTGGACAGCCTGGGGGGTGTCCTGGAAGCTTCAGGCTACTCCACAGAGGTGGTGGCCCTGAGCAGGCTGCAGGGGTCTCTGCAGGACATGCTGTGGCAGCTGGACCTCAGCCCTGGGTGCTGAGGCCTTGAAGGTCACTCTTCCTGCAAGGACTACGTTAAGGGAAGGAACTCTGGCTTCCAGGTATCTCCAGGATTGAAGAGCATTGCATGGACACCCCTTATCCAGGACTCTGTCAATT--TCCCTGACTCCTCTAAGCCACTCTTCCAAAGGCATAAGACCCTAAGCCTCCTTTTGCTTGAAACCAAAGATATATACACAGGATCCTATTCTCACCAGGAAGGGGG-TCCACCC-AGCAAAGAGTGGGCTGCATCTGGGATTCCCACCAAGGTCTTCAGCCATCA---ACAAGAGTTGTCTTGTCCCCTCT-TGACCCATCT-----------------CCCCCTCACTGAATGCCTCAATGTGACCAGGGGTGATTTCAGAGAGGGCAGAGGGGTAGGCAGAGCCTTTGGATGACCA--GAACAAGGTTCCCTCTGAGAATTCCAAGGAGTTCCATGAAGACCACATCCACACACG--CAGGAACTCCC--AGCAACACAAGCTGGAA---GCACATGTTTATTTATTCTGCATTTTATTCTGGATGGATTTGAAGCAAAGCACCAGCTTCTCCAGGCTCTTTGGGGTCAGCCAGGGCCAGGGGTCTCCCTGGAGTGCAGTTTCCAATCCCATAGATGGGTC-TGGCTGAGCTGAACCCA---TTTTGAGTGACT----CGAGGGTTGGG-TTCATCTGAGCAAGAGCTGGCAAAGGTGGCTCTCCAGTTAGTTCTCTCGTAACTGGTTTCATTTCTACTGTGACTGATGTTACATCACAGTGTTTGCAATGGTGTTGCCCTGAGTGGATCTCCAAGGACCAGGTTA TTTTAAAA---AGATTTGTTTTGTCAAGTGTCATATGTAGGTGTCTGCACCCAGGGGTGGG-GAATGTTTGGGCAGAAGGGAGAAGGATCTAGAATGTGTTTTCTGAATAACATTTGTGTGGTGGGTTCTTTGGAAGGAGTGAGA-TCATTTTCTTATCTTCTGCAATTGCTTAGGATGTTTTTCATGAAAA------------TAGCTCTTTCAG-GGGGGTTGTGAGGCCTGGCCAGGCACCCCCTGGAGAGAAGTTTCTGGCCCTGGCTGACCCCAAAGAGCCTGGAGAAGCTGATGCTTTGCTTCAAATCCATCCAGAATAAAACGCAAAGGGCTGAAAGCCATTTGTTGGGGCAGTGGTAAGCTCTGGCTTTCTCCGACTGCTAGGGAGTGGTCTTTCCTATCATGGAGTGACGGTCCCACACTGGTGACTGCGATCTTCAGAGCAGGGGTCCTTGGTGT-GACCCTCTGAATGGTCCAGGGTTGATCACACTCTGGGTTTATTACATGGCAG-----TGTTCCTATTTGGGGCTTGCATGCCAAATTGTAGTTCTTGTCTGATTGGCTCACCC-AAGCAAGGCCAAAATTACCAAAAATCTTGGGGGG--TTTTTACTC-CAGTGGTGAAGAAAACTCCTTTAGCAGG-TGGTCCTGAGACCT-GACAAGCACTGCTAGGCGAGTGCCAGGACTCCCCAGGCCAGGCCACCAGGATGGCCCTTCCCACTGGAGGTCACATTCAGGAAGATGAAAGAGGAGGTTTGGGGTCTGCCACCATCCTGCTGCTGTGTTTTTGCTATCACACAGTGGGTGGTGGATCTGTCCAAGGAAACTTGAATCAAAGCAGTTAAC-TTTAAGactgagcacctgcttcatgctcagccctgactggtgctataggctggagaagctcacccaataaacattaagatt-gaggcctgccctcagggatcttgcattcccagtggTCAAACC-GCAC TCACCCATGTGCCAAGGTGGGGTA-TTTACCACAGCAG--CTGAACAGCCAAATGCATGGTGCAGTTGACAGCAGGTGGGAAATGGTATGAGCTGAGGGGGGCCGTGCCCAGGGGCCCACAGG-GAACCCTGCTTGCACTTTGTAACATGTTTA-----CTTTTCagggcatcttagctt---ctatta-----tagccacatccctttga---aacaagataactgagaatttaaaaataagaa-----aata--TGACCCCAAAGAGCCTGGAGAAGCTGATGCTTTGCTTCAAATCCATCCAGAATAAAACGCAGACCCCAAAGAGCCTGGAGAAGCTGATGCTTTGCTTCAAATCCATCCAGAATAAAACGCAGATGCTTTGCTTCAAATCCATCCAGAATAAAACGCAAATGACCCCAAAGAGCCTGGAGAAGCTGATGCTTTGCTTCAAATCCATCCAGAATAAAACGCATGACCCCAAAGAGCCTGGAGAAGCTGATGCTTTGCTTCAAATCCATCCAGAATAAAACGCAGACCCCAAAGAGCCTGGAGAAGCTGATGCTTTGCTTCAAATCCATCCAGAATAAAACGCAGATGCTTTGCTTCAAATCCATCCAGAATAAAACGCAGACCCCAAAGAGCCTGGAGAAGCTGATGCTTTGCTTCAAATCCATCCAGAATAAAACGCAGACCCCAAAGAGCCTGGAGAAGCTGATGCTTTGCTTCAAATCCATCCAGAATAAAACGCAGACCCCAAAGAGCCTGGAGAAGCTGATGCTTTGCTTCAAATCCATCCAGAATAAAACGCAGATGCTTTGCTTCAAATCCATCCAGAATAAAACGCA diff -r c44567359a03 -r e899101e63d1 test-data/users/test3@bx.psu.edu/run1/2.fasta --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/users/test3@bx.psu.edu/run1/2.fasta Tue Jun 16 09:55:15 2009 -0400 @@ -0,0 +1,11 @@ +>Sequence 561 BP; 135 A; 106 C; 98 G; 222 T; 0 other; +gttcgatgcc taaaatacct tcttttgtcc ctacacagac cacagttttc ctaatggctt +tacaccgact agaaattctt gtgcaagcac taattgaaag cggttggcct agagtgttac +cggtttgtat agctgagcgc gtctcttgcc ctgatcaaag gttcattttc tctactttgg +aagacgttgt ggaagaatac aacaagtacg agtctctccc ccctggtttg ctgattactg +gatacagttg taataccctt cgcaacaccg cgtaactatc tatatgaatt attttccctt +tattatatgt agtaggttcg tctttaatct tcctttagca agtcttttac tgttttcgac +ctcaatgttc atgttcttag gttgttttgg ataatatgcg gtcagtttaa tcttcgttgt +ttcttcttaa aatatttatt catggtttaa tttttggttt gtacttgttc aggggccagt +tcattattta ctctgtttgt atacagcagt tcttttattt ttagtatgat tttaatttaa +aacaattcta atggtcaaaa a \ No newline at end of file diff -r c44567359a03 -r e899101e63d1 test/base/twilltestcase.py --- a/test/base/twilltestcase.py Fri Jun 12 09:56:23 2009 -0400 +++ b/test/base/twilltestcase.py Tue Jun 16 09:55:15 2009 -0400 @@ -1150,7 +1150,6 @@ tc.fv( "1", "file_format", file_format ) tc.fv( "1", "dbkey", dbkey ) tc.fv( "1", "message", message.replace( '+', ' ' ) ) - library_dir = "%s" % self.file_dir tc.fv( "1", "server_dir", "library" ) tc.submit( "new_dataset_button" ) check_str = "Added 3 dataset versions to the library dataset '%s' in the folder '%s'." % ( ldda_name, folder_name ) @@ -1167,34 +1166,55 @@ check_str = "Added 1 datasets to the folder '%s' ( each is selected )." % folder_name self.check_page_for_string( check_str ) self.home() - def add_datasets_from_library_dir( self, library_id, folder_id, folder_name, file_format='auto', dbkey='hg18', roles_tuple=[], - message='', root=False, check_template_str1='', check_template_str2='', check_template_str3='' ): + def add_dir_of_files_from_admin_view( self, library_id, folder_id, file_format='auto', dbkey='hg18', roles_tuple=[], + message='', check_str_after_submit='', check_str1='', check_str2='', check_str3='' ): """Add a directory of datasets to a folder""" # roles is a list of tuples: [ ( role_id, role_description ) ] self.home() self.visit_url( "%s/admin/library_dataset_dataset_association?upload_option=upload_directory&library_id=%s&folder_id=%s" % ( self.url, library_id, folder_id ) ) self.check_page_for_string( 'Upload a directory of files' ) # If we've been sent some template labels, make sure they are included in the upload form - if check_template_str1: - self.check_page_for_string( check_template_str1 ) - if check_template_str2: - self.check_page_for_string( check_template_str2 ) - if check_template_str3: - self.check_page_for_string( check_template_str3 ) + if check_str1: + self.check_page_for_string( check_str1 ) + if check_str2: + self.check_page_for_string( check_str2 ) + if check_str3: + self.check_page_for_string( check_str3 ) tc.fv( "1", "folder_id", folder_id ) tc.fv( "1", "file_format", file_format ) tc.fv( "1", "dbkey", dbkey ) tc.fv( "1", "message", message.replace( '+', ' ' ) ) - library_dir = "%s" % self.file_dir tc.fv( "1", "server_dir", "library" ) for role_tuple in roles_tuple: tc.fv( "1", "roles", role_tuple[1] ) # role_tuple[1] is the role name tc.submit( "new_dataset_button" ) - if root: - check_str = "Added 3 datasets to the library '%s' ( each is selected )." % folder_name - else: - check_str = "Added 3 datasets to the folder '%s' ( each is selected )." % folder_name - self.check_page_for_string( check_str ) + if check_str_after_submit: + self.check_page_for_string( check_str_after_submit ) + self.home() + def add_dir_of_files_from_libraries_view( self, library_id, folder_id, selected_dir, file_format='auto', dbkey='hg18', roles_tuple=[], + message='', check_str_after_submit='', check_str1='', check_str2='', check_str3='' ): + """Add a directory of datasets to a folder""" + # roles is a list of tuples: [ ( role_id, role_description ) ] + self.home() + self.visit_url( "%s/library/library_dataset_dataset_association?upload_option=upload_directory&library_id=%s&folder_id=%s" % ( self.url, library_id, folder_id ) ) + self.check_page_for_string( 'Upload a directory of files' ) + # If we've been sent some template labels, make sure they are included in the upload form + if check_str1: + self.check_page_for_string( check_str1 ) + if check_str2: + self.check_page_for_string( check_str2 ) + if check_str3: + self.check_page_for_string( check_str3 ) + tc.fv( "1", "folder_id", folder_id ) + tc.fv( "1", "file_format", file_format ) + tc.fv( "1", "dbkey", dbkey ) + tc.fv( "1", "message", message.replace( '+', ' ' ) ) + tc.fv( "1", "server_dir", selected_dir ) + for role_tuple in roles_tuple: + tc.fv( "1", "roles", role_tuple[1] ) # role_tuple[1] is the role name + tc.submit( "new_dataset_button" ) + if check_str_after_submit: + self.check_page_for_string( check_str_after_submit ) self.home() def delete_library_item( self, library_id, library_item_id, library_item_name, library_item_type='library_dataset' ): """Mark a library item as deleted""" diff -r c44567359a03 -r e899101e63d1 test/functional/__init__.py --- a/test/functional/__init__.py Fri Jun 12 09:56:23 2009 -0400 +++ b/test/functional/__init__.py Tue Jun 16 09:55:15 2009 -0400 @@ -80,6 +80,7 @@ allow_user_deletion = True, admin_users = 'test@bx.psu.edu', library_import_dir = galaxy_test_file_dir, + user_library_import_dir = os.path.join( galaxy_test_file_dir, 'users' ), global_conf = { "__file__": "universe_wsgi.ini.sample" } ) log.info( "Embedded Universe application started" ) diff -r c44567359a03 -r e899101e63d1 test/functional/test_security_and_libraries.py --- a/test/functional/test_security_and_libraries.py Fri Jun 12 09:56:23 2009 -0400 +++ b/test/functional/test_security_and_libraries.py Tue Jun 16 09:55:15 2009 -0400 @@ -1396,28 +1396,26 @@ ( self.url, str( library_one.id ), str( subfolder_one.id ), str( ldda_six_version_two.id ) ) ) self.check_page_for_string( 'This is an expired version of this library dataset' ) self.home() - def test_185_upload_datasets_from_library_dir( self ): - """Testing uploading 3 datasets from a library directory to a root folder""" + def test_185_upload_directory_of_files_from_admin_view( self ): + """Testing uploading a directory of files to a root folder from the Admin view""" message = 'This is a test for uploading a directory of files' roles_tuple = [ ( str( role_one.id ), role_one.name ) ] + check_str = "Added 3 datasets to the library '%s' ( each is selected )." % library_one.root_folder.name ## TODO: temporarily eliminating templates until we have the new forms features done """ - self.add_datasets_from_library_dir( str( library_one.id ), + self.add_dir_of_files_from_admin_view( str( library_one.id ), str( library_one.root_folder.id ), - library_one.root_folder.name, roles_tuple=roles_tuple, message=message.replace( '+', ' ' ), - root=True, + check_str=check_str, check_template_str1='wind', check_template_str2='bag', check_template_str3='Fubar' ) """ - self.add_datasets_from_library_dir( str( library_one.id ), - str( library_one.root_folder.id ), - library_one.root_folder.name, - roles_tuple=roles_tuple, - message=message.replace( '+', ' ' ), - root=True ) + self.add_dir_of_files_from_admin_view( str( library_one.id ), + str( library_one.root_folder.id ), + roles_tuple=roles_tuple, + message=message.replace( '+', ' ' ) ) self.home() self.visit_page( 'admin/browse_library?id=%s' % ( str( library_one.id ) ) ) self.check_page_for_string( admin_user.email ) @@ -1531,7 +1529,48 @@ pass check_edit_page2( latest_3_lddas ) self.home() - def test_195_mark_group_deleted( self ): + def test_195_upload_directory_of_files_from_libraries_view( self ): + """Testing uploading a directory of files to a root folder from the Libraries view""" + # admin_user will not have the option sto upload a directory of files from the + # Libraries view since a sub-directory named the same as their email is not contained + # in the configured user_library_import_dir. However, since members of role_one have + # the LIBRARY_ADD permission, we can test this feature as regular_user1 or regular_user3 + self.logout() + self.login( email=regular_user1.email ) + message = 'Uploaded all files in test-data/users/test1...' + # Since regular_user1 does not have any sub-directories contained within her configured + # user_library_import_dir, the only option in her server_dir select list will be the + # directory named the same as her email + check_str_after_submit = "Added 1 datasets to the library '%s' ( each is selected )." % library_one.root_folder.name + self.add_dir_of_files_from_libraries_view( str( library_one.id ), + str( library_one.root_folder.id ), + regular_user1.email, + check_str_after_submit=check_str_after_submit, + message=message.replace( '+', ' ' ) ) + self.home() + self.visit_page( 'library/browse_library?id=%s' % ( str( library_one.id ) ) ) + self.check_page_for_string( regular_user1.email ) + self.check_page_for_string( message ) + self.logout() + self.login( regular_user3.email ) + message = 'Uploaded all files in test-data/users/test3.../run1' + # Since regular_user2 has a subdirectory contained within her configured user_library_import_dir, + # she will have a "None" option in her server_dir select list + check_str1 = '<option>None</option>' + self.add_dir_of_files_from_libraries_view( str( library_one.id ), + str( library_one.root_folder.id ), + 'run1', + check_str_after_submit=check_str_after_submit, + check_str1=check_str1, + message=message.replace( '+', ' ' ) ) + self.home() + self.visit_page( 'library/browse_library?id=%s' % ( str( library_one.id ) ) ) + self.check_page_for_string( regular_user3.email ) + self.check_page_for_string( message ) + self.home() + self.logout() + self.login( email=admin_user.email ) + def test_200_mark_group_deleted( self ): """Testing marking a group as deleted""" self.home() self.visit_url( '%s/admin/groups' % self.url ) @@ -1545,13 +1584,13 @@ raise AssertionError( '%s incorrectly lost all members when it was marked as deleted.' % group_two.name ) if not group_two.roles: raise AssertionError( '%s incorrectly lost all role associations when it was marked as deleted.' % group_two.name ) - def test_200_undelete_group( self ): + def test_205_undelete_group( self ): """Testing undeleting a deleted group""" self.undelete_group( str( group_two.id ), group_two.name ) group_two.refresh() if group_two.deleted: raise AssertionError( '%s was not correctly marked as not deleted.' % group_two.name ) - def test_205_mark_role_deleted( self ): + def test_210_mark_role_deleted( self ): """Testing marking a role as deleted""" self.home() self.visit_url( '%s/admin/roles' % self.url ) @@ -1565,10 +1604,10 @@ raise AssertionError( '%s incorrectly lost all user associations when it was marked as deleted.' % role_two.name ) if not role_two.groups: raise AssertionError( '%s incorrectly lost all group associations when it was marked as deleted.' % role_two.name ) - def test_210_undelete_role( self ): + def test_215_undelete_role( self ): """Testing undeleting a deleted role""" self.undelete_role( str( role_two.id ), role_two.name ) - def test_215_mark_dataset_deleted( self ): + def test_220_mark_dataset_deleted( self ): """Testing marking a library dataset as deleted""" self.home() self.delete_library_item( str( library_one.id ), str( ldda_two.library_dataset.id ), ldda_two.name, library_item_type='library_dataset' ) @@ -1581,13 +1620,13 @@ except: pass self.home() - def test_220_display_deleted_dataset( self ): + def test_225_display_deleted_dataset( self ): """Testing displaying deleted dataset""" self.home() self.visit_url( "%s/admin/browse_library?id=%s&show_deleted=True" % ( self.url, str( library_one.id ) ) ) self.check_page_for_string( ldda_two.name ) self.home() - def test_225_hide_deleted_dataset( self ): + def test_230_hide_deleted_dataset( self ): """Testing hiding deleted dataset""" self.home() self.visit_url( "%s/admin/browse_library?id=%s&show_deleted=False" % ( self.url, str( library_one.id ) ) ) @@ -1597,7 +1636,7 @@ except: pass self.home() - def test_230_mark_folder_deleted( self ): + def test_235_mark_folder_deleted( self ): """Testing marking a library folder as deleted""" self.home() self.delete_library_item( str( library_one.id ), str( folder_two.id ), folder_two.name, library_item_type='folder' ) @@ -1609,7 +1648,7 @@ except: pass self.home() - def test_230_mark_folder_undeleted( self ): + def test_240_mark_folder_undeleted( self ): """Testing marking a library folder as undeleted""" self.home() self.undelete_library_item( str( library_one.id ), str( folder_two.id ), folder_two.name, library_item_type='folder' ) @@ -1624,7 +1663,7 @@ except: pass self.home() - def test_235_mark_library_deleted( self ): + def test_245_mark_library_deleted( self ): """Testing marking a library as deleted""" self.home() # First mark folder_two as deleted to further test state saving when we undelete the library @@ -1648,7 +1687,7 @@ except: pass self.home() - def test_245_purge_user( self ): + def test_250_purge_user( self ): """Testing purging a user account""" self.mark_user_deleted( user_id=regular_user3.id, email=regular_user3.email ) regular_user3.refresh() @@ -1680,7 +1719,7 @@ role = galaxy.model.Role.get( ura.role_id ) if role.type != 'private': raise AssertionError( 'UserRoleAssociations for user %s are not related with the private role.' % regular_user3.email ) - def test_250_manually_unpurge_user( self ): + def test_255_manually_unpurge_user( self ): """Testing manually un-purging a user account""" # Reset the user for later test runs. The user's private Role and DefaultUserPermissions for that role # should have been preserved, so all we need to do is reset purged and deleted. @@ -1688,7 +1727,7 @@ regular_user3.purged = False regular_user3.deleted = False regular_user3.flush() - def test_255_purge_group( self ): + def test_260_purge_group( self ): """Testing purging a group""" group_id = str( group_two.id ) self.mark_group_deleted( group_id, group_two.name ) @@ -1703,7 +1742,7 @@ raise AssertionError( "Purging the group did not delete the GroupRoleAssociations for group_id '%s'" % group_id ) # Undelete the group for later test runs self.undelete_group( group_id, group_two.name ) - def test_260_purge_role( self ): + def test_265_purge_role( self ): """Testing purging a role""" role_id = str( role_two.id ) self.mark_role_deleted( role_id, role_two.name ) @@ -1728,14 +1767,14 @@ dp = galaxy.model.DatasetPermissions.filter( galaxy.model.DatasetPermissions.table.c.role_id == role_id ).all() if dp: raise AssertionError( "Purging the role did not delete the DatasetPermissionss for role_id '%s'" % role_id ) - def test_265_manually_unpurge_role( self ): + def test_270_manually_unpurge_role( self ): """Testing manually un-purging a role""" # Manually unpurge, then undelete the role for later test runs # TODO: If we decide to implement the GUI feature for un-purging a role, replace this with a method call role_two.purged = False role_two.flush() self.undelete_role( str( role_two.id ), role_two.name ) - def test_270_purge_library( self ): + def test_275_purge_library( self ): """Testing purging a library""" self.home() self.delete_library_item( str( library_one.id ), str( library_one.id ), library_one.name, library_item_type='library' ) @@ -1771,7 +1810,7 @@ raise AssertionError( 'The library_dataset id %s named "%s" has not been marked as deleted.' % \ ( str( library_dataset.id ), library_dataset.name ) ) check_folder( library_one.root_folder ) - def test_275_reset_data_for_later_test_runs( self ): + def test_280_reset_data_for_later_test_runs( self ): """Reseting data to enable later test runs to pass""" ################## # Eliminate all non-private roles diff -r c44567359a03 -r e899101e63d1 universe_wsgi.ini.sample --- a/universe_wsgi.ini.sample Fri Jun 12 09:56:23 2009 -0400 +++ b/universe_wsgi.ini.sample Tue Jun 16 09:55:15 2009 -0400 @@ -55,9 +55,13 @@ # Galaxy session security id_secret = changethisinproductiontoo -# Files in directories under this directory can be directly imported through -# the library admin's "add dataset" tool +# Directories of files contained in the following directory can be uploaded to a library from the Admin view #library_import_dir = /var/opt/galaxy/import +# The following can be configured to allow non-admin users to upload a directory of files. The +# configured directory must contain sub-directories named the same as the non-admin user's Galaxy +# login ( email ). The non-admin user is restricted to uploading files or sub-directories of files +# contained in their directory. +# user_library_import_dir = /var/opt/galaxy/import/users # path to sendmail sendmail_path = /usr/sbin/sendmail
participants (1)
-
Greg Von Kuster