Beispiel #1
0
 def updateFileInfo(self):
     file_path = self.getFilePath()
     if not file_path:
         return
     file_info = lib.get_file_info(file_path)
     self.setFileInfo(file_info)
     return
Beispiel #2
0
 def updateFileInfoText(self):
     file_path = self.getFilePath()
     info_widget = self.fileInfo_plainTextEdit
     valid = lib.is_valid_file_path(file_path)
     if valid is False:
         text = 'File path is not valid:\n'
         text += repr(file_path)
         info_widget.setPlainText(text)
         return
     text = 'Format: {fmt_name}\n'
     text += 'Frame Range: {start_frame}-{end_frame}\n'
     text += 'Number of Points: {num_points}\n'
     text += 'Point Names: {point_names}\n'
     info = lib.get_file_info(file_path)
     text = text.format(**info)
     info_widget.setPlainText(text)
     return
Beispiel #3
0
    def test_file_path(self):
        values = (
            ('match_mover', 'loadmarker.rz2'),
            ('uvtrack', 'test_v1.uv'),
            ('uvtrack', 'test_v3.uv'),
            ('uvtrack', 'test_v4.uv'),
        )
        for dir_name, file_name in values:
            path = self.get_data_path(dir_name, file_name)

            valid = lib_utils.is_valid_file_path(path)
            assert valid is True

            fmt = lib_utils.get_file_path_format(path)
            assert fmt is not None

            file_info = lib_utils.get_file_info(path)
            assert isinstance(file_info, interface.FileInfo)

            file_info_data = lib_utils.get_file_info_strings(path)
            assert isinstance(file_info_data, dict)
            assert len(file_info_data) == 11
            keys = file_info_data.keys()
            assert 'fmt' in keys
            assert 'fmt_name' in keys
            assert 'num_points' in keys
            assert 'point_names' in keys
            assert 'start_frame' in keys
            assert 'end_frame' in keys
            assert 'frame_range' in keys
            assert 'lens_dist' in keys
            assert 'lens_undist' in keys
            assert 'positions' in keys
            assert 'has_camera_fov' in keys

            start_dir = lib_utils.get_start_directory(path)
            assert os.path.isdir(start_dir) is True
        return