from hpcrocket.core.filesystem import Filesystem, FilesystemFactory
from hpcrocket.core.launchoptions import Options
from hpcrocket.pyfilesystem.localfilesystem import LocalFilesystem
from hpcrocket.pyfilesystem.sshfilesystem import SSHFilesystem


class PyFilesystemFactory(FilesystemFactory):

    def __init__(self, options: Options) -> None:
        self._options = options

    def create_local_filesystem(self) -> Filesystem:
        return LocalFilesystem(".")

    def create_ssh_filesystem(self) -> Filesystem:
        connection = self._options.connection
        proxyjumps = self._options.proxyjumps
        return SSHFilesystem(connection, proxyjumps)

[((13, 15, 13, 35), 'hpcrocket.pyfilesystem.localfilesystem.LocalFilesystem', 'LocalFilesystem', ({(13, 31, 13, 34): '"""."""'}, {}), "('.')", False, 'from hpcrocket.pyfilesystem.localfilesystem import LocalFilesystem\n'), ((18, 15, 18, 52), 'hpcrocket.pyfilesystem.sshfilesystem.SSHFilesystem', 'SSHFilesystem', ({(18, 29, 18, 39): 'connection', (18, 41, 18, 51): 'proxyjumps'}, {}), '(connection, proxyjumps)', False, 'from hpcrocket.pyfilesystem.sshfilesystem import SSHFilesystem\n')]