mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 07:18:27 +01:00
Following same conventions from remotes/outsputs/dependencies. Signed-off-by: Ruslan Kuprieiev <[email protected]>
27 lines
676 B
Python
27 lines
676 B
Python
from dvc.utils.compat import urlunsplit
|
|
from dvc.scheme import Schemes
|
|
from .base import PathBASE
|
|
|
|
|
|
class PathSSH(PathBASE):
|
|
scheme = Schemes.SSH
|
|
|
|
def __init__(self, host, user, port, url=None, path=None):
|
|
super(PathSSH, self).__init__(url, path)
|
|
self.host = host
|
|
self.user = user
|
|
self.port = port
|
|
|
|
def __str__(self):
|
|
if not self.url:
|
|
return urlunsplit(
|
|
(
|
|
self.scheme,
|
|
"{}@{}:{}".format(self.user, self.host, self.port),
|
|
self.path,
|
|
"",
|
|
"",
|
|
)
|
|
)
|
|
return self.url
|