You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
688 B

  1. # coding: utf-8
  2. # @ 2016 Florian DA COSTA @ Akretion
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. import logging
  5. _logger = logging.getLogger(__name__)
  6. try:
  7. from fs import ftpfs
  8. except ImportError:
  9. _logger.debug('Cannot `import fs`.')
  10. class FtpTask(ftpfs.FTPFS):
  11. _key = 'sftp'
  12. _name = 'SFTP'
  13. _synchronize_type = None
  14. _default_port = 22
  15. _hide_login = False
  16. _hide_password = False
  17. _hide_port = False
  18. @staticmethod
  19. def connect(location):
  20. conn = FtpTask(location.address,
  21. location.login,
  22. location.password,
  23. location.port)
  24. return conn