4 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/0a3c911778ae/ Changeset: 0a3c911778ae User: jmchilton Date: 2013-04-16 04:48:52 Summary: Consolidate logic for determining user's FTP directory. Affected #: 3 files diff -r 788cd3d065413b2611d82375a5d0d562775ea529 -r 0a3c911778aebded1d40c5e12b05959a761a0276 lib/galaxy/tools/parameters/basic.py --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -475,7 +475,7 @@ if trans is None or trans.user is None: user_ftp_dir = None else: - user_ftp_dir = os.path.join( trans.app.config.ftp_upload_dir, trans.user.email ) + user_ftp_dir = trans.user_ftp_dir return form_builder.FTPFileField( self.name, user_ftp_dir, trans.app.config.ftp_upload_site, value = value ) def from_html( self, value, trans=None, other_values={} ): try: diff -r 788cd3d065413b2611d82375a5d0d562775ea529 -r 0a3c911778aebded1d40c5e12b05959a761a0276 lib/galaxy/tools/parameters/grouping.py --- a/lib/galaxy/tools/parameters/grouping.py +++ b/lib/galaxy/tools/parameters/grouping.py @@ -270,7 +270,7 @@ if file_bunch.path and ftp_files is not None: warnings.append( "All FTP uploaded file selections were ignored." ) elif ftp_files is not None and trans.user is not None: # look for files uploaded via FTP - user_ftp_dir = os.path.join( trans.app.config.ftp_upload_dir, trans.user.email ) + user_ftp_dir = trans.user_ftp_dir for ( dirpath, dirnames, filenames ) in os.walk( user_ftp_dir ): for filename in filenames: for ftp_filename in ftp_files: @@ -318,7 +318,7 @@ ftp_files = [] # TODO: warning to the user (could happen if session has become invalid) else: - user_ftp_dir = os.path.join( trans.app.config.ftp_upload_dir, trans.user.email ) + user_ftp_dir = trans.user_ftp_dir for ( dirpath, dirnames, filenames ) in os.walk( user_ftp_dir ): for filename in filenames: path = relpath( os.path.join( dirpath, filename ), user_ftp_dir ) diff -r 788cd3d065413b2611d82375a5d0d562775ea529 -r 0a3c911778aebded1d40c5e12b05959a761a0276 lib/galaxy/web/framework/__init__.py --- a/lib/galaxy/web/framework/__init__.py +++ b/lib/galaxy/web/framework/__init__.py @@ -958,6 +958,10 @@ def ncbi_builds( self ): return util.dlnames['ncbi'] + @property + def user_ftp_dir( self ): + return os.path.join( self.app.config.ftp_upload_dir, self.user.email ) + def db_dataset_for( self, dbkey ): """ Returns the db_file dataset associated/needed by `dataset`, or `None`. https://bitbucket.org/galaxy/galaxy-central/commits/0d2a9d0dbd2d/ Changeset: 0d2a9d0dbd2d User: jmchilton Date: 2013-04-16 05:00:14 Summary: Implement new property ftp_uplod_dir_identifier which defaults to 'email' but can be changed to 'username' to allow FTP directories based on usernames instead of e-mail addresses. I setup ProFTP + mod_ldap and it does not have the same flexibility the SQL driver has so this change is required at the Galaxy level. Affected #: 2 files diff -r 0a3c911778aebded1d40c5e12b05959a761a0276 -r 0d2a9d0dbd2db8a31f570b13acaf0caa9b245b09 lib/galaxy/config.py --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -166,6 +166,7 @@ self.enable_whoosh_library_search = string_as_bool( kwargs.get( 'enable_whoosh_library_search', False ) ) self.whoosh_index_dir = resolve_path( kwargs.get( "whoosh_index_dir", "database/whoosh_indexes" ), self.root ) self.ftp_upload_dir = kwargs.get( 'ftp_upload_dir', None ) + self.ftp_upload_dir_identifier = kwargs.get( 'ftp_uplod_dir_identifier', 'email' ) # attribute on user - email, username, id, etc... self.ftp_upload_site = kwargs.get( 'ftp_upload_site', None ) self.allow_library_path_paste = kwargs.get( 'allow_library_path_paste', False ) self.disable_library_comptypes = kwargs.get( 'disable_library_comptypes', '' ).lower().split( ',' ) diff -r 0a3c911778aebded1d40c5e12b05959a761a0276 -r 0d2a9d0dbd2db8a31f570b13acaf0caa9b245b09 lib/galaxy/web/framework/__init__.py --- a/lib/galaxy/web/framework/__init__.py +++ b/lib/galaxy/web/framework/__init__.py @@ -960,7 +960,8 @@ @property def user_ftp_dir( self ): - return os.path.join( self.app.config.ftp_upload_dir, self.user.email ) + identifier = self.app.config.ftp_upload_dir_identifier + return os.path.join( self.app.config.ftp_upload_dir, getattr(self.user, identifier) ) def db_dataset_for( self, dbkey ): """ https://bitbucket.org/galaxy/galaxy-central/commits/8b74c635ca3b/ Changeset: 8b74c635ca3b User: jmchilton Date: 2013-04-16 14:44:54 Summary: Fix typo in previous FTP upload commit. Affected #: 1 file diff -r 0d2a9d0dbd2db8a31f570b13acaf0caa9b245b09 -r 8b74c635ca3bb266eb0ad2b08aa17836e500add2 lib/galaxy/config.py --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -166,7 +166,7 @@ self.enable_whoosh_library_search = string_as_bool( kwargs.get( 'enable_whoosh_library_search', False ) ) self.whoosh_index_dir = resolve_path( kwargs.get( "whoosh_index_dir", "database/whoosh_indexes" ), self.root ) self.ftp_upload_dir = kwargs.get( 'ftp_upload_dir', None ) - self.ftp_upload_dir_identifier = kwargs.get( 'ftp_uplod_dir_identifier', 'email' ) # attribute on user - email, username, id, etc... + self.ftp_upload_dir_identifier = kwargs.get( 'ftp_upload_dir_identifier', 'email' ) # attribute on user - email, username, id, etc... self.ftp_upload_site = kwargs.get( 'ftp_upload_site', None ) self.allow_library_path_paste = kwargs.get( 'allow_library_path_paste', False ) self.disable_library_comptypes = kwargs.get( 'disable_library_comptypes', '' ).lower().split( ',' ) https://bitbucket.org/galaxy/galaxy-central/commits/e0354c9d5497/ Changeset: e0354c9d5497 User: natefoo Date: 2013-04-16 22:17:33 Summary: Merged in jmchilton/galaxy-central-multi-input-tool-fixes-2 (pull request #157) Increased flexibility for FTP directory configuration. Affected #: 4 files diff -r bbb229927c688213e67ba62998a64526ca948a19 -r e0354c9d5497fa9d169df6a7aa44c8132718f92c lib/galaxy/config.py --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -166,6 +166,7 @@ self.enable_whoosh_library_search = string_as_bool( kwargs.get( 'enable_whoosh_library_search', False ) ) self.whoosh_index_dir = resolve_path( kwargs.get( "whoosh_index_dir", "database/whoosh_indexes" ), self.root ) self.ftp_upload_dir = kwargs.get( 'ftp_upload_dir', None ) + self.ftp_upload_dir_identifier = kwargs.get( 'ftp_upload_dir_identifier', 'email' ) # attribute on user - email, username, id, etc... self.ftp_upload_site = kwargs.get( 'ftp_upload_site', None ) self.allow_library_path_paste = kwargs.get( 'allow_library_path_paste', False ) self.disable_library_comptypes = kwargs.get( 'disable_library_comptypes', '' ).lower().split( ',' ) diff -r bbb229927c688213e67ba62998a64526ca948a19 -r e0354c9d5497fa9d169df6a7aa44c8132718f92c lib/galaxy/tools/parameters/basic.py --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -475,7 +475,7 @@ if trans is None or trans.user is None: user_ftp_dir = None else: - user_ftp_dir = os.path.join( trans.app.config.ftp_upload_dir, trans.user.email ) + user_ftp_dir = trans.user_ftp_dir return form_builder.FTPFileField( self.name, user_ftp_dir, trans.app.config.ftp_upload_site, value = value ) def from_html( self, value, trans=None, other_values={} ): try: diff -r bbb229927c688213e67ba62998a64526ca948a19 -r e0354c9d5497fa9d169df6a7aa44c8132718f92c lib/galaxy/tools/parameters/grouping.py --- a/lib/galaxy/tools/parameters/grouping.py +++ b/lib/galaxy/tools/parameters/grouping.py @@ -270,7 +270,7 @@ if file_bunch.path and ftp_files is not None: warnings.append( "All FTP uploaded file selections were ignored." ) elif ftp_files is not None and trans.user is not None: # look for files uploaded via FTP - user_ftp_dir = os.path.join( trans.app.config.ftp_upload_dir, trans.user.email ) + user_ftp_dir = trans.user_ftp_dir for ( dirpath, dirnames, filenames ) in os.walk( user_ftp_dir ): for filename in filenames: for ftp_filename in ftp_files: @@ -318,7 +318,7 @@ ftp_files = [] # TODO: warning to the user (could happen if session has become invalid) else: - user_ftp_dir = os.path.join( trans.app.config.ftp_upload_dir, trans.user.email ) + user_ftp_dir = trans.user_ftp_dir for ( dirpath, dirnames, filenames ) in os.walk( user_ftp_dir ): for filename in filenames: path = relpath( os.path.join( dirpath, filename ), user_ftp_dir ) diff -r bbb229927c688213e67ba62998a64526ca948a19 -r e0354c9d5497fa9d169df6a7aa44c8132718f92c lib/galaxy/web/framework/__init__.py --- a/lib/galaxy/web/framework/__init__.py +++ b/lib/galaxy/web/framework/__init__.py @@ -960,6 +960,11 @@ def ncbi_builds( self ): return util.dlnames['ncbi'] + @property + def user_ftp_dir( self ): + identifier = self.app.config.ftp_upload_dir_identifier + return os.path.join( self.app.config.ftp_upload_dir, getattr(self.user, identifier) ) + def db_dataset_for( self, dbkey ): """ Returns the db_file dataset associated/needed by `dataset`, or `None`. 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.