1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/16a93eb6eaf6/ changeset: 16a93eb6eaf6 user: greg date: 2012-05-30 15:46:25 summary: Load datatype converters and display appliations included in installed tool shed repositories after the app's toolbox has been inititlaized. affected #: 4 files diff -r 356aa8a00cfdd8c1d29f7065601f55120d241005 -r 16a93eb6eaf6b2f9b73bbe10d0e4fab1d1142b9f lib/galaxy/app.py --- a/lib/galaxy/app.py +++ b/lib/galaxy/app.py @@ -62,7 +62,6 @@ # However, if there is a conflict (2 datatypes with the same extension) between a proprietary datatype and a datatype # in the Galaxy distribution, the datatype in the Galaxy distribution will take precedence. If there is a conflict # between 2 proprietary datatypes, the datatype from the repository that was installed earliest will take precedence. - # This will also load proprietary datatype converters and display applications. self.installed_repository_manager.load_proprietary_datatypes() # Load the data types in the Galaxy distribution, which are defined in self.config.datatypes_config. self.datatypes_registry.load_datatypes( self.config.root, self.config.datatypes_config ) @@ -84,6 +83,8 @@ if self.config.get_bool( 'enable_tool_shed_check', False ): from tool_shed import update_manager self.update_manager = update_manager.UpdateManager( self ) + # Load proprietary datatype converters and display applications. + self.installed_repository_manager.load_proprietary_converters_and_display_applications() # Load datatype display applications defined in local datatypes_conf.xml self.datatypes_registry.load_display_applications() # Load datatype converters defined in local datatypes_conf.xml diff -r 356aa8a00cfdd8c1d29f7065601f55120d241005 -r 16a93eb6eaf6b2f9b73bbe10d0e4fab1d1142b9f lib/galaxy/tool_shed/__init__.py --- a/lib/galaxy/tool_shed/__init__.py +++ b/lib/galaxy/tool_shed/__init__.py @@ -19,6 +19,7 @@ self.tool_configs = self.app.config.tool_configs if self.app.config.migrated_tools_config not in self.tool_configs: self.tool_configs.append( self.app.config.migrated_tools_config ) + self.installed_repository_dicts = [] def get_repository_install_dir( self, tool_shed_repository ): for tool_config in self.tool_configs: tree = ElementTree.parse( tool_config ) @@ -43,5 +44,13 @@ .order_by( self.model.ToolShedRepository.table.c.id ): relative_install_dir = self.get_repository_install_dir( tool_shed_repository ) if relative_install_dir: - galaxy.util.shed_util.load_datatype_items( self.app, tool_shed_repository, relative_install_dir ) + installed_repository_dict = galaxy.util.shed_util.load_installed_datatypes( self.app, tool_shed_repository, relative_install_dir ) + if installed_repository_dict: + self.installed_repository_dicts.append( installed_repository_dict ) + def load_proprietary_converters_and_display_applications( self, deactivate=False ): + for installed_repository_dict in self.installed_repository_dicts: + if installed_repository_dict[ 'converter_path' ]: + galaxy.util.shed_util.load_installed_datatype_converters( self.app, installed_repository_dict, deactivate=deactivate ) + if installed_repository_dict[ 'display_path' ]: + galaxy.util.shed_util.load_installed_display_applications( installed_repository_dict, deactivate=deactivate ) \ No newline at end of file diff -r 356aa8a00cfdd8c1d29f7065601f55120d241005 -r 16a93eb6eaf6b2f9b73bbe10d0e4fab1d1142b9f lib/galaxy/util/shed_util.py --- a/lib/galaxy/util/shed_util.py +++ b/lib/galaxy/util/shed_util.py @@ -1152,10 +1152,14 @@ parent_id=tool_version_using_parent_id.id ) sa_session.add( tool_version_association ) sa_session.flush() -def load_datatype_items( app, repository, relative_install_dir, deactivate=False ): - # Load proprietary datatypes. +def load_installed_datatype_converters( app, installed_repository_dict, deactivate=False ): + # Load or deactivate proprietary datatype converters + app.datatypes_registry.load_datatype_converters( app.toolbox, installed_repository_dict=installed_repository_dict, deactivate=deactivate ) +def load_installed_datatypes( app, repository, relative_install_dir, deactivate=False ): + # Load proprietary datatypes and return information needed for loading proprietary datatypes converters and display applications later. metadata = repository.metadata work_dir = make_tmp_directory() + repository_dict = None datatypes_config = get_config_from_repository( app, 'datatypes_conf.xml', repository, @@ -1173,16 +1177,14 @@ tool_dicts=metadata.get( 'tools', [] ), converter_path=converter_path, display_path=display_path ) - if converter_path: - # Load or deactivate proprietary datatype converters - app.datatypes_registry.load_datatype_converters( app.toolbox, installed_repository_dict=repository_dict, deactivate=deactivate ) - if display_path: - # Load or deactivate proprietary datatype display applications - app.datatypes_registry.load_display_applications( installed_repository_dict=repository_dict, deactivate=deactivate ) try: shutil.rmtree( work_dir ) except: pass + return repository_dict +def load_installed_display_applications( installed_repository_dict, deactivate=False ): + # Load or deactivate proprietary datatype display applications + app.datatypes_registry.load_display_applications( installed_repository_dict=installed_repository_dict, deactivate=deactivate ) def load_repository_contents( trans, repository_name, description, owner, changeset_revision, ctx_rev, tool_path, repository_clone_url, relative_install_dir, tool_shed=None, tool_section=None, shed_tool_conf=None, install_tool_dependencies=False ): """ @@ -1403,8 +1405,8 @@ # Write the current in-memory version of the integrated_tool_panel.xml file to disk. trans.app.toolbox.write_integrated_tool_panel_config_file() def reset_tool_data_tables( app ): - # Reset the tool_data_tables by loading the empty tool_data_table_conf.xml file. - app.tool_data_tables = galaxy.tools.data.ToolDataTableManager( app.config.tool_data_table_config_path ) + # Reset the tool_data_tables to an empty dictionary. + app.tool_data_tables = galaxy.tools.data.ToolDataTableManager() def strip_path( fpath ): file_path, file_name = os.path.split( fpath ) return file_name diff -r 356aa8a00cfdd8c1d29f7065601f55120d241005 -r 16a93eb6eaf6b2f9b73bbe10d0e4fab1d1142b9f lib/galaxy/web/controllers/admin_toolshed.py --- a/lib/galaxy/web/controllers/admin_toolshed.py +++ b/lib/galaxy/web/controllers/admin_toolshed.py @@ -189,7 +189,11 @@ remove_from_tool_panel( trans, repository, shed_tool_conf, uninstall=remove_from_disk_checked ) if repository.includes_datatypes: # Deactivate proprietary datatypes. - load_datatype_items( trans.app, repository, repository_install_dir, deactivate=True ) + installed_repository_dict = load_installed_datatypes( trans.app, repository, repository_install_dir, deactivate=True ) + if installed_repository_dict[ 'converter_path' ]: + load_installed_datatype_converters( trans.app, installed_repository_dict, deactivate=True ) + if installed_repository_dict[ 'display_path' ]: + load_installed_display_applications( installed_repository_dict, deactivate=True ) if remove_from_disk_checked: try: # Remove the repository from disk. 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.