More documentation and flexibility for configuring FTP imports.

- Add missing documentation for the ftp_upload_dir_identifier option.
 - Add ftp_upload_dir_template option to configure how to combine identifier and base directory to generate an ftp upload directory.
This commit is contained in:
John Chilton
2016-04-14 11:34:21 -04:00
parent 54173807e5
commit f95cbf8f38
3 changed files with 20 additions and 4 deletions
+11 -1
View File
@@ -1013,13 +1013,23 @@ use_interactive = True
# database for authentication) and set the following two options.
# This should point to a directory containing subdirectories matching users'
# email addresses, where Galaxy will look for files.
# identifer (defaults to e-mail), where Galaxy will look for files.
#ftp_upload_dir = None
# This should be the hostname of your FTP server, which will be provided to
# users in the help text.
#ftp_upload_site = None
# User attribute to use as subdirectory in calculating default ftp_upload_dir
# pattern. By default this will be email so a user's FTP upload directory will be
# ${ftp_upload_dir}/${user.email}. Can set this to other attributes such as id or
# username though.
#ftp_upload_dir_identifier = email
# Python string tempalte used to determine an FTP upload directory for a
# particular user.
#ftp_upload_dir_template = ${ftp_upload_dir}/${ftp_upload_dir_identifier}
# Enable enforcement of quotas. Quotas can be set from the Admin interface.
#enable_quotas = False
+1
View File
@@ -292,6 +292,7 @@ class Configuration( object ):
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_dir_template = kwargs.get( 'ftp_upload_dir_template', '${ftp_upload_dir}%s${ftp_upload_dir_identifier}' % os.path.sep )
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( ',' )
+8 -3
View File
@@ -2,8 +2,8 @@
Mixins for transaction-like objects.
"""
import os
from json import dumps
import string
from galaxy.util import bunch
@@ -139,12 +139,17 @@ class ProvidesUserContext( object ):
@property
def user_ftp_dir( self ):
identifier = self.app.config.ftp_upload_dir_identifier
base_dir = self.app.config.ftp_upload_dir
if base_dir is None:
return None
else:
return os.path.join( base_dir, getattr( self.user, identifier ) )
identifier = self.app.config.ftp_upload_dir_identifier
template = self.app.config.ftp_upload_dir_template
path = string.Template(template).safe_substitute(dict(
ftp_upload_dir=base_dir,
ftp_upload_dir_identifier=identifier,
))
return path
class ProvidesHistoryContext( object ):