@@ -191,13 +191,16 @@ def get_tool_source(self, tool_id: str) -> str:
191191
192192 :rtype: str
193193 :return: Tool XML source as a string
194+
195+ .. note::
196+ This method works only on Galaxy 22.01 or later and if the user is a
197+ Galaxy admin or the Galaxy instance has the
198+ ``enable_tool_source_display`` option set to ``true`` in the
199+ ``config/galaxy.yml`` configuration file.
194200 """
195- try :
196- raw_source_url = self ._make_url (tool_id ) + "/raw_tool_source"
197- ht_response = self ._get (url = raw_source_url , json = False )
198- return ht_response .text
199- except Exception as e :
200- raise RuntimeError (f"Could not retrieve tool source for tool '{ tool_id } ': { e } " )
201+ raw_source_url = self ._make_url (tool_id ) + "/raw_tool_source"
202+ ht_response = self ._get (url = raw_source_url , json = False )
203+ return ht_response .text
201204
202205 def show_tool (self , tool_id : str , io_details : bool = False , link_details : bool = False ) -> dict [str , Any ]:
203206 """
@@ -233,7 +236,8 @@ def get_tool_tests(self, tool_id: str, tool_version: str | None = None) -> list[
233236 the tests for all available tool versions.
234237
235238 :rtype: list
236- :return: List of test case definitions, e.g.::
239+ :return: List of test case definitions.
240+ For example::
237241
238242 [
239243 {
@@ -568,10 +572,10 @@ def post_to_fetch(self, path: str, history_id: str, session_id: str, **kwargs: A
568572 :type session_id: str
569573 :param session_id: Session ID returned by the tus service
570574
571- See :meth:`upload_file` for additional parameters.
572-
573575 :rtype: dict
574576 :return: Information about the created upload job
577+
578+ See :meth:`upload_file` for additional parameters.
575579 """
576580 payload = self ._fetch_payload (path , history_id , session_id , ** kwargs )
577581 url = "/" .join ((self .gi .url , "tools/fetch" ))
@@ -588,10 +592,10 @@ def upload_from_ftp(self, path: str, history_id: str, **kwargs: Any) -> dict[str
588592 :type history_id: str
589593 :param history_id: id of the history where to upload the file
590594
591- See :meth:`upload_file` for the optional parameters.
592-
593595 :rtype: dict
594596 :return: Information about the created upload job
597+
598+ See :meth:`upload_file` for the optional parameters.
595599 """
596600 payload = self ._upload_payload (history_id , ** kwargs )
597601 payload ["files_0|ftp_files" ] = path
0 commit comments