Skip to content

Instantly share code, notes, and snippets.

@dannon
Created June 5, 2023 15:01
Show Gist options
  • Save dannon/d8f3f1cfb54e07c98e32a2e135198cc2 to your computer and use it in GitHub Desktop.
Save dannon/d8f3f1cfb54e07c98e32a2e135198cc2 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..62efed21f0 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.email}/",
+ 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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment