├── debian ├── compat ├── debhelper-build-stamp ├── install ├── rules ├── hdf5viewer.substvars ├── files ├── changelog ├── control └── copyright ├── src ├── img │ ├── file.ico │ ├── screenshot.jpg │ ├── dataset.svg │ ├── about.svg │ ├── group.svg │ ├── export.svg │ ├── file_clear.svg │ ├── quit.svg │ ├── file.svg │ ├── __init__.py │ └── img_path.py ├── gui │ ├── __init__.py │ ├── about_page.py │ ├── table_model.py │ └── main_window.py ├── lib_h5 │ ├── __init__.py │ ├── file_size.py │ ├── recursive_iterator.py │ └── dataset_types.py └── logging_config │ └── __init__.py ├── windows └── compile.iss ├── requirements_dev.txt ├── pages ├── static │ └── images │ │ └── screenshot.jpg ├── archetypes │ └── default.md ├── hugo.toml └── content │ └── _index.md ├── .gitmodules ├── requirements.txt ├── .gitignore ├── setup.py ├── test └── create_test_file.py ├── setup.cfg ├── Makefile ├── pyproject.toml ├── pyinstaller.py ├── main.py ├── .github └── workflows │ └── hugo.yaml ├── README.md └── LICENSE /debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /debian/debhelper-build-stamp: -------------------------------------------------------------------------------- 1 | hdf5viewer 2 | -------------------------------------------------------------------------------- /debian/install: -------------------------------------------------------------------------------- 1 | dist/hdf5viewer usr/bin/ 2 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | %: 4 | dh $@ 5 | -------------------------------------------------------------------------------- /debian/hdf5viewer.substvars: -------------------------------------------------------------------------------- 1 | misc:Depends= 2 | misc:Pre-Depends= 3 | -------------------------------------------------------------------------------- /src/img/file.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loenard97/hdf5-viewer/HEAD/src/img/file.ico -------------------------------------------------------------------------------- /windows/compile.iss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loenard97/hdf5-viewer/HEAD/windows/compile.iss -------------------------------------------------------------------------------- /src/img/screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loenard97/hdf5-viewer/HEAD/src/img/screenshot.jpg -------------------------------------------------------------------------------- /debian/files: -------------------------------------------------------------------------------- 1 | hdf5viewer_1.2_all.deb python optional 2 | hdf5viewer_1.2_amd64.buildinfo python optional 3 | -------------------------------------------------------------------------------- /requirements_dev.txt: -------------------------------------------------------------------------------- 1 | isort==5.13.2 2 | black==24.4.0 3 | flake9==3.8.3 4 | flake8-docstrings==1.7.0 5 | mypy==1.9.0 -------------------------------------------------------------------------------- /pages/static/images/screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loenard97/hdf5-viewer/HEAD/pages/static/images/screenshot.jpg -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "pages/themes/mainroad"] 2 | path = pages/themes/mainroad 3 | url = https://github.com/vimux/mainroad.git 4 | -------------------------------------------------------------------------------- /pages/archetypes/default.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = '{{ replace .File.ContentBaseName "-" " " | title }}' 3 | date = {{ .Date }} 4 | draft = true 5 | +++ 6 | -------------------------------------------------------------------------------- /pages/hugo.toml: -------------------------------------------------------------------------------- 1 | baseURL = 'https://loenard97.github.io/hdf5-viewer/' 2 | languageCode = 'en-us' 3 | title = 'HDF5 File Viewer' 4 | theme = 'mainroad' 5 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | hdf5viewer (0.2.0) UNRELEASED; urgency=low 2 | 3 | * 4 | 5 | -- dennis Thu, 24 Nov 2022 13:40:03 +0100 6 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | PyQt6>=6.7.0 2 | PyQt6-Qt6>=6.7.0 3 | h5py>=3.11.0 4 | numpy>=2.0.0 5 | pyqtgraph>=0.13.7 6 | pyinstaller>=6.9.0 7 | natsort>=8.4.0 8 | matplotlib>=3.9.1 9 | setuptools>=70.3.0 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /.mypy_cache 3 | /.pytest_cache 4 | /.tox 5 | /venv 6 | /build 7 | /dist 8 | /out 9 | /debian/.debhelper 10 | /debian/hdf5viewer 11 | /package 12 | /{envtempdir} 13 | /pages/public 14 | /pages/.hugo_build.lock 15 | *__pycache__* 16 | *.egg-info* 17 | *.exe 18 | *.spec 19 | *.h5 20 | *.hdf5 21 | *.csv 22 | *.npy 23 | *.png 24 | *.coverage 25 | *.log 26 | test.py 27 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: hdf5viewer 2 | Section: python 3 | Priority: optional 4 | Maintainer: Dennis Lönard, dennis.loenard97@gmx.de 5 | Build-Depends: debhelper (>=13), python3(>=3.9) 6 | Standards-Version: 3.9.2 7 | X-Python-Version: >=3.9 8 | 9 | 10 | Package: hdf5viewer 11 | Architecture: all 12 | Section: python 13 | Depends: ${misc:Depends}, ${python:Depends} 14 | Description: HDF5 File Viewer 15 | A File Viewer for HDF5 Files. 16 | -------------------------------------------------------------------------------- /src/img/dataset.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/img/about.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/img/group.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/img/export.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/img/file_clear.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/img/quit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/img/file.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/gui/__init__.py: -------------------------------------------------------------------------------- 1 | """Gui components.""" 2 | 3 | # Copyright (C) 2023 Dennis Lönard 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | -------------------------------------------------------------------------------- /src/img/__init__.py: -------------------------------------------------------------------------------- 1 | """Images, icons and related utils.""" 2 | 3 | # Copyright (C) 2023 Dennis Lönard 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | -------------------------------------------------------------------------------- /src/lib_h5/__init__.py: -------------------------------------------------------------------------------- 1 | """H5 File related functions and types.""" 2 | 3 | # Copyright (C) 2023 Dennis Lönard 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | """Build package with setuptools.""" 2 | 3 | # Copyright (C) 2023 Dennis Lönard 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | from setuptools import setup 19 | 20 | if __name__ == "__main__": 21 | setup() 22 | -------------------------------------------------------------------------------- /test/create_test_file.py: -------------------------------------------------------------------------------- 1 | """Script that generates a test .h5 file used for testing.""" 2 | 3 | import pathlib 4 | 5 | import h5py 6 | import numpy as np 7 | 8 | DIR = pathlib.Path(__file__).parent 9 | 10 | 11 | def main() -> None: 12 | """Generate .h5 file.""" 13 | with h5py.File(pathlib.Path(DIR, "test_file.h5"), "w") as file: 14 | # normal np arrays 15 | file.create_dataset("Array1D/Float", data=np.array([0.1, 0.2, 0.3, 0.4, 0.5])) 16 | file.create_dataset("Array1D/Integer", data=np.array([1, 2, 3, 4, 5])) 17 | 18 | # raveled np arrays 19 | file.create_dataset("Array1D/ColumnVector", data=np.array([[1], [2], [3], [4], [5]])) 20 | file.create_dataset("Array1D/RowVector", data=np.array([[1, 2, 3, 4, 5]])) 21 | file.create_dataset("Array1D/LongRowVector", data=np.array([[i for i in range(150)]])) 22 | 23 | 24 | if __name__ == "__main__": 25 | main() 26 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = hdf5viewer 3 | description = HDF5 File Viewer 4 | author = Dennis Lönard 5 | license = GPLv3 6 | license_files = LICENSE 7 | platforms = unix, linux, win32 8 | classifiers = 9 | Programming Language :: Python :: 3 10 | Programming Language :: Python :: 3 :: Only 11 | Programming Language :: Python :: 3.11 12 | 13 | [options] 14 | packages = 15 | hdf5viewer 16 | hdf5viewer.lib_h5 17 | install_requires = 18 | argparse==1.4.0 19 | PyQt6==6.5.0 20 | PyQt6-Qt6==6.5.0 21 | h5py==3.8.0 22 | numpy==1.24.2 23 | pyqtgraph==0.13.1 24 | pyinstaller==5.10.0 25 | python_requires = >=3.8 26 | package_dir = =src 27 | zip_safe = no 28 | 29 | [options.extras_require] 30 | testing = 31 | flake8==6.0.0 32 | mypy==1.2.0 33 | h5py==3.8.0 34 | 35 | [options.package_data] 36 | hdf5viewer = py.typed 37 | 38 | [flake8] 39 | max-line-length = 120 40 | exclude = 41 | .git 42 | build 43 | debian 44 | dist 45 | html 46 | img 47 | venv 48 | windows 49 | {envtempdir} 50 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | VENV = ./venv 2 | PYTHON = $(VENV)/bin/python 3 | PIP = $(VENV)/bin/pip 4 | CWD = $(shell pwd) 5 | 6 | all: 7 | @echo "HDF5 File Viewer make options:" 8 | @echo "venv: create python venv with all requirements" 9 | @echo "clean: clean cache files and directories" 10 | @echo "run: run program" 11 | @echo "debug: run program in debug mode" 12 | @echo "fmt: run code formatters" 13 | @echo "build: build deb package" 14 | 15 | venv: 16 | python3 -m venv $(VENV) 17 | $(PYTHON) -m pip install --upgrade pip 18 | $(PIP) install -r requirements.txt 19 | 20 | clean: 21 | rm -rf .mypy_cache .pytest_cache .tox build venv {envtempdir} .coverage main.spec 22 | 23 | debug: 24 | $(PYTHON) main.py --debug 25 | 26 | run: 27 | $(PYTHON) main.py 28 | 29 | fmt: 30 | isort . 31 | black . 32 | flake8 . 33 | mypy . 34 | 35 | build: 36 | @echo "running pyinstaller..." 37 | ./venv/bin/python3 pyinstaller.py 38 | 39 | @echo "running debuild..." 40 | debuild --no-tgz-check 41 | 42 | @echo "running cleanup..." 43 | mkdir -p package 44 | mkdir -p package/debian 45 | mv ../hdf5viewer_* package/debian 46 | 47 | 48 | .PHONY: all venv clean debug run fmt build 49 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.isort] 2 | profile = "black" 3 | line_length = 120 4 | src_paths = ["src", "main.py"] 5 | 6 | [tool.black] 7 | line-length = 120 8 | 9 | [tool.flake8] 10 | max-line-length = 120 11 | ignore = "D401" 12 | 13 | [tool.mypy] 14 | mypy_path = "src" 15 | exclude = ["venv", "dist"] 16 | allow_untyped_globals = false 17 | allow_redefinition = false 18 | check_untyped_defs = true 19 | disallow_any_generics = true 20 | disallow_any_explicit = false 21 | disallow_untyped_defs = true 22 | follow_imports = "skip" 23 | no_implicit_optional = true 24 | no_implicit_reexport = true 25 | show_error_codes = true 26 | strict_equality = true 27 | warn_redundant_casts = true 28 | warn_return_any = true 29 | warn_unreachable = true 30 | warn_unused_configs = true 31 | warn_no_return = true 32 | ignore_missing_imports = true 33 | implicit_optional = true 34 | implicit_reexport = true 35 | strict_optional = true 36 | ignore_errors = false 37 | local_partial_types = true 38 | show_error_context = true 39 | show_column_numbers = true 40 | hide_error_codes = false 41 | pretty = true 42 | color_output = true 43 | error_summary = true 44 | show_absolute_path = false 45 | incremental = true -------------------------------------------------------------------------------- /src/lib_h5/file_size.py: -------------------------------------------------------------------------------- 1 | """File size formatting util.""" 2 | 3 | # Copyright (C) 2023 Dennis Lönard 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | import os 19 | 20 | 21 | def file_size_to_str(file_path: str) -> str: 22 | """Get formatted file size.""" 23 | size = os.path.getsize(file_path) 24 | 25 | if size > 1024**3: 26 | return f"{size/1024**3:.2f} GB" 27 | elif size > 1024**2: 28 | return f"{size/1024**2:.2f} MB" 29 | elif size > 1024: 30 | return f"{size/1024:.2f} kB" 31 | else: 32 | return f"{size} bytes" 33 | -------------------------------------------------------------------------------- /src/img/img_path.py: -------------------------------------------------------------------------------- 1 | """Image path utils.""" 2 | 3 | # Copyright (C) 2023 Dennis Lönard 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | import logging 19 | import pathlib 20 | import sys 21 | 22 | 23 | def img_path() -> pathlib.Path: 24 | """ 25 | Get path to img directory 26 | """ 27 | if getattr(sys, "frozen", False): 28 | path = pathlib.Path(sys.executable).parent 29 | path = pathlib.Path(path, "_internal", "img") 30 | else: 31 | path = pathlib.Path(__file__).absolute().parent 32 | 33 | logging.info(f"Image path '{path}'") 34 | 35 | return path 36 | -------------------------------------------------------------------------------- /pyinstaller.py: -------------------------------------------------------------------------------- 1 | """Build executable with pyinstaller.""" 2 | 3 | # Copyright (C) 2023 Dennis Lönard 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | import sys 19 | 20 | import PyInstaller.__main__ 21 | 22 | 23 | def build() -> None: 24 | """Build executable with pyinstaller.""" 25 | build_args = [ 26 | "main.py", 27 | "--noconfirm", 28 | "--windowed", 29 | "--add-data=src/img/*:img", 30 | "--add-data=LICENSE:.", 31 | "--add-data=README.md:.", 32 | ] 33 | if sys.platform == "win32": 34 | build_args.append("--icon=src/img/file.ico") 35 | else: 36 | build_args.append("--onefile") 37 | 38 | PyInstaller.__main__.run(build_args) 39 | 40 | 41 | if __name__ == "__main__": 42 | build() 43 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | """HDF5 File Viewer entry point.""" 2 | 3 | # Copyright (C) 2023 Dennis Lönard 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | import logging.config 19 | import sys 20 | 21 | from PyQt6.QtWidgets import QApplication 22 | 23 | from src.gui.main_window import MainWindow 24 | from src.logging_config import logging_config 25 | 26 | if sys.platform == "win32": 27 | # Set Windows Taskbar Icon 28 | import ctypes 29 | 30 | ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID("hdf5viewer") 31 | 32 | 33 | def main() -> None: 34 | """HDF5 File Viewer entry point.""" 35 | logging.config.dictConfig(logging_config) 36 | logging.info("Starting GUI...") 37 | 38 | app = QApplication(sys.argv) 39 | app.setOrganizationName("HDF5Viewer") 40 | app.setApplicationName("HDF5ViewerPython") 41 | main_win = MainWindow() 42 | main_win.show() 43 | sys.exit(app.exec()) 44 | 45 | 46 | if __name__ == "__main__": 47 | main() 48 | -------------------------------------------------------------------------------- /src/logging_config/__init__.py: -------------------------------------------------------------------------------- 1 | """Logging config.""" 2 | 3 | # Copyright (C) 2023 Dennis Lönard 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | 19 | logging_config = { 20 | "version": 1, 21 | "disable_existing_loggers": False, 22 | "formatters": {"simple": {"format": "%(asctime)s: [%(levelname)s] - %(message)s"}}, 23 | "handlers": { 24 | "stdout": { 25 | "class": "logging.StreamHandler", 26 | "level": "DEBUG", 27 | "formatter": "simple", 28 | "stream": "ext://sys.stdout", 29 | }, 30 | # "file": { 31 | # "class": "logging.handlers.RotatingFileHandler", 32 | # "level": "DEBUG", 33 | # "formatter": "simple", 34 | # "filename": "hdf5fileviewer.log", 35 | # "maxBytes": 100_000, 36 | # "backupCount": 3, 37 | # }, 38 | }, 39 | "loggers": { 40 | "root": { 41 | "level": "DEBUG", 42 | "handlers": [ 43 | "stdout", 44 | # "file", 45 | ], 46 | } 47 | }, 48 | } 49 | -------------------------------------------------------------------------------- /src/lib_h5/recursive_iterator.py: -------------------------------------------------------------------------------- 1 | """Recursive iterators for files and groups.""" 2 | 3 | # Copyright (C) 2023 Dennis Lönard 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | import pathlib 19 | 20 | import h5py 21 | 22 | 23 | def recursive_h5(file_path: pathlib.Path) -> list[tuple[str, int, bool]]: 24 | """Iterate recursively through file.""" 25 | item_list = [] 26 | with h5py.File(file_path, "r") as file: 27 | for i, (name, obj) in enumerate(file.items()): 28 | is_last = i == len(file) - 1 29 | if str(type(obj)) == "": 30 | item_list.append((name, 0, is_last)) 31 | for e in recursive_group(file_path, f"{name}", 1): 32 | item_list.append(e) 33 | 34 | elif str(type(obj)) == "": 35 | item_list.append((f"{name}", 0, is_last)) 36 | 37 | return item_list 38 | 39 | 40 | def recursive_group(file_path: pathlib.Path, group: str, depth: int) -> list[tuple[str, int, bool]]: 41 | """Iterate recursively through group.""" 42 | item_list = [] 43 | with h5py.File(file_path, "r") as file: 44 | for i, (name, obj) in enumerate(file[group].items()): 45 | is_last = i == len(file[group]) - 1 46 | if str(type(obj)) == "": 47 | item_list.append((name, depth, is_last)) 48 | for e in recursive_group(file_path, f"{group}/{name}", depth + 1): 49 | item_list.append(e) 50 | 51 | elif str(type(obj)) == "": 52 | item_list.append((f"{name}", depth, is_last)) 53 | 54 | return item_list 55 | -------------------------------------------------------------------------------- /src/lib_h5/dataset_types.py: -------------------------------------------------------------------------------- 1 | """Dataset type classification.""" 2 | 3 | # Copyright (C) 2023 Dennis Lönard 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | from enum import Enum, auto 19 | 20 | import numpy.typing as npt 21 | 22 | 23 | class H5DatasetType(Enum): 24 | """Enum representing the type of data in a dataset.""" 25 | 26 | Unknown = auto() 27 | String = auto() 28 | Array1D = auto() 29 | Array2D = auto() 30 | ImageRGB = auto() 31 | Table = auto() 32 | 33 | @classmethod 34 | def from_string(cls, plot_type: str) -> "H5DatasetType": 35 | """Construct type from string.""" 36 | match plot_type: 37 | case "String": 38 | return cls.String 39 | case "Array1D": 40 | return cls.Array1D 41 | case "Array2D": 42 | return cls.Array2D 43 | case "Table": 44 | return cls.Table 45 | case "ImageRGB": 46 | return cls.ImageRGB 47 | case _: 48 | return cls.String 49 | 50 | @classmethod 51 | def from_numpy_array(cls, array: npt.NDArray) -> "H5DatasetType": 52 | """Construct type from numpy array.""" 53 | arr_type = str(array.dtype) 54 | arr_shape = len(array.shape) 55 | arr_size = array.size 56 | 57 | if arr_shape == 1 and ("int" in arr_type or "float" in arr_type): 58 | return cls.Array1D 59 | 60 | if arr_shape == 2 and ("int" in arr_type or "float" in arr_type) and arr_size < 100: 61 | return cls.Table 62 | 63 | if arr_shape == 3 and ("int" in arr_type or "float" in arr_type): 64 | return cls.ImageRGB 65 | 66 | return cls.String 67 | -------------------------------------------------------------------------------- /.github/workflows/hugo.yaml: -------------------------------------------------------------------------------- 1 | # Sample workflow for building and deploying a Hugo site to GitHub Pages 2 | name: Deploy Hugo site to Pages 3 | 4 | on: 5 | # Runs on pushes targeting the default branch 6 | push: 7 | branches: 8 | - main 9 | 10 | # Allows you to run this workflow manually from the Actions tab 11 | workflow_dispatch: 12 | 13 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 14 | permissions: 15 | contents: read 16 | pages: write 17 | id-token: write 18 | 19 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. 20 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. 21 | concurrency: 22 | group: "pages" 23 | cancel-in-progress: false 24 | 25 | # Default to bash 26 | defaults: 27 | run: 28 | shell: bash 29 | 30 | jobs: 31 | # Build job 32 | build: 33 | runs-on: ubuntu-latest 34 | env: 35 | HUGO_VERSION: 0.124.0 36 | steps: 37 | - name: Install Hugo CLI 38 | run: | 39 | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ 40 | && sudo dpkg -i ${{ runner.temp }}/hugo.deb 41 | # - name: Install Dart Sass 42 | # run: sudo snap install dart-sass 43 | - name: Checkout 44 | uses: actions/checkout@v4 45 | with: 46 | submodules: recursive 47 | fetch-depth: 0 48 | - name: Setup Pages 49 | id: pages 50 | uses: actions/configure-pages@v4 51 | - name: Install Node.js dependencies 52 | run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" 53 | - name: Build with Hugo 54 | env: 55 | # For maximum backward compatibility with Hugo modules 56 | HUGO_ENVIRONMENT: production 57 | HUGO_ENV: production 58 | run: | 59 | cd pages && hugo \ 60 | --gc \ 61 | --minify \ 62 | --baseURL "${{ steps.pages.outputs.base_url }}/" 63 | - name: Upload artifact 64 | uses: actions/upload-pages-artifact@v3 65 | with: 66 | path: ./pages/public 67 | 68 | # Deployment job 69 | deploy: 70 | environment: 71 | name: github-pages 72 | url: ${{ steps.deployment.outputs.page_url }} 73 | runs-on: ubuntu-latest 74 | needs: build 75 | steps: 76 | - name: Deploy to GitHub Pages 77 | id: deployment 78 | uses: actions/deploy-pages@v4 79 | 80 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # HDF5 File Viewer 4 | A Python based file viewer for HDF5 files 5 | 6 | ![last commit](https://img.shields.io/github/last-commit/loenard97/hdf5-viewer?&style=for-the-badge&logo=github&color=3776AB) 7 | ![repo size](https://img.shields.io/github/repo-size/loenard97/hdf5-viewer?&style=for-the-badge&logo=github&color=3776AB) 8 | 9 |
10 | 11 | 12 | HDF5 Files are developed by the [HDF Group](https://www.hdfgroup.org/solutions/hdf5/). 13 | Each File can contain Groups that work similarly to folders and Datasets that represent raw data. 14 | They are widely used in Industry and Academia to store large sets of raw data. 15 | 16 | 17 | ## 📋 Features 18 | - Open, or simply Drag&Drop, h5 files to view all groups and datasets 19 | - Supports remote files on a NAS for example 20 | - Display datasets as graphs or text 21 | - Export files to various other file formats, like .csv (Right-click on a plot to export) 22 | - Filter list of Datasets by name 23 | 24 | Files can be opened either by double-clicking, drag-and-drop or via the File menu. 25 | ![Screenshot](src/img/screenshot.jpg) 26 | 27 | 28 | ## ▶️ Installation 29 | ### Windows & Linux 30 | Windows Installers and Linux executables are listed on the 31 | [Releases](https://github.com/loenard97/hdf5-viewer/releases) page. Simply download and run the corresponding version. 32 | 33 | 34 | ### Mac & building binaries from source 35 | The HDF5Viewer should run on Mac, but I can not provide executables, because I do not own a Mac. 36 | You will have to download the code and use 37 | ```commandline 38 | python3 -m venv venv 39 | source venv/bin/activate 40 | pip install -r requirements.txt 41 | python main.py 42 | ``` 43 | to run it directly. Or generate the executable by running `python pyinstaller.py`. This will generate 44 | the executable in `/dist/main/main`. Use the `windows/compile.iss` script with Inno Setup to generate the Installer for 45 | Windows. 46 | 47 | 48 | ## 🔗 Acknowledgements and Licenses 49 | The following Python libraries are used in this project: 50 | - [PyQt6](https://riverbankcomputing.com/commercial/pyqt) 51 | - [h5py](https://docs.h5py.org/en/stable/licenses.html) 52 | - [numpy](https://numpy.org/doc/stable/license.html) 53 | - [natsort](https://github.com/SethMMorton/natsort) 54 | - [setuptools](https://github.com/pypa/setuptools) 55 | - [pyqtgraph](https://www.pyqtgraph.org/) 56 | - [PyInstaller](https://pyinstaller.org/en/stable/license.html) 57 | 58 | All icons are part of the *Core Line - Free* Icon-set from [Streamline](https://www.streamlinehq.com/) 59 | and are licensed under a [Link-ware License](https://www.streamlinehq.com/license-freeLinkware). 60 | -------------------------------------------------------------------------------- /pages/content/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "HDF5 File Viewer" 3 | 4 | description: "A Python based file viewer for HDF5 files" 5 | theme_version: '2.8.2' 6 | cascade: 7 | featured_image: 'images/screenshot.jpg' 8 | --- 9 | 10 | 11 | # 🖥️ Download 12 | - [Windows Installer](https://github.com/loenard97/hdf5-viewer/releases/download/v0.1.0/HDF5Viewer_Windows_Installer_v0.1.0.exe) 13 | 14 | 15 | # 📋 Features 16 | HDF5 Files are developed by the [HDF Group](https://www.hdfgroup.org/solutions/hdf5/). 17 | Each File can contain Groups that work similarly to folders and Datasets that represent raw data. 18 | They are widely used in Industry and Academia to store large sets of raw data. 19 | 20 | - Open, or simply Drag&Drop, h5 files to view all groups and datasets 21 | - Supports remote files on a NAS for example 22 | - Display datasets as graphs or text 23 | - Export files to various other file formats 24 | 25 | Files can be opened either by double-clicking, drag-and-drop or via the File menu. 26 | 27 | ![Screenshot](/images/screenshot.jpg) 28 | 29 | 30 | # ▶️ Installation 31 | ## Windows 32 | Simply download and execute the `HDF5Viewer_Windows_Installer_*version*.exe` 33 | from the [Releases](https://github.com/loenard97/hdf5-viewer/releases) page 34 | and follow the instructions. 35 | 36 | ## Debian-like Linux Distros 37 | Download the `hdf5viewer_*version*_all.deb` package from the 38 | [Releases](https://github.com/loenard97/hdf5-viewer/releases) page. 39 | 40 | Open a Terminal in the Download Folder and install the package with 41 | ```commandline 42 | sudo apt install ./hdf5viewer_*version*_all.deb 43 | ``` 44 | This will install the program in `/usr/bin/hdf5viewer/hdf5viewer`. 45 | You will have to manually create a desktop shortcut and associate file extensions with the program. 46 | 47 | 48 | ## Building binaries from source 49 | Running `python pyinstaller.py` will generate the binary in `/dist/main/main`. 50 | Use the `windows/compile.iss` script with Inno Setup to generate Installer on Windows. 51 | Run `make build` with `build-essential devscripts debhelper` installed to generate a deb package on Linux. 52 | 53 | 54 | ## Install from Source 55 | For all other Linux Distros you will have to download the Source Code and build it for yourself. 56 | I suggest creating a Python Virtual Environment: 57 | ```commandline 58 | python3 -m venv venv 59 | source venv/bin/activate 60 | pip install requirements.txt 61 | python main.py 62 | ``` 63 | 64 | # 🔗 Acknowledgements and Licenses 65 | The following Python libraries are used in this project: 66 | - [PyQt6](https://riverbankcomputing.com/commercial/pyqt) 67 | - [h5py](https://docs.h5py.org/en/stable/licenses.html) 68 | - [numpy](https://numpy.org/doc/stable/license.html) 69 | - [natsort](https://github.com/SethMMorton/natsort) 70 | - [setuptools](https://github.com/pypa/setuptools) 71 | - [pyqtgraph](https://www.pyqtgraph.org/) 72 | - [PyInstaller](https://pyinstaller.org/en/stable/license.html) 73 | 74 | All icons are part of the *Core Line - Free* Icon-set from [Streamline](https://www.streamlinehq.com/) 75 | and are licensed under a [Link-ware License](https://www.streamlinehq.com/license-freeLinkware). 76 | 77 | -------------------------------------------------------------------------------- /src/gui/about_page.py: -------------------------------------------------------------------------------- 1 | """About Page rendered with html/about_page.html text.""" 2 | 3 | # Copyright (C) 2023 Dennis Lönard 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | import pathlib 19 | 20 | from PyQt6.QtGui import QIcon 21 | from PyQt6.QtWidgets import QTextBrowser, QVBoxLayout, QWidget 22 | 23 | from src.img.img_path import img_path 24 | 25 | 26 | class AboutPage(QWidget): 27 | """About Page rendered with html/about_page.html text.""" 28 | 29 | def __init__(self) -> None: 30 | """About Page rendered with html/about_page.html text.""" 31 | super().__init__() 32 | self.icon_dir = img_path() 33 | self.setWindowTitle("About Page") 34 | self.setMinimumSize(700, 500) 35 | self.setWindowIcon(QIcon(str(pathlib.Path(self.icon_dir, "about.svg")))) 36 | 37 | layout = QVBoxLayout() 38 | text = QTextBrowser(self) 39 | text.setOpenExternalLinks(True) 40 | text.setHtml(self.html_contents()) 41 | layout.addWidget(text) 42 | self.setLayout(layout) 43 | self.show() 44 | 45 | @staticmethod 46 | def html_contents() -> str: 47 | """Return html content of help page.""" 48 | # Baked into Python code here, so that it is inside the frozen executable, and we don't have to search for the 49 | # file path 50 | 51 | return ( 52 | "

HDF5 Viewer

" 53 | "The source code for this HDF5 File Viewer can be found on " 54 | 'GitHub.' 55 | "

Acknowledgements and Licenses

" 56 | "The following Python libraries are used in this project:" 57 | "" 67 | "All icons are part of the Core Line - Free Icon-set from " 68 | 'Streamline' 69 | "and are licensed under a " 70 | 'Link-ware License.' 71 | ) 72 | -------------------------------------------------------------------------------- /src/gui/table_model.py: -------------------------------------------------------------------------------- 1 | """Children of QAbstractTableModel.""" 2 | 3 | # Copyright (C) 2023 Dennis Lönard 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | from typing import Any 19 | 20 | import numpy.typing as npt 21 | from PyQt6.QtCore import QAbstractTableModel, QModelIndex, Qt 22 | 23 | 24 | class TableModel(QAbstractTableModel): 25 | """Table Model that can append and remove Rows.""" 26 | 27 | def __init__(self, header: list[str]) -> None: 28 | """Table Model that can append and remove Rows.""" 29 | QAbstractTableModel.__init__(self) 30 | self._header = header 31 | self._data: list[Any] = [] 32 | 33 | def rowCount(self, parent: None | QModelIndex = None) -> int: 34 | """Get Row Count.""" 35 | return len(self._data) 36 | 37 | def columnCount(self, parent: None | QModelIndex = None) -> int: 38 | """Get Column Count.""" 39 | return len(self._header) 40 | 41 | def flags(self, index: QModelIndex) -> Qt.ItemFlag: 42 | """Item Flags for Cell at Index.""" 43 | return Qt.ItemFlag.ItemIsSelectable | Qt.ItemFlag.ItemIsEnabled 44 | 45 | def appendRow(self, new_data: list[Any]) -> bool: 46 | """Append Row.""" 47 | self.beginInsertRows(QModelIndex(), self.rowCount(), self.rowCount()) 48 | self._data.append(new_data) 49 | self.endInsertRows() 50 | return True 51 | 52 | def removeRow(self, row: int, parent: None | QModelIndex = None) -> bool: 53 | """Remove Row.""" 54 | self.beginRemoveRows(QModelIndex(), row, row) 55 | try: 56 | self._data.pop(row) 57 | except IndexError: 58 | self.endRemoveRows() 59 | return False 60 | self.endRemoveRows() 61 | return True 62 | 63 | def data(self, index: QModelIndex, role: int = Qt.ItemDataRole.DisplayRole) -> Any: 64 | """Get Data, Alignment, Colors etc. depending on Role.""" 65 | if role == Qt.ItemDataRole.DisplayRole: 66 | return self._data[index.row()][index.column()] 67 | 68 | def setData(self, index: QModelIndex, value: str, role: int = Qt.ItemDataRole.EditRole) -> bool: 69 | """Set Data when Cell is edited.""" 70 | if role != Qt.ItemDataRole.EditRole: 71 | return False 72 | 73 | self._data[index.row()][index.column()] = value 74 | self.dataChanged.emit(index, index) 75 | return True 76 | 77 | def getData(self, index: Any = None) -> Any: 78 | """Get Data at Index or Row.""" 79 | if index is None: 80 | return self._data 81 | elif isinstance(index, QModelIndex): 82 | return self._data[index.row()][index.column()] 83 | elif isinstance(index, int): 84 | return self._data[index] 85 | 86 | def resetData(self) -> None: 87 | """Reset to Empty Table.""" 88 | for i in range(self.rowCount()): 89 | self.removeRow(0) 90 | 91 | def headerData( 92 | self, 93 | section: int, 94 | orientation: Qt.Orientation, 95 | role: int = Qt.ItemDataRole.DisplayRole, 96 | ) -> None | str | int: 97 | """Get Headers for horizontal | vertical Orientation.""" 98 | if role == Qt.ItemDataRole.DisplayRole: 99 | if orientation == Qt.Orientation.Horizontal: 100 | return self._header[section] 101 | if orientation == Qt.Orientation.Vertical: 102 | return section + 1 103 | return None 104 | 105 | 106 | class DataTable(QAbstractTableModel): 107 | """Table Model for 2D Numpy Arrays.""" 108 | 109 | def __init__(self, data: npt.NDArray) -> None: 110 | """Table Model for 2D Numpy Arrays.""" 111 | QAbstractTableModel.__init__(self) 112 | self._data = data 113 | 114 | def rowCount(self, parent: None | QModelIndex = None) -> int: 115 | """Get Row Count.""" 116 | return int(self._data.shape[0]) 117 | 118 | def columnCount(self, parent: None | QModelIndex = None) -> int: 119 | """Get Column Count.""" 120 | return int(self._data.shape[1]) 121 | 122 | def data(self, index: QModelIndex, role: int = Qt.ItemDataRole.DisplayRole) -> None | float: 123 | """Get Data, Alignment, Colors etc. depending on Role.""" 124 | if role == Qt.ItemDataRole.DisplayRole: 125 | return float(self._data[index.row()][index.column()]) 126 | return None 127 | -------------------------------------------------------------------------------- /src/gui/main_window.py: -------------------------------------------------------------------------------- 1 | """Main Window of the GUI.""" 2 | 3 | # Copyright (C) 2023 Dennis Lönard 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | 18 | import logging 19 | import os 20 | import pathlib 21 | import sys 22 | from typing import Any, Generator 23 | 24 | import h5py 25 | import numpy as np 26 | import pyqtgraph as pg 27 | from natsort import natsorted 28 | from PyQt6.QtCore import QModelIndex, QPoint, QSettings, QSize, QSortFilterProxyModel, Qt, pyqtSlot 29 | from PyQt6.QtGui import ( 30 | QAction, 31 | QCloseEvent, 32 | QDragEnterEvent, 33 | QDropEvent, 34 | QIcon, 35 | QKeySequence, 36 | QShortcut, 37 | QStandardItem, 38 | QStandardItemModel, 39 | ) 40 | from PyQt6.QtWidgets import ( 41 | QComboBox, 42 | QCompleter, 43 | QDockWidget, 44 | QFileDialog, 45 | QFormLayout, 46 | QHBoxLayout, 47 | QLineEdit, 48 | QMainWindow, 49 | QMenu, 50 | QPushButton, 51 | QTableView, 52 | QTextBrowser, 53 | QTreeView, 54 | QVBoxLayout, 55 | QWidget, 56 | ) 57 | 58 | from src.gui.about_page import AboutPage 59 | from src.gui.table_model import DataTable, TableModel 60 | from src.img.img_path import img_path 61 | from src.lib_h5.dataset_types import H5DatasetType 62 | from src.lib_h5.file_size import file_size_to_str 63 | 64 | 65 | class MainWindow(QMainWindow): 66 | """Start Main Window of the GUI.""" 67 | 68 | def __init__(self) -> None: 69 | """Start Main Window of the GUI.""" 70 | super().__init__(flags=Qt.WindowType.Window) 71 | self.setAcceptDrops(True) 72 | 73 | # Variables 74 | self.cur_file = pathlib.Path() 75 | self.cur_obj_path = "" 76 | self.icon_dir = img_path() 77 | 78 | # Appearance 79 | settings = QSettings() 80 | self.setMinimumSize(1400, 700) 81 | self.setWindowTitle("HDF5 Viewer") 82 | self.resize(settings.value("main_window/size", defaultValue=QSize(1400, 700))) 83 | self.move(settings.value("main_window/position", defaultValue=QPoint(300, 150))) 84 | self.setWindowIcon(QIcon(str(pathlib.Path(self.icon_dir, "file.svg")))) 85 | 86 | # Layout Right Side 87 | self.table_model_dataset = TableModel(header=["Attribute", "Value"]) 88 | self.table_view_dataset = QTableView() 89 | self.table_view_dataset.setMinimumWidth(700) 90 | self.table_view_dataset.setModel(self.table_model_dataset) 91 | self.table_view_dataset.setColumnWidth(1, 300) 92 | self.plot_wgt_dataset = pg.PlotWidget() 93 | 94 | self.dock_table = QDockWidget() 95 | self.dock_table.setWindowTitle("Attributes") 96 | self.dock_table.setWidget(self.table_view_dataset) 97 | self.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.dock_table) 98 | self.dock_plot = QDockWidget() 99 | self.dock_plot.setWindowTitle("Data") 100 | self.dock_plot.setWidget(self.plot_wgt_dataset) 101 | self.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.dock_plot) 102 | 103 | # Center Layout 104 | self.tree_view_file = QTreeView() 105 | self.tree_view_file.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu) 106 | self.tree_view_file.customContextMenuRequested.connect(self._handle_tree_menu) 107 | self.tree_model_file = QStandardItemModel() 108 | self.tree_model_file.setHorizontalHeaderLabels(["Name", "Type"]) 109 | self.tree_model_file_proxy = QSortFilterProxyModel() 110 | self.tree_model_file_proxy.setRecursiveFilteringEnabled(True) 111 | 112 | self.tree_model_file_proxy.setSourceModel(self.tree_model_file) 113 | self.tree_view_file.setModel(self.tree_model_file_proxy) 114 | self.tree_view_file.setColumnWidth(0, 500) 115 | self.tree_view_file.setAcceptDrops(True) 116 | self.tree_view_file.clicked.connect(self._handle_item_changed) 117 | 118 | self.btn_filter_regex = QPushButton("RegExp") 119 | self.btn_filter_regex.setCheckable(True) 120 | self.btn_filter_regex.clicked.connect(self._handle_filter_changed) 121 | self.btn_filter_case = QPushButton("Cc") 122 | self.btn_filter_case.setCheckable(True) 123 | self.btn_filter_case.clicked.connect(self._handle_filter_changed) 124 | self.le_filter = QLineEdit() 125 | self.le_filter.setPlaceholderText("Search in all files (press 'f' to focus)") 126 | self.act_filter = QShortcut(QKeySequence(Qt.Key.Key_F), self) 127 | self.act_filter.activated.connect(self.le_filter.setFocus) 128 | self.le_filter.textEdited.connect(self._handle_filter_changed) 129 | self.completer = QCompleter() 130 | self.completer.setCaseSensitivity(Qt.CaseSensitivity.CaseInsensitive) 131 | self.le_filter.setCompleter(self.completer) 132 | 133 | lyt_plot_type = QFormLayout() 134 | self.cb_plot_type = QComboBox() 135 | self.cb_plot_type.addItems(["Auto", "String", "Array1D", "Array2D", "ImageRGB", "Table"]) 136 | self.cb_plot_type.currentTextChanged.connect(self._handle_plot_type_changed) 137 | lyt_plot_type.addRow("Plot as", self.cb_plot_type) 138 | 139 | lyt_filter = QHBoxLayout() 140 | lyt_filter.addWidget(self.btn_filter_regex) 141 | lyt_filter.addWidget(self.btn_filter_case) 142 | lyt_filter.addWidget(self.le_filter) 143 | 144 | lyt_file_tree = QVBoxLayout() 145 | lyt_file_tree.addWidget(self.tree_view_file) 146 | lyt_file_tree.addLayout(lyt_filter) 147 | lyt_file_tree.addLayout(lyt_plot_type) 148 | 149 | wgt_total = QHBoxLayout() 150 | wgt_total.addLayout(lyt_file_tree) 151 | # wgt_total.addLayout(self.lyt_dataset) 152 | wgt_central = QWidget() 153 | wgt_central.setLayout(wgt_total) 154 | self.setCentralWidget(wgt_central) 155 | 156 | # File Menu 157 | if (menu_bar := self.menuBar()) is None: 158 | return 159 | if (mbr_file := menu_bar.addMenu("&File")) is not None: 160 | act_file = QAction("&Open File...", self) 161 | act_file.setIcon(QIcon(str(pathlib.Path(self.icon_dir, "file.svg")))) 162 | act_file.setShortcut("Ctrl+O") 163 | act_file.triggered.connect(self._handle_action_open_file) 164 | mbr_file.addAction(act_file) 165 | act_open_folder = QAction("&Open Folder...", self) 166 | act_open_folder.setIcon(QIcon(str(pathlib.Path(self.icon_dir, "group.svg")))) 167 | act_open_folder.triggered.connect(self._handle_action_open_folder) 168 | mbr_file.addAction(act_open_folder) 169 | act_clear_files = QAction("&Close all Files", self) 170 | act_clear_files.setIcon(QIcon(str(pathlib.Path(self.icon_dir, "file_clear.svg")))) 171 | act_clear_files.triggered.connect(self._handle_action_clear_files) 172 | mbr_file.addAction(act_clear_files) 173 | mbr_file.addSeparator() 174 | act_quit = QAction("&Quit", self) 175 | act_quit.setIcon(QIcon(str(pathlib.Path(self.icon_dir, "quit.svg")))) 176 | act_quit.setShortcut("Ctrl+Q") 177 | act_quit.triggered.connect(self._handle_close) 178 | mbr_file.addAction(act_quit) 179 | 180 | # Help Menu 181 | if (mbr_help := menu_bar.addMenu("&Help")) is not None: 182 | act_about = QAction("&About Page...", self) 183 | act_about.setIcon(QIcon(os.path.join(self.icon_dir, "about.svg"))) 184 | act_about.triggered.connect(self._handle_action_about) 185 | mbr_help.addAction(act_about) 186 | 187 | # Open File when double-clicking 188 | if len(sys.argv) > 1: 189 | self._open_file(pathlib.Path(sys.argv[0])) 190 | for file in settings.value("settings/last_opened_files", ()): 191 | self._open_file(file) 192 | 193 | @staticmethod 194 | def iter_items(root: QStandardItem) -> Generator[Any, Any, None]: 195 | """Iterate recursively through all children of a QStandardItem.""" 196 | 197 | def recurse(parent: QStandardItem) -> Generator[Any, Any, None]: 198 | for row in range(parent.rowCount()): 199 | if (child := parent.child(row, 0)) is not None: 200 | yield child.text() 201 | if child.hasChildren(): 202 | yield from recurse(child) 203 | 204 | if root is not None: 205 | yield from recurse(root) 206 | 207 | @property 208 | def selected_item(self) -> tuple[pathlib.Path, str, Any]: 209 | """Tuple of selected file name, object name and object type.""" 210 | if not self.cur_obj_path: 211 | obj_type = h5py.File 212 | else: 213 | with h5py.File(self.cur_file, "r") as file: 214 | obj_type = type(file[self.cur_obj_path]) 215 | 216 | return self.cur_file, self.cur_obj_path, obj_type 217 | 218 | @property 219 | def opened_files(self) -> tuple[pathlib.Path, ...]: 220 | """Currently opened files.""" 221 | file_paths = [] 222 | for i in range(self.tree_model_file.rowCount()): 223 | if (item := self.tree_model_file.item(i, 0)) is not None: 224 | file_paths.append(pathlib.Path(item.text())) 225 | return tuple(file_paths) 226 | 227 | def _open_file(self, file_path: pathlib.Path) -> None: 228 | """ 229 | Open one File. 230 | 231 | :param str file_path: File Path 232 | """ 233 | logging.info(f"Open file '{file_path}'") 234 | try: 235 | # Load TreeModel from File 236 | with h5py.File(file_path, "r") as file: 237 | parent_name = QStandardItem(str(file_path)) 238 | parent_name.setEditable(False) 239 | parent_text = QStandardItem("HDF5 File") 240 | parent_text.setEditable(False) 241 | parent_text.setIcon(QIcon(str(pathlib.Path(self.icon_dir, "file.svg")))) 242 | self._hdf5_recursion(hdf5_object=file, root=parent_name, parent=parent_name) 243 | self.tree_model_file.appendRow([parent_name, parent_text]) 244 | except (OSError, ValueError) as err: 245 | logging.warning(f"Failed to open file. Error: '{err}'") 246 | 247 | if (root := self.tree_model_file.invisibleRootItem()) is not None: 248 | self.completer = QCompleter(list(self.iter_items(root))) 249 | self.completer.setCaseSensitivity( 250 | Qt.CaseSensitivity.CaseSensitive 251 | if self.btn_filter_case.isChecked() 252 | else Qt.CaseSensitivity.CaseInsensitive 253 | ) 254 | self.le_filter.setCompleter(self.completer) 255 | 256 | def _hdf5_recursion( 257 | self, 258 | hdf5_object: h5py.File | h5py.Group | h5py.Dataset, 259 | root: QStandardItem, 260 | parent: QStandardItem, 261 | ) -> None: 262 | """Recursively go through hdf5 File and construct tree view model.""" 263 | for name in natsorted(hdf5_object): 264 | value = hdf5_object[name] 265 | if isinstance(value, h5py.Group): 266 | child_name = QStandardItem(name) 267 | child_name.setEditable(False) 268 | child_type = QStandardItem("Group") 269 | child_type.setEditable(False) 270 | child_type.setIcon(QIcon(str(pathlib.Path(self.icon_dir, "group.svg")))) 271 | parent.appendRow([child_name, child_type]) 272 | self._hdf5_recursion(value, root, child_name) 273 | elif isinstance(value, h5py.Dataset): 274 | child_name = QStandardItem(name) 275 | child_name.setEditable(False) 276 | child_type = QStandardItem("Dataset") 277 | child_type.setEditable(False) 278 | child_type.setIcon(QIcon(str(pathlib.Path(self.icon_dir, "dataset.svg")))) 279 | parent.appendRow([child_name, child_type]) 280 | 281 | @pyqtSlot() 282 | def _plot_data(self, plot_type: str = "") -> None: 283 | """ 284 | Update Plot Widget. 285 | 286 | :param str plot_type: Plot Type 287 | """ 288 | if self.cur_file is None or not self.cur_obj_path or not os.path.exists(self.cur_file): 289 | return 290 | 291 | with h5py.File(self.cur_file, "r") as file: 292 | h5_obj = file[self.cur_obj_path] 293 | if isinstance(h5_obj, h5py.Group): 294 | data = np.array([name for name in file[self.cur_obj_path]]) 295 | data_type = H5DatasetType.String 296 | if isinstance(h5_obj, h5py.Dataset): 297 | data = np.array(file[self.cur_obj_path]) 298 | if plot_type and plot_type != "Auto": 299 | data_type = H5DatasetType.from_string(plot_type) 300 | else: 301 | data_type = H5DatasetType.from_numpy_array(data) 302 | 303 | new_widget: QTextBrowser | pg.PlotWidget | pg.ImageView | QTableView | QWidget 304 | if data_type == H5DatasetType.String: 305 | if data.ndim == 0: 306 | label = data.item() 307 | if isinstance(label, bytes): 308 | label = label.decode() 309 | label = str(label) 310 | else: 311 | label = str(data) 312 | new_widget = QTextBrowser() 313 | new_widget.setText(label) 314 | elif data_type == H5DatasetType.Array1D: 315 | if data.ndim == 2 and min(data.shape) == 1: 316 | data = data.ravel() 317 | new_widget = pg.PlotWidget() 318 | try: 319 | new_widget.plot(data) 320 | except Exception as err: 321 | logging.error(f"Failed plot dataset as '{plot_type}'. Error: '{err}'") 322 | return 323 | elif data_type == H5DatasetType.Array2D: 324 | new_widget = pg.ImageView() 325 | try: 326 | new_widget.setImage(data) 327 | except Exception as err: 328 | logging.error(f"Failed plot dataset as '{plot_type}'. Error: '{err}'") 329 | return 330 | new_widget.setColorMap(pg.colormap.get("inferno")) 331 | elif data_type == H5DatasetType.Table: 332 | new_widget = QTableView() 333 | model = DataTable(data) 334 | new_widget.setModel(model) 335 | elif data_type == H5DatasetType.ImageRGB: 336 | data = np.sum(data, axis=0) 337 | new_widget = pg.ImageView() 338 | try: 339 | new_widget.setImage(data) 340 | except Exception as err: 341 | logging.error(f"Failed plot dataset as '{plot_type}'. Error: '{err}'") 342 | return 343 | new_widget.setColorMap(pg.colormap.get("inferno")) 344 | else: 345 | new_widget = QWidget() 346 | 347 | # Replace old Plot Widget 348 | self.dock_plot.setWidget(new_widget) 349 | # self.lyt_dataset.replaceWidget(self.plot_wgt_dataset, new_widget) 350 | # self.plot_wgt_dataset.hide() 351 | # self.plot_wgt_dataset.destroy() 352 | # self.plot_wgt_dataset = new_widget 353 | 354 | # ----- Drag & Drop ----- # 355 | def dragEnterEvent(self, event: QDragEnterEvent | None) -> None: 356 | """Accept Drag Events for h5 and hdf5 files to initiate Drag & Drop Events.""" 357 | if event is None: 358 | return 359 | if (mime_data := event.mimeData()) is None: 360 | return 361 | for file in mime_data.text().split("\n"): 362 | if len(file) == 0: 363 | continue 364 | if not file.split(".")[-1] in ["h5", "hdf5"]: 365 | return 366 | event.acceptProposedAction() 367 | 368 | def dropEvent(self, event: QDropEvent | None) -> None: 369 | """Open Files that are dropped into Window.""" 370 | if event is None: 371 | return 372 | if (mime_data := event.mimeData()) is None: 373 | return 374 | for file in mime_data.text().split("\n"): 375 | if sys.platform == "win32": 376 | file = file[8:] 377 | else: 378 | file = file.removeprefix("file:") 379 | self._open_file(pathlib.Path(file)) 380 | event.acceptProposedAction() 381 | 382 | # ----- Slots ----- # 383 | @pyqtSlot(str) 384 | def _handle_plot_type_changed(self, plot_type: str) -> None: 385 | """Update plot when new plot type is selected.""" 386 | self._plot_data(plot_type) 387 | 388 | @pyqtSlot(QModelIndex) 389 | def _handle_item_changed(self, index: None | QModelIndex) -> None: 390 | """Update Info of currently selected Item.""" 391 | if index is None: 392 | return 393 | 394 | parents_list = [index.data()] 395 | self._tree_recursion(index, parents_list) 396 | parents_list.reverse() 397 | path = "" 398 | for e in parents_list[1:]: 399 | path += "/" + e 400 | self.cur_file = pathlib.Path(parents_list[0]) 401 | self.cur_obj_path = path 402 | 403 | if len(parents_list) == 1: 404 | self.table_model_dataset.resetData() 405 | self.table_model_dataset.appendRow(["Name", parents_list[0]]) 406 | self.table_model_dataset.appendRow(["File Size", file_size_to_str(parents_list[0])]) 407 | return 408 | 409 | with h5py.File(parents_list[0], "r") as file: 410 | h5_obj = file[path] 411 | 412 | if isinstance(h5_obj, h5py.Group): 413 | self.table_model_dataset.resetData() 414 | self.table_model_dataset.appendRow(["Name", str(h5_obj.name)]) 415 | 416 | elif isinstance(h5_obj, h5py.Dataset): 417 | self.table_model_dataset.resetData() 418 | self.table_model_dataset.appendRow(["Name", str(h5_obj.name)]) 419 | self.table_model_dataset.appendRow(["Data", f"shape {h5_obj.shape} of type {h5_obj.dtype}"]) 420 | 421 | for attribute, value in h5_obj.attrs.items(): 422 | self.table_model_dataset.appendRow([attribute, str(value)]) 423 | 424 | self._plot_data(self.cb_plot_type.currentText()) 425 | 426 | def _tree_recursion(self, item: QModelIndex, path: list[str]) -> None: 427 | """Get Array of all Parents.""" 428 | if (data := item.parent().data()) is None: 429 | return 430 | path.append(data) 431 | self._tree_recursion(item.parent(), path) 432 | 433 | @pyqtSlot() 434 | def _handle_filter_changed(self) -> None: 435 | text = self.le_filter.text() 436 | if text: 437 | self.tree_view_file.expandAll() 438 | else: 439 | self.tree_view_file.collapseAll() 440 | self.tree_model_file_proxy.setFilterCaseSensitivity( 441 | Qt.CaseSensitivity.CaseSensitive if self.btn_filter_case.isChecked() else Qt.CaseSensitivity.CaseInsensitive 442 | ) 443 | if self.btn_filter_regex.isChecked(): 444 | self.tree_model_file_proxy.setFilterRegularExpression(text) 445 | else: 446 | self.tree_model_file_proxy.setFilterFixedString(text) 447 | self.completer.setCaseSensitivity( 448 | Qt.CaseSensitivity.CaseSensitive if self.btn_filter_case.isChecked() else Qt.CaseSensitivity.CaseInsensitive 449 | ) 450 | 451 | @pyqtSlot(QPoint) 452 | def _handle_tree_menu(self, pos: QPoint) -> None: 453 | # TODO: reload file button 454 | menu = QMenu(self) 455 | index = self.tree_view_file.indexAt(pos) 456 | if index.parent().data() is None: 457 | action = QAction("Close file", self) 458 | menu.addAction(action) 459 | action.triggered.connect(lambda: self.tree_model_file.removeRow(index.row())) 460 | 461 | if (viewport := self.tree_view_file.viewport()) is not None: 462 | menu.popup(viewport.mapToGlobal(pos)) 463 | 464 | @pyqtSlot() 465 | def _handle_action_open_file(self) -> None: 466 | """Open HDF5 Files.""" 467 | settings = QSettings() 468 | folder: pathlib.Path = pathlib.Path( 469 | settings.value("paths/last_opened_file_directory", defaultValue=os.path.expanduser("~")) 470 | ) 471 | default_path = str(folder.absolute()) if folder.absolute().exists() else os.path.expanduser("~") 472 | file_paths, _ = QFileDialog.getOpenFileNames( 473 | self, 474 | "Open File", 475 | default_path, 476 | "HDF5 File (*.hdf5, *.h5);;All Files (*.*)", 477 | ) 478 | if not file_paths: 479 | return 480 | 481 | settings.setValue("paths/last_opened_file_directory", pathlib.Path(file_paths[0]).parent) 482 | for file in file_paths: 483 | self._open_file(pathlib.Path(file)) 484 | 485 | @pyqtSlot() 486 | def _handle_action_open_folder(self) -> None: 487 | """Open all HDF5 Files in a Folder.""" 488 | settings = QSettings() 489 | folder: pathlib.Path = settings.value( 490 | "paths/last_opened_folder_directory", 491 | defaultValue=pathlib.Path(os.path.expanduser("~")), 492 | ) 493 | default_path = str(folder.absolute()) if folder.absolute().exists() else os.path.expanduser("~") 494 | folder_path = QFileDialog.getExistingDirectory(self, "Open Folder", default_path) 495 | if not folder_path: 496 | return 497 | 498 | settings.setValue("paths/last_opened_folder_directory", pathlib.Path(folder_path)) 499 | for file in os.listdir(folder_path): 500 | self._open_file(pathlib.Path(folder_path, file)) 501 | 502 | @pyqtSlot() 503 | def _handle_action_clear_files(self) -> None: 504 | """Clear Tree Widget.""" 505 | self.tree_model_file.clear() 506 | self.table_model_dataset.resetData() 507 | 508 | @pyqtSlot() 509 | def _handle_action_about(self) -> None: 510 | """Open About Page.""" 511 | self._about_page = AboutPage() 512 | 513 | @pyqtSlot() 514 | def _handle_close(self) -> None: 515 | """Close Window.""" 516 | self.close() 517 | 518 | @pyqtSlot() 519 | def closeEvent(self, a0: QCloseEvent | None) -> None: 520 | """Close Window.""" 521 | if a0 is None: 522 | return 523 | 524 | settings = QSettings() 525 | settings.setValue("main_window/size", self.size()) 526 | settings.setValue("main_window/position", self.pos()) 527 | settings.setValue("settings/last_opened_files", self.opened_files) 528 | settings.sync() 529 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: hdf5viewer 3 | Upstream-Contact: Dennis Lönard, dennis.loenard97@gmx.de 4 | 5 | Files: * 6 | Copyright: 2022, GPL-3.0 7 | GNU GENERAL PUBLIC LICENSE 8 | Version 3, 29 June 2007 9 | 10 | Copyright (C) 2007 Free Software Foundation, Inc. 11 | Everyone is permitted to copy and distribute verbatim copies 12 | of this license document, but changing it is not allowed. 13 | 14 | Preamble 15 | 16 | The GNU General Public License is a free, copyleft license for 17 | software and other kinds of works. 18 | 19 | The licenses for most software and other practical works are designed 20 | to take away your freedom to share and change the works. By contrast, 21 | the GNU General Public License is intended to guarantee your freedom to 22 | share and change all versions of a program--to make sure it remains free 23 | software for all its users. We, the Free Software Foundation, use the 24 | GNU General Public License for most of our software; it applies also to 25 | any other work released this way by its authors. You can apply it to 26 | your programs, too. 27 | 28 | When we speak of free software, we are referring to freedom, not 29 | price. Our General Public Licenses are designed to make sure that you 30 | have the freedom to distribute copies of free software (and charge for 31 | them if you wish), that you receive source code or can get it if you 32 | want it, that you can change the software or use pieces of it in new 33 | free programs, and that you know you can do these things. 34 | 35 | To protect your rights, we need to prevent others from denying you 36 | these rights or asking you to surrender the rights. Therefore, you have 37 | certain responsibilities if you distribute copies of the software, or if 38 | you modify it: responsibilities to respect the freedom of others. 39 | 40 | For example, if you distribute copies of such a program, whether 41 | gratis or for a fee, you must pass on to the recipients the same 42 | freedoms that you received. You must make sure that they, too, receive 43 | or can get the source code. And you must show them these terms so they 44 | know their rights. 45 | 46 | Developers that use the GNU GPL protect your rights with two steps: 47 | (1) assert copyright on the software, and (2) offer you this License 48 | giving you legal permission to copy, distribute and/or modify it. 49 | 50 | For the developers' and authors' protection, the GPL clearly explains 51 | that there is no warranty for this free software. For both users' and 52 | authors' sake, the GPL requires that modified versions be marked as 53 | changed, so that their problems will not be attributed erroneously to 54 | authors of previous versions. 55 | 56 | Some devices are designed to deny users access to install or run 57 | modified versions of the software inside them, although the manufacturer 58 | can do so. This is fundamentally incompatible with the aim of 59 | protecting users' freedom to change the software. The systematic 60 | pattern of such abuse occurs in the area of products for individuals to 61 | use, which is precisely where it is most unacceptable. Therefore, we 62 | have designed this version of the GPL to prohibit the practice for those 63 | products. If such problems arise substantially in other domains, we 64 | stand ready to extend this provision to those domains in future versions 65 | of the GPL, as needed to protect the freedom of users. 66 | 67 | Finally, every program is threatened constantly by software patents. 68 | States should not allow patents to restrict development and use of 69 | software on general-purpose computers, but in those that do, we wish to 70 | avoid the special danger that patents applied to a free program could 71 | make it effectively proprietary. To prevent this, the GPL assures that 72 | patents cannot be used to render the program non-free. 73 | 74 | The precise terms and conditions for copying, distribution and 75 | modification follow. 76 | 77 | TERMS AND CONDITIONS 78 | 79 | 0. Definitions. 80 | 81 | "This License" refers to version 3 of the GNU General Public License. 82 | 83 | "Copyright" also means copyright-like laws that apply to other kinds of 84 | works, such as semiconductor masks. 85 | 86 | "The Program" refers to any copyrightable work licensed under this 87 | License. Each licensee is addressed as "you". "Licensees" and 88 | "recipients" may be individuals or organizations. 89 | 90 | To "modify" a work means to copy from or adapt all or part of the work 91 | in a fashion requiring copyright permission, other than the making of an 92 | exact copy. The resulting work is called a "modified version" of the 93 | earlier work or a work "based on" the earlier work. 94 | 95 | A "covered work" means either the unmodified Program or a work based 96 | on the Program. 97 | 98 | To "propagate" a work means to do anything with it that, without 99 | permission, would make you directly or secondarily liable for 100 | infringement under applicable copyright law, except executing it on a 101 | computer or modifying a private copy. Propagation includes copying, 102 | distribution (with or without modification), making available to the 103 | public, and in some countries other activities as well. 104 | 105 | To "convey" a work means any kind of propagation that enables other 106 | parties to make or receive copies. Mere interaction with a user through 107 | a computer network, with no transfer of a copy, is not conveying. 108 | 109 | An interactive user interface displays "Appropriate Legal Notices" 110 | to the extent that it includes a convenient and prominently visible 111 | feature that (1) displays an appropriate copyright notice, and (2) 112 | tells the user that there is no warranty for the work (except to the 113 | extent that warranties are provided), that licensees may convey the 114 | work under this License, and how to view a copy of this License. If 115 | the interface presents a list of user commands or options, such as a 116 | menu, a prominent item in the list meets this criterion. 117 | 118 | 1. Source Code. 119 | 120 | The "source code" for a work means the preferred form of the work 121 | for making modifications to it. "Object code" means any non-source 122 | form of a work. 123 | 124 | A "Standard Interface" means an interface that either is an official 125 | standard defined by a recognized standards body, or, in the case of 126 | interfaces specified for a particular programming language, one that 127 | is widely used among developers working in that language. 128 | 129 | The "System Libraries" of an executable work include anything, other 130 | than the work as a whole, that (a) is included in the normal form of 131 | packaging a Major Component, but which is not part of that Major 132 | Component, and (b) serves only to enable use of the work with that 133 | Major Component, or to implement a Standard Interface for which an 134 | implementation is available to the public in source code form. A 135 | "Major Component", in this context, means a major essential component 136 | (kernel, window system, and so on) of the specific operating system 137 | (if any) on which the executable work runs, or a compiler used to 138 | produce the work, or an object code interpreter used to run it. 139 | 140 | The "Corresponding Source" for a work in object code form means all 141 | the source code needed to generate, install, and (for an executable 142 | work) run the object code and to modify the work, including scripts to 143 | control those activities. However, it does not include the work's 144 | System Libraries, or general-purpose tools or generally available free 145 | programs which are used unmodified in performing those activities but 146 | which are not part of the work. For example, Corresponding Source 147 | includes interface definition files associated with source files for 148 | the work, and the source code for shared libraries and dynamically 149 | linked subprograms that the work is specifically designed to require, 150 | such as by intimate data communication or control flow between those 151 | subprograms and other parts of the work. 152 | 153 | The Corresponding Source need not include anything that users 154 | can regenerate automatically from other parts of the Corresponding 155 | Source. 156 | 157 | The Corresponding Source for a work in source code form is that 158 | same work. 159 | 160 | 2. Basic Permissions. 161 | 162 | All rights granted under this License are granted for the term of 163 | copyright on the Program, and are irrevocable provided the stated 164 | conditions are met. This License explicitly affirms your unlimited 165 | permission to run the unmodified Program. The output from running a 166 | covered work is covered by this License only if the output, given its 167 | content, constitutes a covered work. This License acknowledges your 168 | rights of fair use or other equivalent, as provided by copyright law. 169 | 170 | You may make, run and propagate covered works that you do not 171 | convey, without conditions so long as your license otherwise remains 172 | in force. You may convey covered works to others for the sole purpose 173 | of having them make modifications exclusively for you, or provide you 174 | with facilities for running those works, provided that you comply with 175 | the terms of this License in conveying all material for which you do 176 | not control copyright. Those thus making or running the covered works 177 | for you must do so exclusively on your behalf, under your direction 178 | and control, on terms that prohibit them from making any copies of 179 | your copyrighted material outside their relationship with you. 180 | 181 | Conveying under any other circumstances is permitted solely under 182 | the conditions stated below. Sublicensing is not allowed; section 10 183 | makes it unnecessary. 184 | 185 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 186 | 187 | No covered work shall be deemed part of an effective technological 188 | measure under any applicable law fulfilling obligations under article 189 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 190 | similar laws prohibiting or restricting circumvention of such 191 | measures. 192 | 193 | When you convey a covered work, you waive any legal power to forbid 194 | circumvention of technological measures to the extent such circumvention 195 | is effected by exercising rights under this License with respect to 196 | the covered work, and you disclaim any intention to limit operation or 197 | modification of the work as a means of enforcing, against the work's 198 | users, your or third parties' legal rights to forbid circumvention of 199 | technological measures. 200 | 201 | 4. Conveying Verbatim Copies. 202 | 203 | You may convey verbatim copies of the Program's source code as you 204 | receive it, in any medium, provided that you conspicuously and 205 | appropriately publish on each copy an appropriate copyright notice; 206 | keep intact all notices stating that this License and any 207 | non-permissive terms added in accord with section 7 apply to the code; 208 | keep intact all notices of the absence of any warranty; and give all 209 | recipients a copy of this License along with the Program. 210 | 211 | You may charge any price or no price for each copy that you convey, 212 | and you may offer support or warranty protection for a fee. 213 | 214 | 5. Conveying Modified Source Versions. 215 | 216 | You may convey a work based on the Program, or the modifications to 217 | produce it from the Program, in the form of source code under the 218 | terms of section 4, provided that you also meet all of these conditions: 219 | 220 | a) The work must carry prominent notices stating that you modified 221 | it, and giving a relevant date. 222 | 223 | b) The work must carry prominent notices stating that it is 224 | released under this License and any conditions added under section 225 | 7. This requirement modifies the requirement in section 4 to 226 | "keep intact all notices". 227 | 228 | c) You must license the entire work, as a whole, under this 229 | License to anyone who comes into possession of a copy. This 230 | License will therefore apply, along with any applicable section 7 231 | additional terms, to the whole of the work, and all its parts, 232 | regardless of how they are packaged. This License gives no 233 | permission to license the work in any other way, but it does not 234 | invalidate such permission if you have separately received it. 235 | 236 | d) If the work has interactive user interfaces, each must display 237 | Appropriate Legal Notices; however, if the Program has interactive 238 | interfaces that do not display Appropriate Legal Notices, your 239 | work need not make them do so. 240 | 241 | A compilation of a covered work with other separate and independent 242 | works, which are not by their nature extensions of the covered work, 243 | and which are not combined with it such as to form a larger program, 244 | in or on a volume of a storage or distribution medium, is called an 245 | "aggregate" if the compilation and its resulting copyright are not 246 | used to limit the access or legal rights of the compilation's users 247 | beyond what the individual works permit. Inclusion of a covered work 248 | in an aggregate does not cause this License to apply to the other 249 | parts of the aggregate. 250 | 251 | 6. Conveying Non-Source Forms. 252 | 253 | You may convey a covered work in object code form under the terms 254 | of sections 4 and 5, provided that you also convey the 255 | machine-readable Corresponding Source under the terms of this License, 256 | in one of these ways: 257 | 258 | a) Convey the object code in, or embodied in, a physical product 259 | (including a physical distribution medium), accompanied by the 260 | Corresponding Source fixed on a durable physical medium 261 | customarily used for software interchange. 262 | 263 | b) Convey the object code in, or embodied in, a physical product 264 | (including a physical distribution medium), accompanied by a 265 | written offer, valid for at least three years and valid for as 266 | long as you offer spare parts or customer support for that product 267 | model, to give anyone who possesses the object code either (1) a 268 | copy of the Corresponding Source for all the software in the 269 | product that is covered by this License, on a durable physical 270 | medium customarily used for software interchange, for a price no 271 | more than your reasonable cost of physically performing this 272 | conveying of source, or (2) access to copy the 273 | Corresponding Source from a network server at no charge. 274 | 275 | c) Convey individual copies of the object code with a copy of the 276 | written offer to provide the Corresponding Source. This 277 | alternative is allowed only occasionally and noncommercially, and 278 | only if you received the object code with such an offer, in accord 279 | with subsection 6b. 280 | 281 | d) Convey the object code by offering access from a designated 282 | place (gratis or for a charge), and offer equivalent access to the 283 | Corresponding Source in the same way through the same place at no 284 | further charge. You need not require recipients to copy the 285 | Corresponding Source along with the object code. If the place to 286 | copy the object code is a network server, the Corresponding Source 287 | may be on a different server (operated by you or a third party) 288 | that supports equivalent copying facilities, provided you maintain 289 | clear directions next to the object code saying where to find the 290 | Corresponding Source. Regardless of what server hosts the 291 | Corresponding Source, you remain obligated to ensure that it is 292 | available for as long as needed to satisfy these requirements. 293 | 294 | e) Convey the object code using peer-to-peer transmission, provided 295 | you inform other peers where the object code and Corresponding 296 | Source of the work are being offered to the general public at no 297 | charge under subsection 6d. 298 | 299 | A separable portion of the object code, whose source code is excluded 300 | from the Corresponding Source as a System Library, need not be 301 | included in conveying the object code work. 302 | 303 | A "User Product" is either (1) a "consumer product", which means any 304 | tangible personal property which is normally used for personal, family, 305 | or household purposes, or (2) anything designed or sold for incorporation 306 | into a dwelling. In determining whether a product is a consumer product, 307 | doubtful cases shall be resolved in favor of coverage. For a particular 308 | product received by a particular user, "normally used" refers to a 309 | typical or common use of that class of product, regardless of the status 310 | of the particular user or of the way in which the particular user 311 | actually uses, or expects or is expected to use, the product. A product 312 | is a consumer product regardless of whether the product has substantial 313 | commercial, industrial or non-consumer uses, unless such uses represent 314 | the only significant mode of use of the product. 315 | 316 | "Installation Information" for a User Product means any methods, 317 | procedures, authorization keys, or other information required to install 318 | and execute modified versions of a covered work in that User Product from 319 | a modified version of its Corresponding Source. The information must 320 | suffice to ensure that the continued functioning of the modified object 321 | code is in no case prevented or interfered with solely because 322 | modification has been made. 323 | 324 | If you convey an object code work under this section in, or with, or 325 | specifically for use in, a User Product, and the conveying occurs as 326 | part of a transaction in which the right of possession and use of the 327 | User Product is transferred to the recipient in perpetuity or for a 328 | fixed term (regardless of how the transaction is characterized), the 329 | Corresponding Source conveyed under this section must be accompanied 330 | by the Installation Information. But this requirement does not apply 331 | if neither you nor any third party retains the ability to install 332 | modified object code on the User Product (for example, the work has 333 | been installed in ROM). 334 | 335 | The requirement to provide Installation Information does not include a 336 | requirement to continue to provide support service, warranty, or updates 337 | for a work that has been modified or installed by the recipient, or for 338 | the User Product in which it has been modified or installed. Access to a 339 | network may be denied when the modification itself materially and 340 | adversely affects the operation of the network or violates the rules and 341 | protocols for communication across the network. 342 | 343 | Corresponding Source conveyed, and Installation Information provided, 344 | in accord with this section must be in a format that is publicly 345 | documented (and with an implementation available to the public in 346 | source code form), and must require no special password or key for 347 | unpacking, reading or copying. 348 | 349 | 7. Additional Terms. 350 | 351 | "Additional permissions" are terms that supplement the terms of this 352 | License by making exceptions from one or more of its conditions. 353 | Additional permissions that are applicable to the entire Program shall 354 | be treated as though they were included in this License, to the extent 355 | that they are valid under applicable law. If additional permissions 356 | apply only to part of the Program, that part may be used separately 357 | under those permissions, but the entire Program remains governed by 358 | this License without regard to the additional permissions. 359 | 360 | When you convey a copy of a covered work, you may at your option 361 | remove any additional permissions from that copy, or from any part of 362 | it. (Additional permissions may be written to require their own 363 | removal in certain cases when you modify the work.) You may place 364 | additional permissions on material, added by you to a covered work, 365 | for which you have or can give appropriate copyright permission. 366 | 367 | Notwithstanding any other provision of this License, for material you 368 | add to a covered work, you may (if authorized by the copyright holders of 369 | that material) supplement the terms of this License with terms: 370 | 371 | a) Disclaiming warranty or limiting liability differently from the 372 | terms of sections 15 and 16 of this License; or 373 | 374 | b) Requiring preservation of specified reasonable legal notices or 375 | author attributions in that material or in the Appropriate Legal 376 | Notices displayed by works containing it; or 377 | 378 | c) Prohibiting misrepresentation of the origin of that material, or 379 | requiring that modified versions of such material be marked in 380 | reasonable ways as different from the original version; or 381 | 382 | d) Limiting the use for publicity purposes of names of licensors or 383 | authors of the material; or 384 | 385 | e) Declining to grant rights under trademark law for use of some 386 | trade names, trademarks, or service marks; or 387 | 388 | f) Requiring indemnification of licensors and authors of that 389 | material by anyone who conveys the material (or modified versions of 390 | it) with contractual assumptions of liability to the recipient, for 391 | any liability that these contractual assumptions directly impose on 392 | those licensors and authors. 393 | 394 | All other non-permissive additional terms are considered "further 395 | restrictions" within the meaning of section 10. If the Program as you 396 | received it, or any part of it, contains a notice stating that it is 397 | governed by this License along with a term that is a further 398 | restriction, you may remove that term. If a license document contains 399 | a further restriction but permits relicensing or conveying under this 400 | License, you may add to a covered work material governed by the terms 401 | of that license document, provided that the further restriction does 402 | not survive such relicensing or conveying. 403 | 404 | If you add terms to a covered work in accord with this section, you 405 | must place, in the relevant source files, a statement of the 406 | additional terms that apply to those files, or a notice indicating 407 | where to find the applicable terms. 408 | 409 | Additional terms, permissive or non-permissive, may be stated in the 410 | form of a separately written license, or stated as exceptions; 411 | the above requirements apply either way. 412 | 413 | 8. Termination. 414 | 415 | You may not propagate or modify a covered work except as expressly 416 | provided under this License. Any attempt otherwise to propagate or 417 | modify it is void, and will automatically terminate your rights under 418 | this License (including any patent licenses granted under the third 419 | paragraph of section 11). 420 | 421 | However, if you cease all violation of this License, then your 422 | license from a particular copyright holder is reinstated (a) 423 | provisionally, unless and until the copyright holder explicitly and 424 | finally terminates your license, and (b) permanently, if the copyright 425 | holder fails to notify you of the violation by some reasonable means 426 | prior to 60 days after the cessation. 427 | 428 | Moreover, your license from a particular copyright holder is 429 | reinstated permanently if the copyright holder notifies you of the 430 | violation by some reasonable means, this is the first time you have 431 | received notice of violation of this License (for any work) from that 432 | copyright holder, and you cure the violation prior to 30 days after 433 | your receipt of the notice. 434 | 435 | Termination of your rights under this section does not terminate the 436 | licenses of parties who have received copies or rights from you under 437 | this License. If your rights have been terminated and not permanently 438 | reinstated, you do not qualify to receive new licenses for the same 439 | material under section 10. 440 | 441 | 9. Acceptance Not Required for Having Copies. 442 | 443 | You are not required to accept this License in order to receive or 444 | run a copy of the Program. Ancillary propagation of a covered work 445 | occurring solely as a consequence of using peer-to-peer transmission 446 | to receive a copy likewise does not require acceptance. However, 447 | nothing other than this License grants you permission to propagate or 448 | modify any covered work. These actions infringe copyright if you do 449 | not accept this License. Therefore, by modifying or propagating a 450 | covered work, you indicate your acceptance of this License to do so. 451 | 452 | 10. Automatic Licensing of Downstream Recipients. 453 | 454 | Each time you convey a covered work, the recipient automatically 455 | receives a license from the original licensors, to run, modify and 456 | propagate that work, subject to this License. You are not responsible 457 | for enforcing compliance by third parties with this License. 458 | 459 | An "entity transaction" is a transaction transferring control of an 460 | organization, or substantially all assets of one, or subdividing an 461 | organization, or merging organizations. If propagation of a covered 462 | work results from an entity transaction, each party to that 463 | transaction who receives a copy of the work also receives whatever 464 | licenses to the work the party's predecessor in interest had or could 465 | give under the previous paragraph, plus a right to possession of the 466 | Corresponding Source of the work from the predecessor in interest, if 467 | the predecessor has it or can get it with reasonable efforts. 468 | 469 | You may not impose any further restrictions on the exercise of the 470 | rights granted or affirmed under this License. For example, you may 471 | not impose a license fee, royalty, or other charge for exercise of 472 | rights granted under this License, and you may not initiate litigation 473 | (including a cross-claim or counterclaim in a lawsuit) alleging that 474 | any patent claim is infringed by making, using, selling, offering for 475 | sale, or importing the Program or any portion of it. 476 | 477 | 11. Patents. 478 | 479 | A "contributor" is a copyright holder who authorizes use under this 480 | License of the Program or a work on which the Program is based. The 481 | work thus licensed is called the contributor's "contributor version". 482 | 483 | A contributor's "essential patent claims" are all patent claims 484 | owned or controlled by the contributor, whether already acquired or 485 | hereafter acquired, that would be infringed by some manner, permitted 486 | by this License, of making, using, or selling its contributor version, 487 | but do not include claims that would be infringed only as a 488 | consequence of further modification of the contributor version. For 489 | purposes of this definition, "control" includes the right to grant 490 | patent sublicenses in a manner consistent with the requirements of 491 | this License. 492 | 493 | Each contributor grants you a non-exclusive, worldwide, royalty-free 494 | patent license under the contributor's essential patent claims, to 495 | make, use, sell, offer for sale, import and otherwise run, modify and 496 | propagate the contents of its contributor version. 497 | 498 | In the following three paragraphs, a "patent license" is any express 499 | agreement or commitment, however denominated, not to enforce a patent 500 | (such as an express permission to practice a patent or covenant not to 501 | sue for patent infringement). To "grant" such a patent license to a 502 | party means to make such an agreement or commitment not to enforce a 503 | patent against the party. 504 | 505 | If you convey a covered work, knowingly relying on a patent license, 506 | and the Corresponding Source of the work is not available for anyone 507 | to copy, free of charge and under the terms of this License, through a 508 | publicly available network server or other readily accessible means, 509 | then you must either (1) cause the Corresponding Source to be so 510 | available, or (2) arrange to deprive yourself of the benefit of the 511 | patent license for this particular work, or (3) arrange, in a manner 512 | consistent with the requirements of this License, to extend the patent 513 | license to downstream recipients. "Knowingly relying" means you have 514 | actual knowledge that, but for the patent license, your conveying the 515 | covered work in a country, or your recipient's use of the covered work 516 | in a country, would infringe one or more identifiable patents in that 517 | country that you have reason to believe are valid. 518 | 519 | If, pursuant to or in connection with a single transaction or 520 | arrangement, you convey, or propagate by procuring conveyance of, a 521 | covered work, and grant a patent license to some of the parties 522 | receiving the covered work authorizing them to use, propagate, modify 523 | or convey a specific copy of the covered work, then the patent license 524 | you grant is automatically extended to all recipients of the covered 525 | work and works based on it. 526 | 527 | A patent license is "discriminatory" if it does not include within 528 | the scope of its coverage, prohibits the exercise of, or is 529 | conditioned on the non-exercise of one or more of the rights that are 530 | specifically granted under this License. You may not convey a covered 531 | work if you are a party to an arrangement with a third party that is 532 | in the business of distributing software, under which you make payment 533 | to the third party based on the extent of your activity of conveying 534 | the work, and under which the third party grants, to any of the 535 | parties who would receive the covered work from you, a discriminatory 536 | patent license (a) in connection with copies of the covered work 537 | conveyed by you (or copies made from those copies), or (b) primarily 538 | for and in connection with specific products or compilations that 539 | contain the covered work, unless you entered into that arrangement, 540 | or that patent license was granted, prior to 28 March 2007. 541 | 542 | Nothing in this License shall be construed as excluding or limiting 543 | any implied license or other defenses to infringement that may 544 | otherwise be available to you under applicable patent law. 545 | 546 | 12. No Surrender of Others' Freedom. 547 | 548 | If conditions are imposed on you (whether by court order, agreement or 549 | otherwise) that contradict the conditions of this License, they do not 550 | excuse you from the conditions of this License. If you cannot convey a 551 | covered work so as to satisfy simultaneously your obligations under this 552 | License and any other pertinent obligations, then as a consequence you may 553 | not convey it at all. For example, if you agree to terms that obligate you 554 | to collect a royalty for further conveying from those to whom you convey 555 | the Program, the only way you could satisfy both those terms and this 556 | License would be to refrain entirely from conveying the Program. 557 | 558 | 13. Use with the GNU Affero General Public License. 559 | 560 | Notwithstanding any other provision of this License, you have 561 | permission to link or combine any covered work with a work licensed 562 | under version 3 of the GNU Affero General Public License into a single 563 | combined work, and to convey the resulting work. The terms of this 564 | License will continue to apply to the part which is the covered work, 565 | but the special requirements of the GNU Affero General Public License, 566 | section 13, concerning interaction through a network will apply to the 567 | combination as such. 568 | 569 | 14. Revised Versions of this License. 570 | 571 | The Free Software Foundation may publish revised and/or new versions of 572 | the GNU General Public License from time to time. Such new versions will 573 | be similar in spirit to the present version, but may differ in detail to 574 | address new problems or concerns. 575 | 576 | Each version is given a distinguishing version number. If the 577 | Program specifies that a certain numbered version of the GNU General 578 | Public License "or any later version" applies to it, you have the 579 | option of following the terms and conditions either of that numbered 580 | version or of any later version published by the Free Software 581 | Foundation. If the Program does not specify a version number of the 582 | GNU General Public License, you may choose any version ever published 583 | by the Free Software Foundation. 584 | 585 | If the Program specifies that a proxy can decide which future 586 | versions of the GNU General Public License can be used, that proxy's 587 | public statement of acceptance of a version permanently authorizes you 588 | to choose that version for the Program. 589 | 590 | Later license versions may give you additional or different 591 | permissions. However, no additional obligations are imposed on any 592 | author or copyright holder as a result of your choosing to follow a 593 | later version. 594 | 595 | 15. Disclaimer of Warranty. 596 | 597 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 598 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 599 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 600 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 601 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 602 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 603 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 604 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 605 | 606 | 16. Limitation of Liability. 607 | 608 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 609 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 610 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 611 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 612 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 613 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 614 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 615 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 616 | SUCH DAMAGES. 617 | 618 | 17. Interpretation of Sections 15 and 16. 619 | 620 | If the disclaimer of warranty and limitation of liability provided 621 | above cannot be given local legal effect according to their terms, 622 | reviewing courts shall apply local law that most closely approximates 623 | an absolute waiver of all civil liability in connection with the 624 | Program, unless a warranty or assumption of liability accompanies a 625 | copy of the Program in return for a fee. 626 | 627 | END OF TERMS AND CONDITIONS 628 | 629 | How to Apply These Terms to Your New Programs 630 | 631 | If you develop a new program, and you want it to be of the greatest 632 | possible use to the public, the best way to achieve this is to make it 633 | free software which everyone can redistribute and change under these terms. 634 | 635 | To do so, attach the following notices to the program. It is safest 636 | to attach them to the start of each source file to most effectively 637 | state the exclusion of warranty; and each file should have at least 638 | the "copyright" line and a pointer to where the full notice is found. 639 | 640 | 641 | Copyright (C) 642 | 643 | This program is free software: you can redistribute it and/or modify 644 | it under the terms of the GNU General Public License as published by 645 | the Free Software Foundation, either version 3 of the License, or 646 | (at your option) any later version. 647 | 648 | This program is distributed in the hope that it will be useful, 649 | but WITHOUT ANY WARRANTY; without even the implied warranty of 650 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 651 | GNU General Public License for more details. 652 | 653 | You should have received a copy of the GNU General Public License 654 | along with this program. If not, see . 655 | 656 | Also add information on how to contact you by electronic and paper mail. 657 | 658 | If the program does terminal interaction, make it output a short 659 | notice like this when it starts in an interactive mode: 660 | 661 | Copyright (C) 662 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 663 | This is free software, and you are welcome to redistribute it 664 | under certain conditions; type `show c' for details. 665 | 666 | The hypothetical commands `show w' and `show c' should show the appropriate 667 | parts of the General Public License. Of course, your program's commands 668 | might be different; for a GUI interface, you would use an "about box". 669 | 670 | You should also get your employer (if you work as a programmer) or school, 671 | if any, to sign a "copyright disclaimer" for the program, if necessary. 672 | For more information on this, and how to apply and follow the GNU GPL, see 673 | . 674 | 675 | The GNU General Public License does not permit incorporating your program 676 | into proprietary programs. If your program is a subroutine library, you 677 | may consider it more useful to permit linking proprietary applications with 678 | the library. If this is what you want to do, use the GNU Lesser General 679 | Public License instead of this License. But first, please read 680 | . 681 | --------------------------------------------------------------------------------