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])
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])
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
def source_key(self): return normalize_path(self.source)
def source_journal_key(self): return normalize_path('{0}/{1}'.format(self.metadata, self.file_name))
def schema_key(self): return normalize_path('{0}/{1}'.format(self.metadata, self.schema.file_name))
def schema_key(self): return normalize_path( '{0}/{1}'.format(self.metadata, self.schema.file_name))
def manifest_key(self): return normalize_path('{0}/{1}'.format(self.metadata, self.file_name))