Пример #1
0
    def get_directory(self, object_tree_folder, path):
        log.debug('get_directory: {}'.format(util.string_from_path_elements(path)))

        if len(path) <= 2:
            return self._get_directory(object_tree_folder, path)

        return self._resource_map_resolver.get_directory(object_tree_folder, path[2:])
Пример #2
0
 def get_attributes(self, object_tree_root, path):
     log.debug('get_attributes: {}'.format(util.string_from_path_elements(path)))
     if not path:
         return attributes.Attributes(is_dir=True)
     if self._is_readme_file(path):
         return self._get_readme_file_attributes()
     return self._resource_map_resolver.get_attributes(object_tree_root, path)
Пример #3
0
 def read_file(self, object_tree_root, path, size, offset):
     log.debug(
         'read_file: {}, {}, {}'.format(
             util.string_from_path_elements(path), size, offset
         )
     )
     return self._read_file(object_tree_root, path, size, offset)
Пример #4
0
  def get_directory(self, object_tree_folder, path):
    log.debug('get_directory: {}'.format(util.string_from_path_elements(path)))

    if len(path) <= 2:
      return self._get_directory(object_tree_folder, path)

    return self._resource_map_resolver.get_directory(path[2:])
Пример #5
0
 def get_directory(self, object_tree_root, path):
     log.debug('get_directory: {}'.format(
         util.string_from_path_elements(path)))
     if not path:
         return self._get_directory(object_tree_root, path)
     return self._resource_map_resolver.get_directory(
         object_tree_root, path)
Пример #6
0
    def read_file(self, object_tree_folder, path, size, offset):
        log.debug(
            'read_file: {}, {}, {}'.format(
                util.string_from_path_elements(path), size, offset
            )
        )

        return self._read_file(object_tree_folder, path, size, offset)
Пример #7
0
 def get_attributes(self, object_tree_root, path):
   log.debug('get_attributes: {}'.format(util.string_from_path_elements(path)))
   if not path:
     return attributes.Attributes(is_dir=True)
   if self._is_readme_file(path):
     return self._get_readme_file_attributes()
   self._object_tree.add_object_to_cache(path[-1])
   return self._resource_map_resolver.get_attributes(object_tree_root, path)
Пример #8
0
 def get_directory(self, object_tree_root, path):
   log.debug('get_directory: {}'.format(util.string_from_path_elements(path)))
   if not path:
     return [self._get_readme_filename()] \
       + self._object_tree._get_individually_synced_object_pids()
   else:
     self._object_tree.add_object_to_cache(path[-1])
     return self._resource_map_resolver.get_directory(object_tree_root, path)
Пример #9
0
 def read_file(self, object_tree_root, path, size, offset):
     log.debug(u'read_file: {}, {}, {}'.format(
         util.string_from_path_elements(path), size, offset))
     if self._is_readme_file(path):
         return self._get_readme_text(size, offset)
     self._object_tree.add_object_to_cache(path[-1])
     return self._resource_map_resolver.read_file(object_tree_root, path,
                                                  size, offset)
Пример #10
0
 def read_file(self, object_tree_folder, path, size, offset):
     log.debug('read_file: {}, {}, {}'.format(
         util.string_from_path_elements(path), size, offset))
     if self._is_readme_file(path):
         return self._get_readme_text(size, offset)
     if len(path) <= 2:
         raise onedrive_exceptions.PathException('Invalid file')
     return self._resource_map_resolver.read_file(path[2:], size, offset)
Пример #11
0
 def read_file(self, object_tree_root, path, size, offset):
     log.debug("read_file: {}, {}, {}".format(
         util.string_from_path_elements(path), size, offset))
     if not path:
         raise onedrive_exceptions.PathException("Invalid file")
     if self._is_readme_file(path):
         return self._get_readme_text(size, offset)
     return self._resource_map_resolver.read_file(object_tree_root, path,
                                                  size, offset)
Пример #12
0
    def get_attributes(self, object_tree_folder, path):
        log.debug('get_attributes: {}'.format(util.string_from_path_elements(path)))
        if self._is_readme_file(path):
            return self._get_readme_file_attributes()

        if len(path) <= 2:
            return self._get_attributes(path)

        return self._resource_map_resolver.get_attributes(object_tree_folder, path[2:])
Пример #13
0
 def get_directory(self, object_tree_root, path):
     log.debug('get_directory: {}'.format(util.string_from_path_elements(path)))
     if not path:
         return [
             self._get_readme_filename()
         ] + self._object_tree._get_individually_synced_object_pids()
     else:
         self._object_tree.add_object_to_cache(path[-1])
         return self._resource_map_resolver.get_directory(object_tree_root, path)
Пример #14
0
 def read_file(self, object_tree_root, path, size, offset):
     log.debug("read_file: {}, {}, {}".format(
         util.string_from_path_elements(path), size, offset))
     if self._is_readme_file(path):
         return self._get_readme_text(size, offset)
     if len(path) > 1 and self._is_resource_map(path[0]):
         return self._d1_object_resolver.read_file(object_tree_root,
                                                   path[1:], size, offset)
     return self._d1_object_resolver.read_file(object_tree_root, path, size,
                                               offset)
Пример #15
0
 def read_file(self, object_tree_folder, path, size, offset):
     log.debug(
         'read_file: {}, {}, {}'.format(
             util.string_from_path_elements(path), size, offset
         )
     )
     if self._is_readme_file(path):
         return self._get_readme_text(size, offset)
     if len(path) <= 2:
         raise onedrive_exceptions.PathException('Invalid file')
     return self._resource_map_resolver.read_file(path[2:], size, offset)
Пример #16
0
    def get_attributes(self, object_tree_folder, path):
        log.debug('get_attributes: {}'.format(
            util.string_from_path_elements(path)))
        if self._is_readme_file(path):
            return self._get_readme_file_attributes()

        if len(path) <= 2:
            return self._get_attributes(path)

        return self._resource_map_resolver.get_attributes(
            object_tree_folder, path[2:])
Пример #17
0
 def read_file(self, object_tree_root, path, size, offset):
     log.debug(
         'read_file: {}, {}, {}'.format(
             util.string_from_path_elements(path), size, offset
         )
     )
     if self._is_readme_file(path):
         return self._get_readme_text(size, offset)
     self._object_tree.add_object_to_cache(path[-1])
     return self._resource_map_resolver.read_file(
         object_tree_root, path, size, offset
     )
Пример #18
0
 def get_directory(self, object_tree_root, path):
     log.debug('get_directory: {}'.format(util.string_from_path_elements(path)))
     is_resource_map = self._is_resource_map(path[0])
     if not is_resource_map:
         return self._d1_object_resolver.get_directory(object_tree_root, path)
     if len(path) > 1:
         if is_resource_map:
             return self._d1_object_resolver.get_directory(
                 object_tree_root, path[1:]
             )
         else:
             return self._d1_object_resolver.get_directory(object_tree_root, path)
     return self._get_directory(object_tree_root, path)
Пример #19
0
 def read_file(self, object_tree_root, path, size, offset):
     log.debug(
         'read_file: {}, {}, {}'.format(
             util.string_from_path_elements(path), size, offset
         )
     )
     if self._is_readme_file(path):
         return self._get_readme_text(size, offset)
     if len(path) > 1 and self._is_resource_map(path[0]):
         return self._d1_object_resolver.read_file(
             object_tree_root, path[1:], size, offset
         )
     return self._d1_object_resolver.read_file(object_tree_root, path, size, offset)
Пример #20
0
 def get_attributes(self, object_tree_root, path):
     log.debug('get_attributes: {}'.format(util.string_from_path_elements(path)))
     if self._is_readme_file(path):
         return self._get_readme_file_attributes()
     is_resource_map = self._is_resource_map(path[0])
     if not is_resource_map:
         return self._d1_object_resolver.get_attributes(object_tree_root, path)
     if len(path) > 1:
         if is_resource_map:
             return self._d1_object_resolver.get_attributes(
                 object_tree_root, path[1:]
             )
         else:
             return self._d1_object_resolver.get_attributes(object_tree_root, path)
     return self._get_attributes(object_tree_root, path)
Пример #21
0
 def get_attributes(self, object_tree_root, path):
     log.debug("get_attributes: {}".format(
         util.string_from_path_elements(path)))
     return self._get_attributes(object_tree_root, path)
Пример #22
0
 def get_directory(self, object_tree_root, path):
     log.debug('get_directory: {}'.format(util.string_from_path_elements(path)))
     if not path:
         return self._get_directory(object_tree_root, path)
     return self._resource_map_resolver.get_directory(object_tree_root, path)
Пример #23
0
 def get_directory(self, object_tree_root, path):
     log.debug("get_directory: {}".format(
         util.string_from_path_elements(path)))
     return self._get_directory(object_tree_root, path)
Пример #24
0
    def get_directory(self, object_tree_folder, path):
        log.debug('get_directory: {}'.format(util.string_from_path_elements(path)))

        return self._get_directory(object_tree_folder, path)
Пример #25
0
    def get_attributes(self, object_tree_folder, path):
        log.debug('get_attributes: {}'.format(util.string_from_path_elements(path)))

        return self._get_attributes(object_tree_folder, path)