Exemple #1
0
 def list_directory_split_md5(self, parent_1, parent_2):
     """ Create a directory listing of DirectoryEntry items based on MD5 path """
     res = self.run_sql("SELECT " + DirectoryEntry._catalog_db_fields() + " \
                         FROM catalog                                       \
                         WHERE parent_1 = " + str(parent_1) + " AND         \
                               parent_2 = " + str(parent_2) + "             \
                         ORDER BY name ASC;")
     return [ DirectoryEntry(result) for result in res ]
Exemple #2
0
 def find_directory_entry_split_md5(self, md5path_1, md5path_2):
     """ Finds the DirectoryEntry for the given split MD5 hashed path """
     res = self.run_sql("SELECT " + DirectoryEntry._catalog_db_fields() + " \
                         FROM catalog                                       \
                         WHERE md5path_1 = " + str(md5path_1) + " AND       \
                               md5path_2 = " + str(md5path_2) + "           \
                         LIMIT 1;")
     return DirectoryEntry(res[0]) if len(res) == 1 else None
Exemple #3
0
 def list_directory_split_md5(self, parent_1, parent_2):
     """ Create a directory listing of DirectoryEntry items based on MD5 path """
     res = self.run_sql("SELECT " + DirectoryEntry.catalog_db_fields() + " \
                         FROM catalog                                       \
                         WHERE parent_1 = " + str(parent_1) +
                        " AND         \
                               parent_2 = " + str(parent_2) +
                        "             \
                         ORDER BY name ASC;")
     for result in res:
         yield self._make_directory_entry(result)
Exemple #4
0
 def _make_directory_entry(self, result_set):
     dirent = DirectoryEntry(result_set)
     self._read_chunks(dirent)
     return dirent