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.

27 lines
605 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 osfs
  8. except ImportError:
  9. _logger.debug('Cannot `import fs`.')
  10. class FileStoreTask(osfs.OSFS):
  11. _key = 'filestore'
  12. _name = 'File Store'
  13. _default_port = None
  14. _hide_login = True
  15. _hide_password = True
  16. _hide_port = True
  17. @staticmethod
  18. def connect(location):
  19. rootpath = location.filestore_rootpath or '/'
  20. conn = FileStoreTask(rootpath)
  21. return conn