Skip to content

Instantly share code, notes, and snippets.

@dannon
Created June 9, 2023 15:32
Show Gist options
  • Save dannon/7ecea8588049683e19371902ec9309c2 to your computer and use it in GitHub Desktop.
Save dannon/7ecea8588049683e19371902ec9309c2 to your computer and use it in GitHub Desktop.
diff --git a/lib/galaxy/files/sources/galaxy.py b/lib/galaxy/files/sources/galaxy.py
index ebbf9d303e..e1a02a30ab 100644
--- a/lib/galaxy/files/sources/galaxy.py
+++ b/lib/galaxy/files/sources/galaxy.py
@@ -12,6 +12,26 @@ from .posix import (
PosixFilesSourceProperties,
)
+class UserHomeFilesSource(PosixFilesSource):
+ plugin_type = "gxuserhome"
+
+ def __init__(self, **kwd: Unpack[PosixFilesSourceProperties]):
+ posix_kwds: PosixFilesSourceProperties = dict(
+ id="_userhome",
+ root="/home/${user.username}/",
+ label="User Home Directory",
+ doc="Galaxy User's Home Directory",
+ writable=True,
+ )
+ posix_kwds.update(kwd)
+ super().__init__(**posix_kwds)
+
+ def get_prefix(self) -> Optional[str]:
+ return None
+
+ def get_scheme(self) -> str:
+ return "gxuserhome"
+
class UserFtpFilesSource(PosixFilesSource):
plugin_type = "gxftp"
@@ -77,4 +97,4 @@ class UserLibraryImportFilesSource(PosixFilesSource):
return "gxuserimport"
-__all__ = ("UserFtpFilesSource", "LibraryImportFilesSource", "UserLibraryImportFilesSource")
+__all__ = ("UserFtpFilesSource", "LibraryImportFilesSource", "UserLibraryImportFilesSource", "UserHomeFilesSource")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment