Exemplo n.º 1
0
    def get(self):
        paths = self.__get_paths()

        start_key = normalize_path(
            '{0}/{1}'.format(self.source, self.start)) + '/'
        start = None if not self.start else self.__get_first_key_index(
            start_key, paths)

        end_key = normalize_path('{0}/{1}'.format(self.source, self.end)) + '/'
        end = None if not self.end else self.__get_first_key_index(end_key,
                                                                   paths) + 1

        return (normalize_path(path) for path in paths[start:end])
Exemplo n.º 2
0
    def get(self):
        paths = self.__get_paths()

        start_key = normalize_path('{0}/{1}'.format(self.source,
                                                    self.start)) + '/'
        start = None if not self.start else self.__get_first_key_index(
            start_key, paths)

        end_key = normalize_path('{0}/{1}'.format(self.source, self.end)) + '/'
        end = None if not self.end else self.__get_first_key_index(
            end_key, paths) + 1

        return (normalize_path(path) for path in paths[start:end])
Exemplo n.º 3
0
    def __get_paths(self):
        paths = []
        branches = self.__get_directory_keys(normalize_path(self.source) + '/')

        start_date = self._get_date_from(self.start)
        start = None if not start_date else branches.index(
            normalize_path('{0}/{1}'.format(self.source, start_date)) + '/')

        end_date = self._get_date_from(self.end)
        end = None if not end_date else branches.index(
            normalize_path('{0}/{1}'.format(self.source, end_date)) + '/') + 1

        if is_day_hour(self.start) or is_day_hour(self.end):
            for branch in branches[start:end]:
                children = self.__get_directory_keys(
                    normalize_path(branch) + '/')
                if children:
                    paths = paths + children
                else:
                    paths.append(branch)
        else:
            paths = branches

        return paths
Exemplo n.º 4
0
    def __get_paths(self):
        paths = []
        branches = self.__get_directory_keys(normalize_path(self.source) + '/')

        start_date = self._get_date_from(self.start)
        start = None if not start_date else branches.index(
            normalize_path('{0}/{1}'.format(self.source, start_date)) + '/')

        end_date = self._get_date_from(self.end)
        end = None if not end_date else branches.index(
            normalize_path('{0}/{1}'.format(self.source, end_date)) + '/') + 1

        if is_day_hour(self.start) or is_day_hour(self.end):
            for branch in branches[start:end]:
                children = self.__get_directory_keys(
                    normalize_path(branch) + '/')
                if children:
                    paths = paths + children
                else:
                    paths.append(branch)
        else:
            paths = branches

        return paths
Exemplo n.º 5
0
 def source_key(self):
     return normalize_path(self.source)
Exemplo n.º 6
0
 def source_journal_key(self):
     return normalize_path('{0}/{1}'.format(self.metadata, self.file_name))
Exemplo n.º 7
0
 def source_key(self):
     return normalize_path(self.source)
Exemplo n.º 8
0
 def schema_key(self):
     return normalize_path('{0}/{1}'.format(self.metadata,
                                            self.schema.file_name))
Exemplo n.º 9
0
 def schema_key(self):
     return normalize_path(
         '{0}/{1}'.format(self.metadata, self.schema.file_name))
Exemplo n.º 10
0
 def manifest_key(self):
     return normalize_path('{0}/{1}'.format(self.metadata, self.file_name))
Exemplo n.º 11
0
 def source_journal_key(self):
     return normalize_path('{0}/{1}'.format(self.metadata, self.file_name))