galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
November 2011
- 1 participants
- 121 discussions
commit/galaxy-central: greg: Remove the old template_path setting from community_wsgi.ini. since it is set incorrecly and not neede anyway.
by Bitbucket 25 Nov '11
by Bitbucket 25 Nov '11
25 Nov '11
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/31932fa8c0e1/
changeset: 31932fa8c0e1
user: greg
date: 2011-11-25 15:24:58
summary: Remove the old template_path setting from community_wsgi.ini. since it is set incorrecly and not neede anyway.
affected #: 1 file
diff -r ab90893a7cf51e272cafa97b4702d32edb44223f -r 31932fa8c0e1e2f84c54107356487ec427d2a521 community_wsgi.ini.sample
--- a/community_wsgi.ini.sample
+++ b/community_wsgi.ini.sample
@@ -26,9 +26,6 @@
# Temporary storage for additional datasets, this should be shared through the cluster
new_file_path = database/tmp
-# Where templates are stored
-template_path = lib/galaxy/webapps/community/templates
-
# Session support (beaker)
use_beaker_session = True
session_type = memory
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.
1
0
23 Nov '11
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/ab90893a7cf5/
changeset: ab90893a7cf5
user: greg
date: 2011-11-23 22:16:15
summary: Re-engineer the datatypes registry so that it is initialized once when the Galaxy server is started, but data types can continue to be loaded throughout the Galaxy server's session (hopefully this doesn't break anything).
Add support for a single "import_module" to be passed to the new load_datatypes() method in the datatypes registry. This provides the ability to load a single class module from an installed tool shed repository along with a datatypes_conf.xml file included in the installed repository and pass them to the new load_datatypes() method. In the future, multiple imported modules may be allowed. The datatypes_conf.xml file included in the repository must conform to a slightly different definition than the same named file that comes with the distribution. This new definition will be documented in the Galaxy tool shed wiki.
We now have the ability to load new data types into the Galaxy server from an installed tool shed repository without restarting the Galaxy server.
affected #: 12 files
diff -r 856aac70b018de6a748cf49355677d4dbe27ddf6 -r ab90893a7cf51e272cafa97b4702d32edb44223f lib/galaxy/app.py
--- a/lib/galaxy/app.py
+++ b/lib/galaxy/app.py
@@ -22,7 +22,8 @@
self.config.check()
config.configure_logging( self.config )
# Set up datatypes registry
- self.datatypes_registry = galaxy.datatypes.registry.Registry( self.config.root, self.config.datatypes_config )
+ self.datatypes_registry = galaxy.datatypes.registry.Registry()
+ self.datatypes_registry.load_datatypes( self.config.root, self.config.datatypes_config )
galaxy.model.set_datatypes_registry( self.datatypes_registry )
# Set up the tool sheds registry
if os.path.isfile( self.config.tool_sheds_config ):
diff -r 856aac70b018de6a748cf49355677d4dbe27ddf6 -r ab90893a7cf51e272cafa97b4702d32edb44223f lib/galaxy/datatypes/registry.py
--- a/lib/galaxy/datatypes/registry.py
+++ b/lib/galaxy/datatypes/registry.py
@@ -12,7 +12,7 @@
pass
class Registry( object ):
- def __init__( self, root_dir=None, config=None ):
+ def __init__( self ):
self.log = logging.getLogger(__name__)
self.log.addHandler( logging.NullHandler() )
self.datatypes_by_extension = {}
@@ -27,21 +27,33 @@
self.sniff_order = []
self.upload_file_formats = []
self.display_applications = odict() #map a display application id to a display application
- inherit_display_application_by_class = []
+ self.datatype_converters_path = None
+ self.datatype_indexers_path = None
+ self.display_applications_path = None
+ def load_datatypes( self, root_dir=None, config=None, imported_module=None ):
if root_dir and config:
+ inherit_display_application_by_class = []
# Parse datatypes_conf.xml
tree = galaxy.util.parse_xml( config )
root = tree.getroot()
# Load datatypes and converters from config
self.log.debug( 'Loading datatypes from %s' % config )
registration = root.find( 'registration' )
- self.datatype_converters_path = os.path.join( root_dir, registration.get( 'converters_path', 'lib/galaxy/datatypes/converters' ) )
- self.datatype_indexers_path = os.path.join( root_dir, registration.get( 'indexers_path', 'lib/galaxy/datatypes/indexers' ) )
- self.display_applications_path = os.path.join( root_dir, registration.get( 'display_path', 'display_applications' ) )
- if not os.path.isdir( self.datatype_converters_path ):
- raise ConfigurationError( "Directory does not exist: %s" % self.datatype_converters_path )
- if not os.path.isdir( self.datatype_indexers_path ):
- raise ConfigurationError( "Directory does not exist: %s" % self.datatype_indexers_path )
+ # The following implementation implies that only the first datatypes_conf.xml parsed will
+ # define the various paths. This is probably ok, since we can justifiably require that the
+ # local datatypes_conf.xml file sets the standard, and all additional datatypes_conf.xml
+ # files installed with repositories from tool sheds must use the same paths. However, we
+ # may discover at some future time that allowing for multiple paths is more optimal.
+ if not self.datatype_converters_path:
+ self.datatype_converters_path = os.path.join( root_dir, registration.get( 'converters_path', 'lib/galaxy/datatypes/converters' ) )
+ if not os.path.isdir( self.datatype_converters_path ):
+ raise ConfigurationError( "Directory does not exist: %s" % self.datatype_converters_path )
+ if not self.datatype_indexers_path:
+ self.datatype_indexers_path = os.path.join( root_dir, registration.get( 'indexers_path', 'lib/galaxy/datatypes/indexers' ) )
+ if not os.path.isdir( self.datatype_indexers_path ):
+ raise ConfigurationError( "Directory does not exist: %s" % self.datatype_indexers_path )
+ if not self.display_applications_path:
+ self.display_applications_path = os.path.join( root_dir, registration.get( 'display_path', 'display_applications' ) )
for elem in registration.findall( 'datatype' ):
try:
extension = elem.get( 'extension', None )
@@ -55,11 +67,14 @@
fields = dtype.split( ':' )
datatype_module = fields[0]
datatype_class_name = fields[1]
- fields = datatype_module.split( '.' )
- module = __import__( fields.pop(0) )
- for mod in fields:
- module = getattr( module, mod )
- datatype_class = getattr( module, datatype_class_name )
+ if imported_module:
+ datatype_class = getattr( imported_module, datatype_class_name )
+ else:
+ fields = datatype_module.split( '.' )
+ module = __import__( fields.pop(0) )
+ for mod in fields:
+ module = getattr( module, mod )
+ datatype_class = getattr( module, datatype_class_name )
elif type_extension:
datatype_class = self.datatypes_by_extension[type_extension].__class__
if make_subclass:
@@ -252,10 +267,8 @@
if not included:
self.sniff_order.append(datatype)
append_to_sniff_order()
-
def get_available_tracks(self):
return self.available_tracks
-
def get_mimetype_by_extension(self, ext, default = 'application/octet-stream' ):
"""Returns a mimetype based on an extension"""
try:
@@ -265,7 +278,6 @@
mimetype = default
self.log.warning('unknown mimetype in data factory %s' % ext)
return mimetype
-
def get_datatype_by_extension(self, ext ):
"""Returns a datatype based on an extension"""
try:
@@ -273,7 +285,6 @@
except KeyError:
builder = data.Text()
return builder
-
def change_datatype(self, data, ext, set_meta = True ):
data.extension = ext
# call init_meta and copy metadata from itself. The datatype
@@ -287,7 +298,6 @@
data.set_meta( overwrite = False )
data.set_peek()
return data
-
def old_change_datatype(self, data, ext):
"""Creates and returns a new datatype based on an existing data and an extension"""
newdata = factory(ext)(id=data.id)
@@ -295,7 +305,6 @@
setattr(newdata, key, value)
newdata.ext = ext
return newdata
-
def load_datatype_converters( self, toolbox ):
"""Adds datatype converters from self.converters to the calling app's toolbox"""
for elem in self.converters:
@@ -312,7 +321,6 @@
self.log.debug( "Loaded converter: %s", converter.id )
except:
self.log.exception( "error reading converter from path: %s" % converter_path )
-
def load_external_metadata_tool( self, toolbox ):
"""Adds a tool which is used to set external metadata"""
#we need to be able to add a job to the queue to set metadata. The queue will currently only accept jobs with an associated tool.
@@ -337,7 +345,6 @@
toolbox.tools_by_id[ set_meta_tool.id ] = set_meta_tool
self.set_external_metadata_tool = set_meta_tool
self.log.debug( "Loaded external metadata tool: %s", self.set_external_metadata_tool.id )
-
def load_datatype_indexers( self, toolbox ):
"""Adds indexers from self.indexers to the toolbox from app"""
for elem in self.indexers:
@@ -347,7 +354,6 @@
toolbox.tools_by_id[indexer.id] = indexer
self.datatype_indexers[datatype] = indexer
self.log.debug( "Loaded indexer: %s", indexer.id )
-
def get_converters_by_datatype(self, ext):
"""Returns available converters by source type"""
converters = odict()
@@ -360,7 +366,6 @@
if ext in self.datatype_converters.keys():
converters.update(self.datatype_converters[ext])
return converters
-
def get_indexers_by_datatype( self, ext ):
"""Returns indexers based on datatype"""
class_chain = list()
@@ -373,14 +378,12 @@
ext2type = lambda x: self.get_datatype_by_extension(x)
class_chain = sorted(class_chain, lambda x,y: issubclass(ext2type(x),ext2type(y)) and -1 or 1)
return [self.datatype_indexers[x] for x in class_chain]
-
def get_converter_by_target_type(self, source_ext, target_ext):
"""Returns a converter based on source and target datatypes"""
converters = self.get_converters_by_datatype(source_ext)
if target_ext in converters.keys():
return converters[target_ext]
return None
-
def find_conversion_destination_for_dataset_by_extensions( self, dataset, accepted_formats, converter_safe = True ):
"""Returns ( target_ext, existing converted dataset )"""
for convert_ext in self.get_converters_by_datatype( dataset.ext ):
@@ -394,10 +397,8 @@
ret_data = None
return ( convert_ext, ret_data )
return ( None, None )
-
def get_composite_extensions( self ):
return [ ext for ( ext, d_type ) in self.datatypes_by_extension.iteritems() if d_type.composite_type is not None ]
-
def get_upload_metadata_params( self, context, group, tool ):
"""Returns dict of case value:inputs for metadata conditional for upload tool"""
rval = {}
@@ -413,4 +414,3 @@
if 'auto' not in rval and 'txt' in rval: #need to manually add 'auto' datatype
rval[ 'auto' ] = rval[ 'txt' ]
return rval
-
diff -r 856aac70b018de6a748cf49355677d4dbe27ddf6 -r ab90893a7cf51e272cafa97b4702d32edb44223f lib/galaxy/datatypes/sniff.py
--- a/lib/galaxy/datatypes/sniff.py
+++ b/lib/galaxy/datatypes/sniff.py
@@ -280,6 +280,7 @@
"""
if sniff_order is None:
datatypes_registry = registry.Registry()
+ datatypes_registry.load_datatypes()
sniff_order = datatypes_registry.sniff_order
for datatype in sniff_order:
"""
diff -r 856aac70b018de6a748cf49355677d4dbe27ddf6 -r ab90893a7cf51e272cafa97b4702d32edb44223f lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -25,7 +25,9 @@
log = logging.getLogger( __name__ )
-datatypes_registry = galaxy.datatypes.registry.Registry() #Default Value Required for unit tests
+datatypes_registry = galaxy.datatypes.registry.Registry()
+# Default Value Required for unit tests
+datatypes_registry.load_datatypes()
class NoConverterException(Exception):
def __init__(self, value):
diff -r 856aac70b018de6a748cf49355677d4dbe27ddf6 -r ab90893a7cf51e272cafa97b4702d32edb44223f lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -1307,7 +1307,9 @@
if tool is None:
#This occurs for things such as unit tests
import galaxy.datatypes.registry
- formats.append( galaxy.datatypes.registry.Registry().get_datatype_by_extension( extension.lower() ).__class__ )
+ datatypes_registry = galaxy.datatypes.registry.Registry()
+ datatypes_registry.load_datatypes()
+ formats.append( datatypes_registry.get_datatype_by_extension( extension.lower() ).__class__ )
else:
formats.append( tool.app.datatypes_registry.get_datatype_by_extension( extension.lower() ).__class__ )
self.formats = tuple( formats )
diff -r 856aac70b018de6a748cf49355677d4dbe27ddf6 -r ab90893a7cf51e272cafa97b4702d32edb44223f lib/galaxy/util/none_like.py
--- a/lib/galaxy/util/none_like.py
+++ b/lib/galaxy/util/none_like.py
@@ -20,7 +20,9 @@
def __init__( self, datatypes_registry = None, ext = 'data', dbkey = '?' ):
self.ext = self.extension = ext
self.dbkey = dbkey
- if datatypes_registry is None: datatypes_registry = Registry()
+ if datatypes_registry is None:
+ datatypes_registry = Registry()
+ datatypes_registry.load_datatypes()
self.datatype = datatypes_registry.get_datatype_by_extension( ext )
self._metadata = None
self.metadata = MetadataCollection( self )
diff -r 856aac70b018de6a748cf49355677d4dbe27ddf6 -r ab90893a7cf51e272cafa97b4702d32edb44223f lib/galaxy/web/controllers/admin.py
--- a/lib/galaxy/web/controllers/admin.py
+++ b/lib/galaxy/web/controllers/admin.py
@@ -4,7 +4,7 @@
from galaxy.web.framework.helpers import time_ago, iff, grids
from galaxy.tools.search import ToolBoxSearch
from galaxy.tools import ToolSection, json_fix
-from galaxy.util import inflector
+from galaxy.util import parse_xml, inflector
import logging
log = logging.getLogger( __name__ )
@@ -874,8 +874,7 @@
tmp_stderr.close()
if returncode == 0:
# Load data types required by tools.
- # TODO: uncomment the following when we're ready...
- #self.__load_datatypes( trans, repo_files_dir )
+ self.__load_datatypes( trans, repo_files_dir )
# Load tools and tool data files required by them.
sample_files, repository_tools_tups = self.__get_repository_tools_and_sample_files( trans, tool_path, repo_files_dir )
if repository_tools_tups:
@@ -898,9 +897,8 @@
persisted_new_tool_section.write( new_tool_section )
persisted_new_tool_section.close()
# Parse the persisted tool panel section
- tree = ElementTree.parse( tmp_name )
+ tree = parse_xml( tmp_name )
root = tree.getroot()
- ElementInclude.include( root )
# Load the tools in the section into the tool panel.
trans.app.toolbox.load_section_tag_set( root, trans.app.toolbox.tool_panel, tool_path )
# Remove the temporary file
@@ -1186,35 +1184,49 @@
datatypes_config = os.path.abspath( os.path.join( root, name ) )
break
if datatypes_config:
+ imported_module = None
# Parse datatypes_config.
- tree = ElementTree.parse( datatypes_config )
- root = tree.getroot()
- ElementInclude.include( root )
- datatype_files = root.find( 'datatype_files' )
+ tree = parse_xml( datatypes_config )
+ datatypes_config_root = tree.getroot()
+ relative_path_to_datatype_file_name = None
+ datatype_files = datatypes_config_root.find( 'datatype_files' )
+ # Currently only a single datatype_file is supported. For example:
+ # <datatype_files>
+ # <datatype_file name="gmap.py"/>
+ # </datatype_files>
for elem in datatype_files.findall( 'datatype_file' ):
datatype_file_name = elem.get( 'name', None )
if datatype_file_name:
# Find the file in the installed repository.
- relative_path = None
for root, dirs, files in os.walk( repo_files_dir ):
if root.find( '.hg' ) < 0:
for name in files:
if name == datatype_file_name:
- relative_path = os.path.join( root, name )
+ relative_path_to_datatype_file_name = os.path.join( root, name )
break
- relative_head, relative_tail = os.path.split( relative_path )
- # TODO: get the import_module by parsing the <registration><datatype> tags
- if datatype_file_name.find( '.' ) > 0:
- import_module = datatype_file_name.split( '.' )[ 0 ]
- else:
- import_module = datatype_file_name
- try:
- sys.path.insert( 0, relative_head )
- module = __import__( import_module )
- sys.path.pop( 0 )
- except Exception, e:
- log.debug( "Exception importing datatypes code file included in installed repository: %s" % str( e ) )
- trans.app.datatypes_registry = galaxy.datatypes.registry.Registry( trans.app.config.root, datatypes_config )
+ break
+ if relative_path_to_datatype_file_name:
+ relative_head, relative_tail = os.path.split( relative_path_to_datatype_file_name )
+ registration = datatypes_config_root.find( 'registration' )
+ # Get the module by parsing the <datatype> tag.
+ for elem in registration.findall( 'datatype' ):
+ # A 'type' attribute is currently required. The attribute
+ # should be something like: type="gmap:GmapDB".
+ dtype = elem.get( 'type', None )
+ if dtype:
+ fields = dtype.split( ':' )
+ datatype_module = fields[0]
+ datatype_class_name = fields[1]
+ # Since we currently support only a single datatype_file,
+ # we have what we need.
+ break
+ try:
+ sys.path.insert( 0, relative_head )
+ imported_module = __import__( datatype_module )
+ sys.path.pop( 0 )
+ except Exception, e:
+ log.debug( "Exception importing datatypes code file included in installed repository: %s" % str( e ) )
+ trans.app.datatypes_registry.load_datatypes( root_dir=trans.app.config.root, config=datatypes_config, imported_module=imported_module )
def __get_repository_tools_and_sample_files( self, trans, tool_path, repo_files_dir ):
# The sample_files list contains all files whose name ends in .sample
sample_files = []
diff -r 856aac70b018de6a748cf49355677d4dbe27ddf6 -r ab90893a7cf51e272cafa97b4702d32edb44223f lib/galaxy/webapps/community/app.py
--- a/lib/galaxy/webapps/community/app.py
+++ b/lib/galaxy/webapps/community/app.py
@@ -15,7 +15,8 @@
self.config.check()
config.configure_logging( self.config )
# Set up datatypes registry
- self.datatypes_registry = galaxy.datatypes.registry.Registry( self.config.root, self.config.datatypes_config )
+ self.datatypes_registry = galaxy.datatypes.registry.Registry()
+ self.datatypes_registry.load_datatypes( self.config.root, self.config.datatypes_config )
# Determine the database url
if self.config.database_connection:
db_url = self.config.database_connection
diff -r 856aac70b018de6a748cf49355677d4dbe27ddf6 -r ab90893a7cf51e272cafa97b4702d32edb44223f scripts/functional_tests.py
--- a/scripts/functional_tests.py
+++ b/scripts/functional_tests.py
@@ -244,7 +244,9 @@
else:
# FIXME: This doesn't work at all now that toolbox requires an 'app' instance
# (to get at datatypes, might just pass a datatype registry directly)
- my_app = bunch.Bunch( datatypes_registry = galaxy.datatypes.registry.Registry() )
+ datatypes_registry = galaxy.datatypes.registry.Registry()
+ datatypes_registry.load_datatypes()
+ my_app = bunch.Bunch( datatypes_registry )
test_toolbox.toolbox = tools.ToolBox( 'tool_conf.xml.test', 'tools', my_app )
# ---- Find tests ---------------------------------------------------------
diff -r 856aac70b018de6a748cf49355677d4dbe27ddf6 -r ab90893a7cf51e272cafa97b4702d32edb44223f scripts/set_metadata.py
--- a/scripts/set_metadata.py
+++ b/scripts/set_metadata.py
@@ -37,7 +37,9 @@
# Set up datatypes registry
config_root = sys.argv.pop( 1 )
datatypes_config = sys.argv.pop( 1 )
- galaxy.model.set_datatypes_registry( galaxy.datatypes.registry.Registry( config_root, datatypes_config ) )
+ datatypes_registry = galaxy.datatypes.registry.Registry()
+ datatypes_registry.load_datatypes( root_dir=config_root, config=datatypes_config )
+ galaxy.model.set_datatypes_registry( datatypes_registry )
job_metadata = sys.argv.pop( 1 )
ext_override = dict()
diff -r 856aac70b018de6a748cf49355677d4dbe27ddf6 -r ab90893a7cf51e272cafa97b4702d32edb44223f tools/data_source/data_source.py
--- a/tools/data_source/data_source.py
+++ b/tools/data_source/data_source.py
@@ -57,7 +57,8 @@
enhanced_handling = True
json_file = open( job_params[ 'job_config' ][ 'TOOL_PROVIDED_JOB_METADATA_FILE' ], 'w' ) #specially named file for output junk to pass onto set metadata
- datatypes_registry = Registry( root_dir = job_params[ 'job_config' ][ 'GALAXY_ROOT_DIR' ], config = job_params[ 'job_config' ][ 'GALAXY_DATATYPES_CONF_FILE' ] )
+ datatypes_registry = Registry()
+ datatypes_registry.load_datatypes( root_dir = job_params[ 'job_config' ][ 'GALAXY_ROOT_DIR' ], config = job_params[ 'job_config' ][ 'GALAXY_DATATYPES_CONF_FILE' ] )
URL = params.get( 'URL', None ) #using exactly URL indicates that only one dataset is being downloaded
URL_method = params.get( 'URL_method', None )
diff -r 856aac70b018de6a748cf49355677d4dbe27ddf6 -r ab90893a7cf51e272cafa97b4702d32edb44223f tools/data_source/upload.py
--- a/tools/data_source/upload.py
+++ b/tools/data_source/upload.py
@@ -369,7 +369,8 @@
output_paths = parse_outputs( sys.argv[4:] )
json_file = open( 'galaxy.json', 'w' )
- registry = Registry( sys.argv[1], sys.argv[2] )
+ registry = Registry()
+ registry.load_datatypes( root_dir=sys.argv[1], config=sys.argv[2] )
for line in open( sys.argv[3], 'r' ):
dataset = from_json_string( line )
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.
1
0
commit/galaxy-central: jgoecks: Trackster: refactor action icon creation and initialization.
by Bitbucket 23 Nov '11
by Bitbucket 23 Nov '11
23 Nov '11
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/856aac70b018/
changeset: 856aac70b018
user: jgoecks
date: 2011-11-23 22:11:39
summary: Trackster: refactor action icon creation and initialization.
affected #: 1 file
diff -r 255f4bde822b4b9b36c1a9074cc6063a47127ff2 -r 856aac70b018de6a748cf49355677d4dbe27ddf6 static/scripts/trackster.js
--- a/static/scripts/trackster.js
+++ b/static/scripts/trackster.js
@@ -677,6 +677,7 @@
this.prefs = this.config.values;
this.drag_handle_class = drag_handle_class;
this.is_overview = false;
+ this.action_icons = {};
// FIXME: this should be a saved setting
this.content_visible = true;
@@ -688,8 +689,10 @@
if (this.header_div) {
this.container_div.append(this.header_div);
- this.icons_div = this.build_icons_div().hide();
- this.header_div.append(this.icons_div);
+ this.icons_div = $("<div/>").css("float", "left").hide().appendTo(this.header_div);
+ this.build_action_icons(this.action_icons_def);
+ this.header_div.append( $("<div style='clear: both'/>") );
+
// Suppress double clicks in header so that they do not impact viz.
this.header_div.dblclick( function(e) { e.stopPropagation(); } );
@@ -706,6 +709,64 @@
}
};
+Drawable.prototype.action_icons_def = [
+ // Hide/show drawable content.
+ {
+ name: "toggle_icon",
+ title: "Hide/show content",
+ css_class: "toggle",
+ on_click_fn: function(drawable) {
+ if ( drawable.content_visible ) {
+ drawable.action_icons.toggle_icon.addClass("toggle-expand").removeClass("toggle");
+ drawable.hide_contents();
+ drawable.content_visible = false;
+ } else {
+ drawable.action_icons.toggle_icon.addClass("toggle").removeClass("toggle-expand");
+ drawable.content_visible = true;
+ drawable.show_contents();
+ }
+ }
+ },
+ // Edit settings.
+ {
+ name: "settings_icon",
+ title: "Edit settings",
+ css_class: "settings-icon",
+ on_click_fn: function(drawable) {
+ var cancel_fn = function() { hide_modal(); $(window).unbind("keypress.check_enter_esc"); },
+ ok_fn = function() {
+ drawable.config.update_from_form( $(".dialog-box") );
+ hide_modal();
+ $(window).unbind("keypress.check_enter_esc");
+ },
+ check_enter_esc = function(e) {
+ if ((e.keyCode || e.which) === 27) { // Escape key
+ cancel_fn();
+ } else if ((e.keyCode || e.which) === 13) { // Enter key
+ ok_fn();
+ }
+ };
+
+ $(window).bind("keypress.check_enter_esc", check_enter_esc);
+ show_modal("Configure", drawable.config.build_form(), {
+ "Cancel": cancel_fn,
+ "OK": ok_fn
+ });
+ }
+ },
+ // Remove.
+ {
+ name: "remove_icon",
+ title: "Remove",
+ css_class: "remove-icon",
+ on_click_fn: function(drawable) {
+ // Tipsy for remove icon must be deleted when drawable is deleted.
+ $(".tipsy").remove();
+ drawable.remove();
+ }
+ }
+];
+
extend(Drawable.prototype, {
init: function() {},
request_draw: function() {},
@@ -749,9 +810,27 @@
*/
build_header_div: function() {},
/**
- * Build drawable's icons div.
+ * Add an action icon to this object. Appends icon unless prepend flag is specified.
*/
- build_icons_div: function() {},
+ add_action_icon: function(name, title, css_class, on_click_fn, prepend) {
+ var drawable = this;
+ this.action_icons[name] = $("<a/>").attr("href", "javascript:void(0);").attr("title", title)
+ .addClass("icon-button").addClass(css_class).tipsy( {gravity: 's'} )
+ .click( function() { on_click_fn(drawable); } )
+ .appendTo(this.icons_div);
+ },
+ /**
+ * Build drawable's icons div from object's icons_dict.
+ */
+ build_action_icons: function(action_icons_def) {
+ // Create icons.
+ var icon_dict;
+ for (var i = 0; i < action_icons_def.length; i++) {
+ icon_dict = action_icons_def[i];
+ this.add_action_icon(icon_dict.name, icon_dict.title, icon_dict.css_class,
+ icon_dict.on_click_fn, icon_dict.prepend);
+ }
+ },
/**
* Update icons.
*/
@@ -880,65 +959,6 @@
this.name_div = $("<div/>").addClass("track-name").text(this.name).appendTo(header_div);
return header_div;
},
- build_icons_div: function() {
- var icons_div = $("<div/>").css("float", "left");
-
- this.toggle_icon = $("<a/>").attr("href", "javascript:void(0);").attr("title", "Hide/show group content")
- .addClass("icon-button toggle").tipsy( {gravity: 's'} )
- .appendTo(icons_div);
- this.settings_icon = $("<a/>").attr("href", "javascript:void(0);").attr("title", "Edit settings")
- .addClass("icon-button settings-icon").tipsy( {gravity: 's'} )
- .appendTo(icons_div);
- this.remove_icon = $("<a/>").attr("href", "javascript:void(0);").attr("title", "Remove")
- .addClass("icon-button remove-icon").tipsy( {gravity: 's'} )
- .appendTo(icons_div);
- var group = this;
-
- // Toggle icon hides or shows the group content.
- this.toggle_icon.click( function() {
- if ( group.content_visible ) {
- group.toggle_icon.addClass("toggle-expand").removeClass("toggle");
- group.hide_contents();
- group.content_visible = false;
- } else {
- group.toggle_icon.addClass("toggle").removeClass("toggle-expand");
- group.content_visible = true;
- group.show_contents();
- }
- });
-
- // Clicking on settings icon opens group config.
- this.settings_icon.click( function() {
- var cancel_fn = function() { hide_modal(); $(window).unbind("keypress.check_enter_esc"); },
- ok_fn = function() {
- group.config.update_from_form( $(".dialog-box") );
- hide_modal();
- $(window).unbind("keypress.check_enter_esc");
- },
- check_enter_esc = function(e) {
- if ((e.keyCode || e.which) === 27) { // Escape key
- cancel_fn();
- } else if ((e.keyCode || e.which) === 13) { // Enter key
- ok_fn();
- }
- };
-
- $(window).bind("keypress.check_enter_esc", check_enter_esc);
- show_modal("Configure Group", group.config.build_form(), {
- "Cancel": cancel_fn,
- "OK": ok_fn
- });
- });
-
- // Clicking on remove icon removes group.
- this.remove_icon.click( function() {
- // Tipsy for remove icon must be deleted when group is deleted.
- $(".tipsy").remove();
- group.remove();
- });
-
- return icons_div;
- },
hide_contents : function () {
this.content_div.hide();
},
@@ -2493,7 +2513,64 @@
this.content_div = $("<div class='track-content'>").appendTo(this.container_div);
this.container.content_div.append(this.container_div);
};
+
extend(Track.prototype, Drawable.prototype, {
+ action_icons_def: [
+ // Change track mode.
+ {
+ name: "mode_icon",
+ title: "Set display mode",
+ css_class: "chevron-expand",
+ on_click_fn: function() {}
+ },
+ // Hide/show content.
+ Drawable.prototype.action_icons_def[0],
+ // Set track as overview.
+ {
+ name: "overview_icon",
+ title: "Set as overview",
+ css_class: "overview-icon",
+ on_click_fn: function() {
+ track.view.set_overview(track);
+ }
+ },
+ // Edit config.
+ Drawable.prototype.action_icons_def[1],
+ // Toggle track filters.
+ {
+ name: "filters_icon",
+ title: "Filters",
+ css_class: "filters-icon",
+ on_click_fn: function(track) {
+ // TODO: update tipsy text.
+ track.filters_div.toggle();
+ track.filters_manager.reset_filters();
+ }
+ },
+ // Toggle track tool.
+ {
+ name: "tools_icon",
+ title: "Tools",
+ css_class: "tools-icon",
+ on_click_fn: function(track) {
+ // TODO: update tipsy text.
+
+ track.dynamic_tool_div.toggle();
+
+ // Update track name.
+ if (track.dynamic_tool_div.is(":visible")) {
+ track.set_name(track.name + track.tool_region_and_parameters_str());
+ }
+ else {
+ track.revert_name();
+ }
+ // HACK: name change modifies icon placement, which leaves tooltip incorrectly placed.
+ $(".tipsy").remove();
+ }
+ },
+ // Remove track.
+ Drawable.prototype.action_icons_def[2]
+ ],
build_container_div: function () {
return $("<div/>").addClass('track').attr("id", "track_" + this.id).css("position", "relative");
},
@@ -2504,38 +2581,17 @@
.attr( "id", this.name.replace(/\s+/g,'-').replace(/[^a-zA-Z0-9\-]/g,'').toLowerCase() );
return header_div;
},
- build_icons_div: function() {
- var icons_div = $("<div/>").css("float", "left");
-
- // Track icons.
- this.mode_icon = $("<a/>").attr("href", "javascript:void(0);").attr("title", "Set display mode")
- .addClass("icon-button chevron-expand").tipsy( {gravity: 's'} ).appendTo(icons_div);
- this.toggle_icon = $("<a/>").attr("href", "javascript:void(0);").attr("title", "Hide/show track content")
- .addClass("icon-button toggle").tipsy( {gravity: 's'} )
- .appendTo(icons_div);
- this.settings_icon = $("<a/>").attr("href", "javascript:void(0);").attr("title", "Edit settings")
- .addClass("icon-button settings-icon").tipsy( {gravity: 's'} )
- .appendTo(icons_div);
- this.overview_icon = $("<a/>").attr("href", "javascript:void(0);").attr("title", "Set as overview")
- .addClass("icon-button overview-icon").tipsy( {gravity: 's'} )
- .appendTo(icons_div);
- this.filters_icon = $("<a/>").attr("href", "javascript:void(0);").attr("title", "Filters")
- .addClass("icon-button filters-icon").tipsy( {gravity: 's'} )
- .appendTo(icons_div).hide();
- this.tools_icon = $("<a/>").attr("href", "javascript:void(0);").attr("title", "Tools")
- .addClass("icon-button tools-icon").tipsy( {gravity: 's'} )
- .appendTo(icons_div).hide();
- this.remove_icon = $("<a/>").attr("href", "javascript:void(0);").attr("title", "Remove")
- .addClass("icon-button remove-icon").tipsy( {gravity: 's'} )
- .appendTo(icons_div);
+ build_action_icons: function() {
+ Drawable.prototype.build_action_icons.call(this, this.action_icons_def);
+
+ // Set up behavior for modes popup.
var track = this;
-
- // Set up behavior for modes popup.
if (track.display_modes !== undefined) {
var init_mode = (track.config && track.config.values['mode'] ?
track.config.values['mode'] : track.display_modes[0]);
track.mode = init_mode;
- this.mode_icon.attr("title", "Set display mode (now: " + track.mode + ")");
+
+ this.action_icons.mode_icon.attr("title", "Set display mode (now: " + track.mode + ")");
var mode_mapping = {};
for (var i = 0, len = track.display_modes.length; i < len; i++) {
@@ -2550,79 +2606,8 @@
}(mode);
}
- make_popupmenu(this.mode_icon, mode_mapping);
+ make_popupmenu(this.action_icons.mode_icon, mode_mapping);
}
-
- // Toggle icon hides or shows the track content.
- this.toggle_icon.click( function() {
- if ( track.content_visible ) {
- track.toggle_icon.addClass("toggle-expand").removeClass("toggle");
- track.hide_contents();
- track.content_visible = false;
- } else {
- track.toggle_icon.addClass("toggle").removeClass("toggle-expand");
- track.content_visible = true;
- track.show_contents();
- }
- });
-
- // Clicking on settings icon opens track config.
- this.settings_icon.click( function() {
- var cancel_fn = function() { hide_modal(); $(window).unbind("keypress.check_enter_esc"); },
- ok_fn = function() {
- track.config.update_from_form( $(".dialog-box") );
- hide_modal();
- $(window).unbind("keypress.check_enter_esc");
- },
- check_enter_esc = function(e) {
- if ((e.keyCode || e.which) === 27) { // Escape key
- cancel_fn();
- } else if ((e.keyCode || e.which) === 13) { // Enter key
- ok_fn();
- }
- };
-
- $(window).bind("keypress.check_enter_esc", check_enter_esc);
- show_modal("Configure Track", track.config.build_form(), {
- "Cancel": cancel_fn,
- "OK": ok_fn
- });
- });
-
- this.overview_icon.click( function() {
- track.view.set_overview(track);
- });
-
- this.filters_icon.click( function() {
- // TODO: update tipsy text.
- track.filters_div.toggle();
- track.filters_manager.reset_filters();
- });
-
- this.tools_icon.click( function() {
- // TODO: update tipsy text.
-
- track.dynamic_tool_div.toggle();
-
- // Update track name.
- if (track.dynamic_tool_div.is(":visible")) {
- track.set_name(track.name + track.tool_region_and_parameters_str());
- }
- else {
- track.revert_name();
- }
- // HACK: name change modifies icon placement, which leaves tooltip incorrectly placed.
- $(".tipsy").remove();
- });
-
- // Clicking on remove icon removes track.
- this.remove_icon.click( function() {
- // Tipsy for remove icon must be deleted when track is deleted.
- $(".tipsy").remove();
- track.remove();
- });
-
- return icons_div;
},
/**
* Hide any elements that are part of the tracks contents area. Should
@@ -2808,7 +2793,7 @@
track.config.values['mode'] = name;
track.tile_cache.clear();
track.request_draw();
- this.mode_icon.attr("title", "Set display mode (now: " + track.mode + ")");
+ this.action_icons.mode_icon.attr("title", "Set display mode (now: " + track.mode + ")");
return track;
},
/**
@@ -2821,20 +2806,20 @@
// Show/hide filter icon.
//
if (track.filters_available > 0) {
- track.filters_icon.show();
+ track.action_icons.filters_icon.show();
}
else {
- track.filters_icon.hide();
+ track.action_icons.filters_icon.hide();
}
//
// Show/hide tool icon.
//
if (track.tool) {
- track.tools_icon.show();
+ track.action_icons.tools_icon.show();
}
else {
- track.tools_icon.hide();
+ track.action_icons.tools_icon.hide();
}
//
@@ -3506,7 +3491,7 @@
} else if ( mode == "summary_tree" ) {
mode = "coverage histogram";
}
- this.mode_icon.attr("title", "Set display mode (now: Auto/" + mode + ")");
+ this.action_icons.mode_icon.attr("title", "Set display mode (now: Auto/" + mode + ")");
}
},
/**
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.
1
0
commit/galaxy-central: greg: More fixes for Galaxy <-> tool shed communication.
by Bitbucket 23 Nov '11
by Bitbucket 23 Nov '11
23 Nov '11
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/255f4bde822b/
changeset: 255f4bde822b
user: greg
date: 2011-11-23 17:24:53
summary: More fixes for Galaxy <-> tool shed communication.
affected #: 3 files
diff -r af8f5887b97768777be91dab8df40bbcd8b8d3c8 -r 255f4bde822b4b9b36c1a9074cc6063a47127ff2 lib/galaxy/web/controllers/admin.py
--- a/lib/galaxy/web/controllers/admin.py
+++ b/lib/galaxy/web/controllers/admin.py
@@ -986,12 +986,11 @@
@web.expose
@web.require_admin
def check_for_updates( self, trans, **kwd ):
+ # Send a request to the relevant tool shed to see if there are any updates.
repository = get_repository( trans, kwd[ 'id' ] )
- galaxy_url = url_for( '', qualified=True )
- # Send a request to the relevant tool shed to see if there are any updates.
- # TODO: Fix this to use url_for to support locally hosted tool sheds.
- url = 'http://%s/repository/check_for_updates?galaxy_url=%s&name=%s&owner=%s&changeset_revision=%s&webapp=galaxy' % \
- ( repository.tool_shed, galaxy_url, repository.name, repository.owner, repository.changeset_revision )
+ tool_shed_url = get_url_from_repository_tool_shed( trans, repository )
+ url = '%s/repository/check_for_updates?galaxy_url=%s&name=%s&owner=%s&changeset_revision=%s&webapp=galaxy' % \
+ ( tool_shed_url, url_for( '', qualified=True ), repository.name, repository.owner, repository.changeset_revision )
return trans.response.send_redirect( url )
@web.expose
@web.require_admin
@@ -1405,3 +1404,17 @@
trans.model.ToolShedRepository.table.c.owner == owner,
trans.model.ToolShedRepository.table.c.changeset_revision == changeset_revision ) ) \
.first()
+def get_url_from_repository_tool_shed( trans, repository ):
+ # The stored value of repository.tool_shed is something like:
+ # toolshed.g2.bx.psu.edu
+ # We need the URL to this tool shed, which is something like:
+ # http://toolshed.g2.bx.psu.edu/
+ for shed_name, shed_url in trans.app.tool_shed_registry.tool_sheds.items():
+ if shed_url.find( repository.tool_shed ) >= 0:
+ if shed_url.endswith( '/' ):
+ shed_url = shed_url.rstrip( '/' )
+ return shed_url
+ # The tool shed from which the repository was originally
+ # installed must no longer be configured in tool_sheds_conf.xml.
+ return None
+
\ No newline at end of file
diff -r af8f5887b97768777be91dab8df40bbcd8b8d3c8 -r 255f4bde822b4b9b36c1a9074cc6063a47127ff2 lib/galaxy/web/controllers/workflow.py
--- a/lib/galaxy/web/controllers/workflow.py
+++ b/lib/galaxy/web/controllers/workflow.py
@@ -1125,7 +1125,7 @@
import_button = True
if tool_shed_url and not import_button:
# Use urllib (send another request to the tool shed) to retrieve the workflow.
- workflow_url = 'http://%s/workflow/import_workflow?repository_metadata_id=%s&workflow_name=%s&webapp=%s&open_for_url=true' % \
+ workflow_url = '%s/workflow/import_workflow?repository_metadata_id=%s&workflow_name=%s&webapp=%s&open_for_url=true' % \
( tool_shed_url, repository_metadata_id, tool_shed_encode( workflow_name ), webapp )
response = urllib2.urlopen( workflow_url )
workflow_text = response.read()
@@ -1197,7 +1197,7 @@
for shed_name, shed_url in trans.app.tool_shed_registry.tool_sheds.items():
if shed_url.endswith( '/' ):
shed_url = shed_url.rstrip( '/' )
- url = '%s/repository/find_tools?galaxy_url=%s&webapp=%s' % ( shed_url, trans.request.host, webapp )
+ url = '%s/repository/find_tools?galaxy_url=%s&webapp=%s' % ( shed_url, url_for( '', qualified=True ), webapp )
if missing_tool_tups:
url += '&tool_id='
for missing_tool_tup in missing_tool_tups:
@@ -1224,8 +1224,7 @@
if tool_shed_url:
# We've received the textual representation of a workflow from a Galaxy tool shed.
message = "Workflow <b>%s</b> imported successfully." % workflow.name
- # TODO: support https in the following url.
- url = 'http://%s/workflow/view_workflow?repository_metadata_id=%s&workflow_name=%s&webapp=%s&message=%s' % \
+ url = '%s/workflow/view_workflow?repository_metadata_id=%s&workflow_name=%s&webapp=%s&message=%s' % \
( tool_shed_url, repository_metadata_id, tool_shed_encode( workflow_name ), webapp, message )
return trans.response.send_redirect( url )
elif installed_repository_file:
diff -r af8f5887b97768777be91dab8df40bbcd8b8d3c8 -r 255f4bde822b4b9b36c1a9074cc6063a47127ff2 lib/galaxy/webapps/community/controllers/workflow.py
--- a/lib/galaxy/webapps/community/controllers/workflow.py
+++ b/lib/galaxy/webapps/community/controllers/workflow.py
@@ -379,9 +379,8 @@
to_file.write( to_json_string( workflow_data ) )
return open( tmp_fname )
galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' )
- # TODO: support https in the following url.
- url = 'http://%s/workflow/import_workflow?tool_shed_url=%s&repository_metadata_id=%s&workflow_name=%s&webapp=%s' % \
- ( galaxy_url, trans.request.host, repository_metadata_id, encode( workflow_name ), webapp )
+ url = '%s/workflow/import_workflow?tool_shed_url=%s&repository_metadata_id=%s&workflow_name=%s&webapp=%s' % \
+ ( galaxy_url, url_for( '', qualified=True ), repository_metadata_id, encode( workflow_name ), webapp )
return trans.response.send_redirect( url )
return trans.response.send_redirect( web.url_for( controller='workflow',
action='view_workflow',
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.
1
0
22 Nov '11
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/af8f5887b977/
changeset: af8f5887b977
user: greg
date: 2011-11-22 23:09:14
summary: Fixes for Galaxy / tool shed communication.
affected #: 2 files
diff -r 9d6a9963b0da21fe3139fcefbd11c1ec6290a529 -r af8f5887b97768777be91dab8df40bbcd8b8d3c8 lib/galaxy/web/controllers/admin.py
--- a/lib/galaxy/web/controllers/admin.py
+++ b/lib/galaxy/web/controllers/admin.py
@@ -774,21 +774,21 @@
@web.require_admin
def find_tools_in_tool_shed( self, trans, **kwd ):
tool_shed_url = kwd[ 'tool_shed_url' ]
- galaxy_url = trans.request.host
+ galaxy_url = url_for( '', qualified=True )
url = '%s/repository/find_tools?galaxy_url=%s&webapp=galaxy' % ( tool_shed_url, galaxy_url )
return trans.response.send_redirect( url )
@web.expose
@web.require_admin
def find_workflows_in_tool_shed( self, trans, **kwd ):
tool_shed_url = kwd[ 'tool_shed_url' ]
- galaxy_url = trans.request.host
+ galaxy_url = url_for( '', qualified=True )
url = '%s/repository/find_workflows?galaxy_url=%s&webapp=galaxy' % ( tool_shed_url, galaxy_url )
return trans.response.send_redirect( url )
@web.expose
@web.require_admin
def browse_tool_shed( self, trans, **kwd ):
tool_shed_url = kwd[ 'tool_shed_url' ]
- galaxy_url = trans.request.host
+ galaxy_url = url_for( '', qualified=True )
url = '%s/repository/browse_valid_repositories?galaxy_url=%s&webapp=galaxy' % ( tool_shed_url, galaxy_url )
return trans.response.send_redirect( url )
@web.expose
@@ -986,11 +986,10 @@
@web.expose
@web.require_admin
def check_for_updates( self, trans, **kwd ):
- params = util.Params( kwd )
repository = get_repository( trans, kwd[ 'id' ] )
- galaxy_url = trans.request.host
+ galaxy_url = url_for( '', qualified=True )
# Send a request to the relevant tool shed to see if there are any updates.
- # TODO: support https in the following url.
+ # TODO: Fix this to use url_for to support locally hosted tool sheds.
url = 'http://%s/repository/check_for_updates?galaxy_url=%s&name=%s&owner=%s&changeset_revision=%s&webapp=galaxy' % \
( repository.tool_shed, galaxy_url, repository.name, repository.owner, repository.changeset_revision )
return trans.response.send_redirect( url )
@@ -1215,7 +1214,7 @@
module = __import__( import_module )
sys.path.pop( 0 )
except Exception, e:
- log.debug( "Execption importing datatypes code file included in installed repository: %s" % str( e ) )
+ log.debug( "Exception importing datatypes code file included in installed repository: %s" % str( e ) )
trans.app.datatypes_registry = galaxy.datatypes.registry.Registry( trans.app.config.root, datatypes_config )
def __get_repository_tools_and_sample_files( self, trans, tool_path, repo_files_dir ):
# The sample_files list contains all files whose name ends in .sample
@@ -1398,10 +1397,11 @@
trans.model.ToolShedRepository.table.c.changeset_revision == changeset_revision ) ) \
.first()
def get_repository_by_shed_name_owner_changeset_revision( trans, tool_shed, name, owner, changeset_revision ):
+ if tool_shed.find( '//' ) > 0:
+ tool_shed = tool_shed.split( '//' )[1]
return trans.sa_session.query( trans.model.ToolShedRepository ) \
.filter( and_( trans.model.ToolShedRepository.table.c.tool_shed == tool_shed,
trans.model.ToolShedRepository.table.c.name == name,
trans.model.ToolShedRepository.table.c.owner == owner,
trans.model.ToolShedRepository.table.c.changeset_revision == changeset_revision ) ) \
.first()
-
diff -r 9d6a9963b0da21fe3139fcefbd11c1ec6290a529 -r af8f5887b97768777be91dab8df40bbcd8b8d3c8 lib/galaxy/webapps/community/controllers/repository.py
--- a/lib/galaxy/webapps/community/controllers/repository.py
+++ b/lib/galaxy/webapps/community/controllers/repository.py
@@ -437,9 +437,8 @@
if operation == "install":
galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' )
encoded_repo_info_dict = self.__encode_repo_info_dict( trans, webapp, util.listify( item_id ) )
- # TODO: support https in the following url.
- url = 'http://%s/admin/install_tool_shed_repository?tool_shed_url=%s&webapp=%s&repo_info_dict=%s' % \
- ( galaxy_url, trans.request.host, webapp, encoded_repo_info_dict )
+ url = '%s/admin/install_tool_shed_repository?tool_shed_url=%s&webapp=%s&repo_info_dict=%s' % \
+ ( galaxy_url, url_for( '', qualified=True ), webapp, encoded_repo_info_dict )
return trans.response.send_redirect( url )
else:
# This can only occur when there is a multi-select grid with check boxes and an operation,
@@ -514,9 +513,8 @@
if operation == "install":
galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' )
encoded_repo_info_dict = self.__encode_repo_info_dict( trans, webapp, util.listify( item_id ) )
- # TODO: support https in the following url.
- url = 'http://%s/admin/install_tool_shed_repository?tool_shed_url=%s&webapp=%s&repo_info_dict=%s' % \
- ( galaxy_url, trans.request.host, webapp, encoded_repo_info_dict )
+ url = '%s/admin/install_tool_shed_repository?tool_shed_url=%s&webapp=%s&repo_info_dict=%s' % \
+ ( galaxy_url, url_for( '', qualified=True ), webapp, encoded_repo_info_dict )
return trans.response.send_redirect( url )
else:
# This can only occur when there is a multi-select grid with check boxes and an operation,
@@ -761,9 +759,8 @@
repo_info_dict[ repository.name ] = ( repository.description, repository_clone_url, changeset_revision )
encoded_repo_info_dict = encode( repo_info_dict )
# Redirect back to local Galaxy to perform install.
- # TODO: support https in the following url.
- url = 'http://%s/admin/install_tool_shed_repository?tool_shed_url=%s&repo_info_dict=%s' % \
- ( galaxy_url, trans.request.host, encoded_repo_info_dict )
+ url = '%s/admin/install_tool_shed_repository?tool_shed_url=%s&repo_info_dict=%s' % \
+ ( galaxy_url, url_for( '', qualified=True ), encoded_repo_info_dict )
return trans.response.send_redirect( url )
@web.expose
def check_for_updates( self, trans, **kwd ):
@@ -776,8 +773,7 @@
changeset_revision = params.get( 'changeset_revision', None )
webapp = params.get( 'webapp', 'community' )
# Start building up the url to redirect back to the calling Galaxy instance.
- # TODO: support https in the following url.
- url = 'http://%s/admin/update_to_changeset_revision?tool_shed_url=%s' % ( galaxy_url, trans.request.host )
+ url = '%s/admin/update_to_changeset_revision?tool_shed_url=%s' % ( galaxy_url, url_for( '', qualified=True ) )
repository = get_repository_by_name_and_owner( trans, name, owner )
url += '&name=%s&owner=%s&changeset_revision=%s&latest_changeset_revision=' % \
( repository.name, repository.user.username, changeset_revision )
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.
1
0
commit/galaxy-central: dan: Have fimo.xml use fields.path approach instead of directly filtering on data table.
by Bitbucket 22 Nov '11
by Bitbucket 22 Nov '11
22 Nov '11
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/9d6a9963b0da/
changeset: 9d6a9963b0da
user: dan
date: 2011-11-22 18:21:05
summary: Have fimo.xml use fields.path approach instead of directly filtering on data table.
affected #: 1 file
diff -r 49c48236f6ae2d8557420b1393fd763ce5f28889 -r 9d6a9963b0da21fe3139fcefbd11c1ec6290a529 tools/meme/fimo.xml
--- a/tools/meme/fimo.xml
+++ b/tools/meme/fimo.xml
@@ -32,7 +32,7 @@
#if str( $fasta_type.fasta_type_selector ) == 'history':
"${fasta_type.input_database}"
#else:
- "${ filter( lambda x: str( x[0] ) == str( $fasta_type.input_database ), $__app__.tool_data_tables[ 'all_fasta' ].get_fields() )[0][3] }"
+ "${fasta_type.input_database.fields.path}"
#end if
'
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.
1
0
commit/galaxy-central: dan: Have rgPicardGCBiasMetrics.xml use fields.path approach instead of directly filtering on data table.
by Bitbucket 22 Nov '11
by Bitbucket 22 Nov '11
22 Nov '11
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/49c48236f6ae/
changeset: 49c48236f6ae
user: dan
date: 2011-11-22 17:56:53
summary: Have rgPicardGCBiasMetrics.xml use fields.path approach instead of directly filtering on data table.
affected #: 1 file
diff -r 84187b357d0c6b5bf0c2d9bab5609c10143efb75 -r 49c48236f6ae2d8557420b1393fd763ce5f28889 tools/picard/rgPicardGCBiasMetrics.xml
--- a/tools/picard/rgPicardGCBiasMetrics.xml
+++ b/tools/picard/rgPicardGCBiasMetrics.xml
@@ -4,9 +4,9 @@
--windowsize "$windowsize" --mingenomefrac "$mingenomefrac" -n "$out_prefix" --tmpdir "${__new_file_path__}"
-j ${GALAXY_DATA_INDEX_DIR}/shared/jars/picard/CollectGcBiasMetrics.jar
#if $genomeSource.refGenomeSource == "history":
- --ref-file "$genomeSource.ownFile"
+ --ref-file "${genomeSource.ownFile}"
#else:
- --ref "${ filter( lambda x: str( x[0] ) == str( $genomeSource.index ), $__app__.tool_data_tables[ 'all_fasta' ].get_fields() )[0][-1] }"
+ --ref "${genomeSource.index.fields.path}"
#end if
</command><requirements><requirement type="package">picard</requirement></requirements>
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.
1
0
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/84187b357d0c/
changeset: 84187b357d0c
user: greg
date: 2011-11-22 17:05:38
summary: Enhance User preferences within a Galaxy tool shed to enable users to elect to receive email when content is first uploaded to a new repository. Also add a new grid interface to enable users to easily manage registering with any tool shed respositories to receive email when changes are made to the selected repositories.
affected #: 11 files
diff -r 843fdc5e0ebdc2eafcf97b64c8191b5564ea1836 -r 84187b357d0c6b5bf0c2d9bab5609c10143efb75 lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -166,7 +166,7 @@
"""Factory method to create parameter of correct type"""
param_name = param.get( "name" )
if not param_name:
- raise ValueError( "Tool parameters require a 'name'" )
+ raise ValueError( "Tool parameter '%s' requires a 'name'" % (param_name ) )
param_type = param.get("type")
if not param_type:
raise ValueError( "Tool parameter '%s' requires a 'type'" % ( param_name ) )
diff -r 843fdc5e0ebdc2eafcf97b64c8191b5564ea1836 -r 84187b357d0c6b5bf0c2d9bab5609c10143efb75 lib/galaxy/webapps/community/controllers/admin.py
--- a/lib/galaxy/webapps/community/controllers/admin.py
+++ b/lib/galaxy/webapps/community/controllers/admin.py
@@ -475,6 +475,7 @@
kwd[ 'f-Category.name' ] = category.name
elif operation == "receive email alerts":
if kwd[ 'id' ]:
+ kwd[ 'caller' ] = 'browse_repositories'
return trans.response.send_redirect( web.url_for( controller='repository',
action='set_email_alerts',
**kwd ) )
diff -r 843fdc5e0ebdc2eafcf97b64c8191b5564ea1836 -r 84187b357d0c6b5bf0c2d9bab5609c10143efb75 lib/galaxy/webapps/community/controllers/common.py
--- a/lib/galaxy/webapps/community/controllers/common.py
+++ b/lib/galaxy/webapps/community/controllers/common.py
@@ -12,6 +12,28 @@
log = logging.getLogger( __name__ )
+new_repo_email_alert_template = """
+GALAXY TOOL SHED NEW REPOSITORY ALERT
+-----------------------------------------------------------------------------
+You received this alert because you registered to receive email when
+new repositories were created in the Galaxy tool shed named "${host}".
+-----------------------------------------------------------------------------
+
+Repository name: ${repository_name}
+Date content uploaded: ${display_date}
+Uploaded by: ${username}
+
+Revision: ${revision}
+Change description:
+${description}
+
+${content_alert_str}
+
+-----------------------------------------------------------------------------
+This change alert was sent from the Galaxy tool shed hosted on the server
+"${host}"
+"""
+
email_alert_template = """
GALAXY TOOL SHED REPOSITORY UPDATE ALERT
-----------------------------------------------------------------------------
@@ -464,7 +486,7 @@
except Exception, e:
invalid_files.append( ( name, str( e ) ) )
return metadata_dict, invalid_files
-def set_repository_metadata( trans, id, changeset_revision, **kwd ):
+def set_repository_metadata( trans, id, changeset_revision, content_alert_str='', **kwd ):
"""Set repository metadata"""
message = ''
status = 'done'
@@ -484,6 +506,9 @@
repository_metadata = trans.model.RepositoryMetadata( repository.id, changeset_revision, metadata_dict )
trans.sa_session.add( repository_metadata )
trans.sa_session.flush()
+ # If this is the first record stored for this repository, see if we need to send any email alerts.
+ if len( repository.downloadable_revisions ) == 1:
+ handle_email_alerts( trans, repository, content_alert_str='', new_repo_alert=True, admin_only=False )
else:
# Update the last saved repository_metadata table row.
repository_metadata = get_latest_repository_metadata( trans, id )
@@ -557,11 +582,31 @@
def get_user( trans, id ):
"""Get a user from the database by id"""
return trans.sa_session.query( trans.model.User ).get( trans.security.decode_id( id ) )
-def handle_email_alerts( trans, repository, content_alert_str='' ):
+def handle_email_alerts( trans, repository, content_alert_str='', new_repo_alert=False, admin_only=False ):
+ # There are 2 complementary features that enable a tool shed user to receive email notification:
+ # 1. Within User Preferences, they can elect to receive email when the first (or first valid)
+ # change set is produced for a new repository.
+ # 2. When viewing or managing a repository, they can check the box labeled "Receive email alerts"
+ # which caused them to receive email alerts when updates to the repository occur. This same feature
+ # is available on a per-repository basis on the repository grid within the tool shed.
+ #
+ # There are currently 4 scenarios for sending email notification when a change is made to a repository:
+ # 1. An admin user elects to receive email when the first change set is produced for a new repository
+ # from User Preferences. The change set does not have to include any valid content. This allows for
+ # the capture of inappropriate content being uploaded to new repositories.
+ # 2. A regular user elects to receive email when the first valid change set is produced for a new repository
+ # from User Preferences. This differs from 1 above in that the user will not receive email until a
+ # change set tha tincludes valid content is produced.
+ # 3. An admin user checks the "Receive email alerts" check box on the manage repository page. Since the
+ # user is an admin user, the email will include information about both HTML and image content that was
+ # included in the change set.
+ # 4. A regular user checks the "Receive email alerts" check box on the manage repository page. Since the
+ # user is not an admin user, the email will not include any information about both HTML and image content
+ # that was included in the change set.
repo_dir = repository.repo_path
repo = hg.repository( get_configured_ui(), repo_dir )
smtp_server = trans.app.config.smtp_server
- if smtp_server and repository.email_alerts:
+ if smtp_server and ( new_repo_alert or repository.email_alerts ):
# Send email alert to users that want them.
if trans.app.config.email_from is not None:
email_from = trans.app.config.email_from
@@ -580,26 +625,40 @@
username = ctx.user()
# We'll use 2 template bodies because we only want to send content
# alerts to tool shed admin users.
- admin_body = string.Template( email_alert_template ) \
- .safe_substitute( host=trans.request.host,
- repository_name=repository.name,
- revision='%s:%s' %( str( ctx.rev() ), ctx ),
- display_date=display_date,
- description=ctx.description(),
- username=username,
- content_alert_str=content_alert_str )
- body = string.Template( email_alert_template ) \
- .safe_substitute( host=trans.request.host,
- repository_name=repository.name,
- revision='%s:%s' %( str( ctx.rev() ), ctx ),
- display_date=display_date,
- description=ctx.description(),
- username=username,
- content_alert_str='' )
+ if new_repo_alert:
+ template = new_repo_email_alert_template
+ else:
+ template = email_alert_template
+ admin_body = string.Template( template ).safe_substitute( host=trans.request.host,
+ repository_name=repository.name,
+ revision='%s:%s' %( str( ctx.rev() ), ctx ),
+ display_date=display_date,
+ description=ctx.description(),
+ username=username,
+ content_alert_str=content_alert_str )
+ body = string.Template( template ).safe_substitute( host=trans.request.host,
+ repository_name=repository.name,
+ revision='%s:%s' %( str( ctx.rev() ), ctx ),
+ display_date=display_date,
+ description=ctx.description(),
+ username=username,
+ content_alert_str='' )
admin_users = trans.app.config.get( "admin_users", "" ).split( "," )
frm = email_from
- subject = "Galaxy tool shed repository update alert"
- email_alerts = from_json_string( repository.email_alerts )
+ if new_repo_alert:
+ subject = "New Galaxy tool shed repository alert"
+ email_alerts = []
+ for user in trans.sa_session.query( trans.model.User ) \
+ .filter( and_( trans.model.User.table.c.deleted == False,
+ trans.model.User.table.c.new_repo_alert == True ) ):
+ if admin_only:
+ if user.email in admin_users:
+ email_alerts.append( user.email )
+ else:
+ email_alerts.append( user.email )
+ else:
+ subject = "Galaxy tool shed repository update alert"
+ email_alerts = from_json_string( repository.email_alerts )
for email in email_alerts:
to = email.strip()
# Send it
diff -r 843fdc5e0ebdc2eafcf97b64c8191b5564ea1836 -r 84187b357d0c6b5bf0c2d9bab5609c10143efb75 lib/galaxy/webapps/community/controllers/repository.py
--- a/lib/galaxy/webapps/community/controllers/repository.py
+++ b/lib/galaxy/webapps/community/controllers/repository.py
@@ -182,6 +182,37 @@
.outerjoin( model.RepositoryCategoryAssociation.table ) \
.outerjoin( model.Category.table )
+class EmailAlertsRepositoryListGrid( RepositoryListGrid ):
+ columns = [
+ RepositoryListGrid.NameColumn( "Name",
+ key="name",
+ link=( lambda item: dict( operation="view_or_manage_repository",
+ id=item.id,
+ webapp="community" ) ),
+ attach_popup=False ),
+ RepositoryListGrid.DescriptionColumn( "Synopsis",
+ key="description",
+ attach_popup=False ),
+ RepositoryListGrid.UserColumn( "Owner",
+ model_class=model.User,
+ link=( lambda item: dict( operation="repositories_by_user", id=item.id, webapp="community" ) ),
+ attach_popup=False,
+ key="User.username" ),
+ RepositoryListGrid.EmailAlertsColumn( "Alert", attach_popup=False ),
+ # Columns that are valid for filtering but are not visible.
+ grids.DeletedColumn( "Deleted",
+ key="deleted",
+ visible=False,
+ filterable="advanced" )
+ ]
+ operations = [ grids.GridOperation( "Receive email alerts",
+ allow_multiple=True,
+ condition=( lambda item: not item.deleted ),
+ async_compatible=False ) ]
+ global_actions = [
+ grids.GridAction( "User preferences", dict( controller='user', action='index', cntrller='repository', webapp='community' ) )
+ ]
+
class ValidRepositoryListGrid( RepositoryListGrid ):
class RevisionColumn( grids.GridColumn ):
def __init__( self, col_name ):
@@ -290,6 +321,7 @@
matched_repository_list_grid = MatchedRepositoryListGrid()
valid_repository_list_grid = ValidRepositoryListGrid()
repository_list_grid = RepositoryListGrid()
+ email_alerts_repository_list_grid = EmailAlertsRepositoryListGrid()
category_list_grid = CategoryListGrid()
@web.expose
@@ -876,6 +908,7 @@
elif operation == "receive email alerts":
if trans.user:
if kwd[ 'id' ]:
+ kwd[ 'caller' ] = 'browse_repositories'
return trans.response.send_redirect( web.url_for( controller='repository',
action='set_email_alerts',
**kwd ) )
@@ -1550,7 +1583,9 @@
@web.require_login( "set email alerts" )
def set_email_alerts( self, trans, **kwd ):
# Set email alerts for selected repositories
- params = util.Params( kwd )
+ # This method is called from multiple grids, so
+ # the caller must be passed.
+ caller = kwd[ 'caller' ]
user = trans.user
if user:
repository_ids = util.listify( kwd.get( 'id', '' ) )
@@ -1582,9 +1617,63 @@
kwd[ 'status' ] = 'done'
del kwd[ 'operation' ]
return trans.response.send_redirect( web.url_for( controller='repository',
- action='browse_repositories',
+ action=caller,
**kwd ) )
@web.expose
+ @web.require_login( "manage email alerts" )
+ def manage_email_alerts( self, trans, **kwd ):
+ params = util.Params( kwd )
+ message = util.restore_text( params.get( 'message', '' ) )
+ status = params.get( 'status', 'done' )
+ new_repo_alert = params.get( 'new_repo_alert', '' )
+ new_repo_alert_checked = CheckboxField.is_checked( new_repo_alert )
+ user = trans.user
+ if params.get( 'new_repo_alert_button', False ):
+ user.new_repo_alert = new_repo_alert_checked
+ trans.sa_session.add( user )
+ trans.sa_session.flush()
+ if new_repo_alert_checked:
+ message = 'You will receive email alerts for all new valid tool shed repositories.'
+ else:
+ message = 'You will not receive any email alerts for new valid tool shed repositories.'
+ checked = new_repo_alert_checked or ( user and user.new_repo_alert )
+ new_repo_alert_check_box = CheckboxField( 'new_repo_alert', checked=checked )
+ email_alert_repositories = []
+ for repository in trans.sa_session.query( trans.model.Repository ) \
+ .filter( and_( trans.model.Repository.table.c.deleted == False,
+ trans.model.Repository.table.c.email_alerts != None ) ) \
+ .order_by( trans.model.Repository.table.c.name ):
+ if user.email in repository.email_alerts:
+ email_alert_repositories.append( repository )
+ return trans.fill_template( "/webapps/community/user/manage_email_alerts.mako",
+ webapp='community',
+ new_repo_alert_check_box=new_repo_alert_check_box,
+ email_alert_repositories=email_alert_repositories,
+ message=message,
+ status=status )
+ @web.expose
+ @web.require_login( "manage email alerts" )
+ def multi_select_email_alerts( self, trans, **kwd ):
+ params = util.Params( kwd )
+ message = util.restore_text( params.get( 'message', '' ) )
+ status = params.get( 'status', 'done' )
+ if 'webapp' not in kwd:
+ kwd[ 'webapp' ] = 'community'
+ if 'operation' in kwd:
+ operation = kwd['operation'].lower()
+ if operation == "receive email alerts":
+ if trans.user:
+ if kwd[ 'id' ]:
+ kwd[ 'caller' ] = 'multi_select_email_alerts'
+ return trans.response.send_redirect( web.url_for( controller='repository',
+ action='set_email_alerts',
+ **kwd ) )
+ else:
+ kwd[ 'message' ] = 'You must be logged in to set email alerts.'
+ kwd[ 'status' ] = 'error'
+ del kwd[ 'operation' ]
+ return self.email_alerts_repository_list_grid( trans, **kwd )
+ @web.expose
@web.require_login( "set repository metadata" )
def set_metadata( self, trans, id, ctx_str, **kwd ):
malicious = kwd.get( 'malicious', '' )
diff -r 843fdc5e0ebdc2eafcf97b64c8191b5564ea1836 -r 84187b357d0c6b5bf0c2d9bab5609c10143efb75 lib/galaxy/webapps/community/controllers/upload.py
--- a/lib/galaxy/webapps/community/controllers/upload.py
+++ b/lib/galaxy/webapps/community/controllers/upload.py
@@ -32,6 +32,10 @@
tip = repository.tip
file_data = params.get( 'file_data', '' )
url = params.get( 'url', '' )
+ # Part of the upload process is sending email notification to those that have registered to
+ # receive them. One scenario occurs when the first change set is produced for the repository.
+ # See the handle_email_alerts() method for the definition of the scenarios.
+ new_repo_alert = repository.is_new
if params.get( 'upload_button', False ):
current_working_dir = os.getcwd()
if file_data == '' and url == '':
@@ -87,13 +91,14 @@
tar = None
istar = False
if istar:
- ok, message, files_to_remove = self.upload_tar( trans,
- repository,
- tar,
- uploaded_file,
- upload_point,
- remove_repo_files_not_in_tar,
- commit_message )
+ ok, message, files_to_remove, content_alert_str = self.upload_tar( trans,
+ repository,
+ tar,
+ uploaded_file,
+ upload_point,
+ remove_repo_files_not_in_tar,
+ commit_message,
+ new_repo_alert )
else:
if ( isgzip or isbz2 ) and uncompress_file:
uploaded_file_filename = self.uncompress( repository, uploaded_file_name, uploaded_file_filename, isgzip, isbz2 )
@@ -131,7 +136,9 @@
# Handle the special case where a xxx.loc.sample file is
# being uploaded by copying it to ~/tool-data/xxx.loc.
copy_sample_loc_file( trans, full_path )
- handle_email_alerts( trans, repository, content_alert_str=content_alert_str )
+ # See if the content of the change set was valid.
+ admin_only = len( repository.downloadable_revisions ) != 1
+ handle_email_alerts( trans, repository, content_alert_str=content_alert_str, new_repo_alert=new_repo_alert, admin_only=admin_only )
if ok:
# Update the repository files for browsing.
update_for_browsing( trans, repository, current_working_dir, commit_message=commit_message )
@@ -150,7 +157,7 @@
else:
message = 'No changes to repository.'
# Set metadata on the repository tip
- error_message, status = set_repository_metadata( trans, repository_id, repository.tip, **kwd )
+ error_message, status = set_repository_metadata( trans, repository_id, repository.tip, content_alert_str=content_alert_str, **kwd )
if error_message:
message = '%s<br/>%s' % ( message, error_message )
return trans.response.send_redirect( web.url_for( controller='repository',
@@ -176,16 +183,17 @@
remove_repo_files_not_in_tar=remove_repo_files_not_in_tar,
message=message,
status=status )
- def upload_tar( self, trans, repository, tar, uploaded_file, upload_point, remove_repo_files_not_in_tar, commit_message ):
+ def upload_tar( self, trans, repository, tar, uploaded_file, upload_point, remove_repo_files_not_in_tar, commit_message, new_repo_alert ):
# Upload a tar archive of files.
repo_dir = repository.repo_path
repo = hg.repository( get_configured_ui(), repo_dir )
files_to_remove = []
+ content_alert_str = ''
ok, message = self.__check_archive( tar )
if not ok:
tar.close()
uploaded_file.close()
- return ok, message, files_to_remove
+ return ok, message, files_to_remove, content_alert_str
else:
if upload_point is not None:
full_path = os.path.abspath( os.path.join( repo_dir, upload_point ) )
@@ -197,7 +205,6 @@
tar.extractall( path=full_path )
tar.close()
uploaded_file.close()
- content_alert_str = ''
if remove_repo_files_not_in_tar and not repository.is_new:
# We have a repository that is not new (it contains files), so discover
# those files that are in the repository, but not in the uploaded archive.
@@ -256,7 +263,7 @@
# appending them to the shed's tool_data_table_conf.xml file on disk.
error, message = handle_sample_tool_data_table_conf_file( trans, filename_in_archive )
if error:
- return False, message, files_to_remove
+ return False, message, files_to_remove, content_alert_str
if filename_in_archive.endswith( '.loc.sample' ):
# Handle the special case where a xxx.loc.sample file is
# being uploaded by copying it to ~/tool-data/xxx.loc.
@@ -269,8 +276,10 @@
# exception. If this happens, we'll try the following.
repo.dirstate.write()
repo.commit( user=trans.user.username, text=commit_message )
- handle_email_alerts( trans, repository, content_alert_str )
- return True, '', files_to_remove
+ # See if the content of the change set was valid.
+ admin_only = len( repository.downloadable_revisions ) != 1
+ handle_email_alerts( trans, repository, content_alert_str=content_alert_str, new_repo_alert=new_repo_alert, admin_only=admin_only )
+ return True, '', files_to_remove, content_alert_str
def uncompress( self, repository, uploaded_file_name, uploaded_file_filename, isgzip, isbz2 ):
if isgzip:
self.__handle_gzip( repository, uploaded_file_name )
diff -r 843fdc5e0ebdc2eafcf97b64c8191b5564ea1836 -r 84187b357d0c6b5bf0c2d9bab5609c10143efb75 lib/galaxy/webapps/community/model/__init__.py
--- a/lib/galaxy/webapps/community/model/__init__.py
+++ b/lib/galaxy/webapps/community/model/__init__.py
@@ -20,6 +20,7 @@
self.deleted = False
self.purged = False
self.username = None
+ self.new_repo_alert = False
def set_password_cleartext( self, cleartext ):
"""Set 'self.password' to the digest of 'cleartext'."""
self.password = new_secure_hash( text_type=cleartext )
diff -r 843fdc5e0ebdc2eafcf97b64c8191b5564ea1836 -r 84187b357d0c6b5bf0c2d9bab5609c10143efb75 lib/galaxy/webapps/community/model/mapping.py
--- a/lib/galaxy/webapps/community/model/mapping.py
+++ b/lib/galaxy/webapps/community/model/mapping.py
@@ -45,6 +45,7 @@
Column( "username", String( 255 ), index=True ),
Column( "password", TrimmedString( 40 ), nullable=False ),
Column( "external", Boolean, default=False ),
+ Column( "new_repo_alert", Boolean, default=False ),
Column( "deleted", Boolean, index=True, default=False ),
Column( "purged", Boolean, index=True, default=False ) )
diff -r 843fdc5e0ebdc2eafcf97b64c8191b5564ea1836 -r 84187b357d0c6b5bf0c2d9bab5609c10143efb75 lib/galaxy/webapps/community/model/migrate/versions/0010_add_new_repo_alert_column.py
--- /dev/null
+++ b/lib/galaxy/webapps/community/model/migrate/versions/0010_add_new_repo_alert_column.py
@@ -0,0 +1,50 @@
+"""
+Migration script to add the new_repo_alert column to the galaxy_user table.
+"""
+
+from sqlalchemy import *
+from sqlalchemy.orm import *
+from migrate import *
+from migrate.changeset import *
+
+import sys, logging
+log = logging.getLogger( __name__ )
+log.setLevel(logging.DEBUG)
+handler = logging.StreamHandler( sys.stdout )
+format = "%(name)s %(levelname)s %(asctime)s %(message)s"
+formatter = logging.Formatter( format )
+handler.setFormatter( formatter )
+log.addHandler( handler )
+
+metadata = MetaData( migrate_engine )
+db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) )
+
+def upgrade():
+ print __doc__
+ metadata.reflect()
+ # Create and initialize imported column in job table.
+ User_table = Table( "galaxy_user", metadata, autoload=True )
+ c = Column( "new_repo_alert", Boolean, default=False, index=True )
+ try:
+ # Create
+ c.create( User_table )
+ assert c is User_table.c.new_repo_alert
+ # Initialize.
+ if migrate_engine.name == 'mysql' or migrate_engine.name == 'sqlite':
+ default_false = "0"
+ elif migrate_engine.name == 'postgres':
+ default_false = "false"
+ db_session.execute( "UPDATE galaxy_user SET new_repo_alert=%s" % default_false )
+ except Exception, e:
+ print "Adding new_repo_alert column to the galaxy_user table failed: %s" % str( e )
+ log.debug( "Adding new_repo_alert column to the galaxy_user table failed: %s" % str( e ) )
+
+def downgrade():
+ metadata.reflect()
+ # Drop new_repo_alert column from galaxy_user table.
+ User_table = Table( "galaxy_user", metadata, autoload=True )
+ try:
+ User_table.c.new_repo_alert.drop()
+ except Exception, e:
+ print "Dropping column new_repo_alert from the galaxy_user table failed: %s" % str( e )
+ log.debug( "Dropping column new_repo_alert from the galaxy_user table failed: %s" % str( e ) )
diff -r 843fdc5e0ebdc2eafcf97b64c8191b5564ea1836 -r 84187b357d0c6b5bf0c2d9bab5609c10143efb75 templates/user/index.mako
--- a/templates/user/index.mako
+++ b/templates/user/index.mako
@@ -16,7 +16,7 @@
<li><a href="${h.url_for( controller='user', action='api_keys', cntrller=cntrller )}">${_('Manage your API keys')}</a></li>
%endif
%if trans.app.config.enable_openid:
- <li><a href="${h.url_for( controller='user', action='openid_manage', cntrller=cntrller )}">${ ('Manage OpenIDs')}</a> linked to your account</li>
+ <li><a href="${h.url_for( controller='user', action='openid_manage', cntrller=cntrller )}">${_('Manage OpenIDs')}</a> linked to your account</li>
%endif
%if trans.app.config.use_remote_user:
%if trans.app.config.remote_user_logout_href:
@@ -27,14 +27,18 @@
%endif
%else:
<li><a href="${h.url_for( controller='user', action='manage_user_info', cntrller=cntrller, webapp='community' )}">${_('Manage your information')}</a></li>
+ <li><a href="${h.url_for( controller='repository', action='manage_email_alerts', cntrller=cntrller, webapp='community' )}">${_('Manage your email alerts')}</a></li>
+ <li><a href="${h.url_for( controller='user', action='logout', logout_all=True )}" target="_top">${_('Logout')}</a> ${_('of all user sessions')}</li>
%endif
</ul>
- <p>
- You are using <strong>${trans.user.get_disk_usage( nice_size=True )}</strong> of disk space in this Galaxy instance.
- %if trans.app.config.enable_quotas:
- Your disk quota is: <strong>${trans.app.quota_agent.get_quota( trans.user, nice_size=True )}</strong>.
- %endif
- </p>
+ %if webapp == 'galaxy':
+ <p>
+ You are using <strong>${trans.user.get_disk_usage( nice_size=True )}</strong> of disk space in this Galaxy instance.
+ %if trans.app.config.enable_quotas:
+ Your disk quota is: <strong>${trans.app.quota_agent.get_quota( trans.user, nice_size=True )}</strong>.
+ %endif
+ </p>
+ %endif
%else:
%if not message:
<p>${n_('You are currently not logged in.')}</p>
diff -r 843fdc5e0ebdc2eafcf97b64c8191b5564ea1836 -r 84187b357d0c6b5bf0c2d9bab5609c10143efb75 templates/webapps/community/index.mako
--- a/templates/webapps/community/index.mako
+++ b/templates/webapps/community/index.mako
@@ -67,9 +67,6 @@
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_categories', webapp='community' )}">Browse by category</a></div>
- <div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories', webapp='community' )}">Browse all repositories</a>
- </div>
%if trans.user:
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='repository', action='browse_repositories', operation='my_repositories', webapp='community' )}">Browse my repositories</a>
diff -r 843fdc5e0ebdc2eafcf97b64c8191b5564ea1836 -r 84187b357d0c6b5bf0c2d9bab5609c10143efb75 templates/webapps/community/user/manage_email_alerts.mako
--- /dev/null
+++ b/templates/webapps/community/user/manage_email_alerts.mako
@@ -0,0 +1,54 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+<br/><br/>
+<ul class="manage-table-actions">
+ <li>
+ <a class="action-button" href="${h.url_for( controller='repository', action='multi_select_email_alerts', cntrller='repository', webapp=webapp )}">Manage repository alerts</a>
+ </li>
+ <li>
+ <a class="action-button" href="${h.url_for( controller='user', action='index', cntrller='repository', webapp=webapp )}">User preferences</a>
+ </li>
+</ul>
+
+%if message:
+ ${render_msg( message, status )}
+%endif
+
+<div class="toolForm">
+ <div class="toolFormTitle">Email alerts for new repositories</div>
+ <form name="new_repo_alert" id="new_repo_alert" action="${h.url_for( controller='repository', action='manage_email_alerts', webapp=webapp )}" method="post" >
+ <div class="form-row">
+ <label>New repository alert:</label>
+ ${new_repo_alert_check_box.get_html()}
+ <div class="toolParamHelp" style="clear: both;">
+ Check the box and click <b>Save</b> to receive email when the first change set is created for a new repository.
+ </div>
+ </div>
+ <div class="form-row">
+ <input type="submit" name="new_repo_alert_button" value="Save"/>
+ </div>
+ </form>
+</div>
+<p/>
+%if email_alert_repositories:
+ <div class="toolForm">
+ <div class="toolFormTitle">You are registered to receive email alerts for changes to the following repositories</div>
+ <div class="form-row">
+ <table class="grid">
+ <tr>
+ <th>Name</th>
+ <th>Description</th>
+ </tr>
+ %for repository in email_alert_repositories:
+ <tr>
+ <td>${repository.name}</td>
+ <td>${repository.description}</td>
+ </tr>
+ %endfor
+ </table>
+ </div>
+ </div>
+ <p/>
+%endif
+
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.
1
0
21 Nov '11
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/843fdc5e0ebd/
changeset: 843fdc5e0ebd
user: dan
date: 2011-11-21 23:12:07
summary: Updates for GenomeSpace file browser importer.
affected #: 3 files
diff -r 52ce5e6950b7e599b6da104ca5b094df00ea4d26 -r 843fdc5e0ebdc2eafcf97b64c8191b5564ea1836 tool_conf.xml.sample
--- a/tool_conf.xml.sample
+++ b/tool_conf.xml.sample
@@ -26,7 +26,9 @@
<tool file="data_source/epigraph_import.xml" /><tool file="data_source/epigraph_import_test.xml" /><tool file="data_source/hbvar.xml" />
- <tool file="data_source/genomespace_file_browser_dev.xml" />
+ <tool file="data_source/genomespace_file_browser_prod.xml" />
+ <!-- <tool file="data_source/genomespace_file_browser_test.xml" />
+ <tool file="data_source/genomespace_file_browser_dev.xml" /> --><tool file="validation/fix_errors.xml" /></section><section name="Send Data" id="send">
diff -r 52ce5e6950b7e599b6da104ca5b094df00ea4d26 -r 843fdc5e0ebdc2eafcf97b64c8191b5564ea1836 tools/data_source/genomespace_file_browser_prod.xml
--- /dev/null
+++ b/tools/data_source/genomespace_file_browser_prod.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<tool name="GenomeSpace import" id="genomespace_file_browser_prod" tool_type="data_source" add_galaxy_url="False" force_history_refresh="True" version="0.0.1">
+ <description>from file browser</description>
+ <command interpreter="python">genomespace_file_browser.py --json_parameter_file "${output}" --genomespace_site "prod"</command>
+ <inputs action="https://dm.genomespace.org/datamanager/defaultdirectory" check_values="False" method="post">
+ <display>go to GenomeSpace Data Manager </display>
+ <param name="appCallbackUrl" type="baseurl" value="/tool_runner?tool_id=genomespace_file_browser_dev&runtool_btn=Execute" />
+ <param name="appName" type="hidden" value="Galaxy" />
+ </inputs>
+ <uihints minwidth="800"/>
+ <outputs>
+ <data name="output" format="auto" />
+ </outputs>
+ <options sanitize="False" refresh="True"/>
+</tool>
diff -r 52ce5e6950b7e599b6da104ca5b094df00ea4d26 -r 843fdc5e0ebdc2eafcf97b64c8191b5564ea1836 tools/data_source/genomespace_file_browser_test.xml
--- /dev/null
+++ b/tools/data_source/genomespace_file_browser_test.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<tool name="GenomeSpace import" id="genomespace_file_browser_test" tool_type="data_source" add_galaxy_url="False" force_history_refresh="True" version="0.0.1">
+ <description>from file browser (test)</description>
+ <command interpreter="python">genomespace_file_browser.py --json_parameter_file "${output}" --genomespace_site "test"</command>
+ <inputs action="https://dmtest.genomespace.org:8444/datamanager/defaultdirectory" check_values="False" method="post">
+ <display>go to GenomeSpace Data Manager </display>
+ <param name="appCallbackUrl" type="baseurl" value="/tool_runner?tool_id=genomespace_file_browser_dev&runtool_btn=Execute" />
+ <param name="appName" type="hidden" value="Galaxy" />
+ </inputs>
+ <uihints minwidth="800"/>
+ <outputs>
+ <data name="output" format="auto" />
+ </outputs>
+ <options sanitize="False" refresh="True"/>
+</tool>
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.
1
0
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/52ce5e6950b7/
changeset: 52ce5e6950b7
user: dan
date: 2011-11-21 22:55:16
summary: Update help for some SAMTools.
affected #: 5 files
diff -r 945c7a47755f4c468d0742ad02d43647a300565c -r 52ce5e6950b7e599b6da104ca5b094df00ea4d26 tools/samtools/bam_to_sam.xml
--- a/tools/samtools/bam_to_sam.xml
+++ b/tools/samtools/bam_to_sam.xml
@@ -56,5 +56,11 @@
.. _SAMTools: http://samtools.sourceforge.net/samtools.shtml
+------
+
+**Citation**
+
+For the underlying tool, please cite `Li H, Handsaker B, Wysoker A, Fennell T, Ruan J, Homer N, Marth G, Abecasis G, Durbin R; 1000 Genome Project Data Processing Subgroup. The Sequence Alignment/Map format and SAMtools. Bioinformatics. 2009 Aug 15;25(16):2078-9. <http://www.ncbi.nlm.nih.gov/pubmed/19505943>`_
+
</help></tool>
diff -r 945c7a47755f4c468d0742ad02d43647a300565c -r 52ce5e6950b7e599b6da104ca5b094df00ea4d26 tools/samtools/sam_pileup.xml
--- a/tools/samtools/sam_pileup.xml
+++ b/tools/samtools/sam_pileup.xml
@@ -177,6 +177,12 @@
.. _consensus: http://samtools.sourceforge.net/cns0.shtml
+------
+
+**Citation**
+
+For the underlying tool, please cite `Li H, Handsaker B, Wysoker A, Fennell T, Ruan J, Homer N, Marth G, Abecasis G, Durbin R; 1000 Genome Project Data Processing Subgroup. The Sequence Alignment/Map format and SAMtools. Bioinformatics. 2009 Aug 15;25(16):2078-9. <http://www.ncbi.nlm.nih.gov/pubmed/19505943>`_
+
</help></tool>
diff -r 945c7a47755f4c468d0742ad02d43647a300565c -r 52ce5e6950b7e599b6da104ca5b094df00ea4d26 tools/samtools/sam_to_bam.xml
--- a/tools/samtools/sam_to_bam.xml
+++ b/tools/samtools/sam_to_bam.xml
@@ -87,5 +87,11 @@
.. _SAMTools: http://samtools.sourceforge.net/samtools.shtml
+------
+
+**Citation**
+
+For the underlying tool, please cite `Li H, Handsaker B, Wysoker A, Fennell T, Ruan J, Homer N, Marth G, Abecasis G, Durbin R; 1000 Genome Project Data Processing Subgroup. The Sequence Alignment/Map format and SAMtools. Bioinformatics. 2009 Aug 15;25(16):2078-9. <http://www.ncbi.nlm.nih.gov/pubmed/19505943>`_
+
</help></tool>
diff -r 945c7a47755f4c468d0742ad02d43647a300565c -r 52ce5e6950b7e599b6da104ca5b094df00ea4d26 tools/samtools/samtools_flagstat.xml
--- a/tools/samtools/samtools_flagstat.xml
+++ b/tools/samtools/samtools_flagstat.xml
@@ -25,5 +25,13 @@
.. _SAMTools: http://samtools.sourceforge.net/samtools.shtml
+------
+
+**Citation**
+
+For the underlying tool, please cite `Li H, Handsaker B, Wysoker A, Fennell T, Ruan J, Homer N, Marth G, Abecasis G, Durbin R; 1000 Genome Project Data Processing Subgroup. The Sequence Alignment/Map format and SAMtools. Bioinformatics. 2009 Aug 15;25(16):2078-9. <http://www.ncbi.nlm.nih.gov/pubmed/19505943>`_
+
+If you use this tool in Galaxy, please cite Blankenberg D, et al. *In preparation.*
+
</help></tool>
diff -r 945c7a47755f4c468d0742ad02d43647a300565c -r 52ce5e6950b7e599b6da104ca5b094df00ea4d26 tools/samtools/samtools_rmdup.xml
--- a/tools/samtools/samtools_rmdup.xml
+++ b/tools/samtools/samtools_rmdup.xml
@@ -57,5 +57,13 @@
.. _SAMTools: http://samtools.sourceforge.net/samtools.shtml
+------
+
+**Citation**
+
+For the underlying tool, please cite `Li H, Handsaker B, Wysoker A, Fennell T, Ruan J, Homer N, Marth G, Abecasis G, Durbin R; 1000 Genome Project Data Processing Subgroup. The Sequence Alignment/Map format and SAMtools. Bioinformatics. 2009 Aug 15;25(16):2078-9. <http://www.ncbi.nlm.nih.gov/pubmed/19505943>`_
+
+If you use this tool in Galaxy, please cite Blankenberg D, et al. *In preparation.*
+
</help></tool>
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.
1
0