Exemple #1
0
 def get_hid(self, root_uid=None):
     '''
     return a human readable identifier
     '''
     if root_uid is None:
         root_uid = self.get_root_uid()
     virtual_path = self.get_virtual_paths_for_one_uid(root_uid=root_uid)[0]
     return get_top_of_virtual_path(virtual_path)
Exemple #2
0
    def get_hid(self, root_uid: str = None) -> str:
        '''
        Get a human readable identifier for the given file.
        This usually is the file name for extracted files.
        As files can have different names across occurrences, uid of a specific root object can be specified.

        :param root_uid: (Optional) root uid to base HID on.
        :return: String representing a human readable identifier for this file.
        '''
        if root_uid is None:
            root_uid = self.get_root_uid()
        virtual_path = self.get_virtual_paths_for_one_uid(root_uid=root_uid)[0]
        return get_top_of_virtual_path(virtual_path)
Exemple #3
0
 def _get_file_path(file_object):
     return get_top_of_virtual_path(
         file_object.virtual_file_path[file_object.root_uid][0])
 def _get_one_virtual_path_of_fo(fo_dict, root_uid):
     if root_uid is None or root_uid not in fo_dict[
             'virtual_file_path'].keys():
         root_uid = list(fo_dict['virtual_file_path'].keys())[0]
     return get_top_of_virtual_path(
         fo_dict['virtual_file_path'][root_uid][0])