├── docs ├── _autosummary │ └── .notempty ├── _static │ ├── pycharm_docstring.png │ ├── ptvs_autocompletion.jpg │ ├── pydev_autocompletion.jpg │ ├── pycharm_autocompletion.jpg │ ├── sublime_text_anaconda.jpg │ └── vscode-autocompletion.png ├── modules.rst ├── conf.py ├── index.rst ├── using.rst ├── Makefile └── make.bat ├── requirements.txt ├── setup.py ├── pyproject.toml ├── MANIFEST.in ├── .github └── workflows │ ├── publish-docs.yml │ └── publish-lib.yml ├── setup.cfg ├── README.rst ├── .gitignore ├── xbmcdrm.py ├── xbmcvfs.py ├── xbmcplugin.py ├── xbmcaddon.py └── LICENSE.txt /docs/_autosummary/.notempty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Sphinx 2 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup() 4 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools", "wheel"] 3 | build-backend = "setuptools.build_meta" 4 | -------------------------------------------------------------------------------- /docs/_static/pycharm_docstring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanvm/Kodistubs/HEAD/docs/_static/pycharm_docstring.png -------------------------------------------------------------------------------- /docs/_static/ptvs_autocompletion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanvm/Kodistubs/HEAD/docs/_static/ptvs_autocompletion.jpg -------------------------------------------------------------------------------- /docs/_static/pydev_autocompletion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanvm/Kodistubs/HEAD/docs/_static/pydev_autocompletion.jpg -------------------------------------------------------------------------------- /docs/_static/pycharm_autocompletion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanvm/Kodistubs/HEAD/docs/_static/pycharm_autocompletion.jpg -------------------------------------------------------------------------------- /docs/_static/sublime_text_anaconda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanvm/Kodistubs/HEAD/docs/_static/sublime_text_anaconda.jpg -------------------------------------------------------------------------------- /docs/_static/vscode-autocompletion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanvm/Kodistubs/HEAD/docs/_static/vscode-autocompletion.png -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include xbmc.py 2 | include xbmcaddon.py 3 | include xbmcgui.py 4 | include xbmcplugin.py 5 | include xbmcvfs.py 6 | include kodistubs_meta.py 7 | include setup.py 8 | include LICENSE.txt 9 | include README.rst 10 | global-exclude *.pyc *.pyo 11 | -------------------------------------------------------------------------------- /docs/modules.rst: -------------------------------------------------------------------------------- 1 | Kodi Python API 2 | =============== 3 | 4 | This is Kodi Python API documentation auto-generated from Kodisutubs docstrings. 5 | 6 | .. autosummary:: 7 | :toctree: _autosummary 8 | 9 | xbmc 10 | xbmcaddon 11 | xbmcdrm 12 | xbmcgui 13 | xbmcplugin 14 | xbmcvfs 15 | 16 | .. note:: This is unofficial documentation not from Team Kodi. The official documentation for Kodi Python API 17 | can be found `here`_. 18 | 19 | .. note:: ``[source]`` links in the documentation point to Kodistubs sources. 20 | 21 | .. _here: https://codedocs.xyz/xbmc/xbmc/group__python.html 22 | -------------------------------------------------------------------------------- /.github/workflows/publish-docs.yml: -------------------------------------------------------------------------------- 1 | name: Publish Docs 2 | 3 | on: 4 | push: 5 | branches: 6 | - 'master' 7 | 8 | jobs: 9 | 10 | publish: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Set up Python 3.9 16 | uses: actions/setup-python@v1 17 | with: 18 | python-version: 3.9 19 | - name: Build HTML docs 20 | run: | 21 | pip install Sphinx 22 | cd docs 23 | make html 24 | - name: Publish docs to GH pages 25 | uses: JamesIves/github-pages-deploy-action@v4 26 | with: 27 | folder: docs/_build/html 28 | -------------------------------------------------------------------------------- /.github/workflows/publish-lib.yml: -------------------------------------------------------------------------------- 1 | name: Publish library 2 | 3 | on: 4 | push: 5 | tags: 6 | - '*' 7 | 8 | jobs: 9 | 10 | publish: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Set up Python 3.9 16 | uses: actions/setup-python@v1 17 | with: 18 | python-version: 3.9 19 | - name: Build artifacts 20 | run: | 21 | pip install wheel 22 | python setup.py sdist bdist_wheel 23 | - name: Publish a Python distribution to PyPI 24 | uses: pypa/gh-action-pypi-publish@release/v1 25 | with: 26 | user: __token__ 27 | password: ${{ secrets.PYPI_API_TOKEN }} 28 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = Kodistubs 3 | version = 21.0.0 4 | author = Roman Miroshnychenko 5 | author_email = roman1972@gmail.com 6 | url = https://github.com/romanvm/Kodistubs 7 | description = Stub modules that re-create Kodi Python API 8 | long_description = file: README.rst 9 | long_description_content_type = text/x-rst 10 | keywords = kodi documentation inspection 11 | license = GPL-3.0-only 12 | classifiers = 13 | Environment :: Plugins 14 | License :: OSI Approved :: GNU General Public License v3 (GPLv3) 15 | Operating System :: OS Independent 16 | Programming Language :: Python :: 3 17 | Topic :: Software Development :: Libraries 18 | Topic :: Software Development :: Libraries :: Python Modules 19 | platform = any 20 | 21 | [options] 22 | py_modules = 23 | xbmc 24 | xbmcaddon 25 | xbmcgui 26 | xbmcplugin 27 | xbmcvfs 28 | xbmcdrm 29 | zip_safe = False 30 | include_package_data = True 31 | python_requires = >=3.6 32 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import sys 3 | from configparser import ConfigParser 4 | from pathlib import Path 5 | 6 | project_dir = Path(__file__).resolve().parent.parent 7 | sys.path.append(str(project_dir)) 8 | 9 | setup_cfg = project_dir / 'setup.cfg' 10 | 11 | config = ConfigParser() 12 | config.read([setup_cfg]) 13 | metadata = config['metadata'] 14 | 15 | VERSION = metadata['version'] 16 | AUTHOR = metadata['author'] 17 | YEAR = datetime.datetime.now().year 18 | 19 | extensions = [ 20 | 'sphinx.ext.autodoc', 21 | 'sphinx.ext.autosummary', 22 | 'sphinx.ext.intersphinx', 23 | 'sphinx.ext.viewcode', 24 | 'sphinx.ext.githubpages', 25 | ] 26 | 27 | autodoc_member_order = 'bysource' 28 | autodoc_default_options = { 29 | 'members': True, 30 | 'show-inheritance': True, 31 | } 32 | autosummary_generate = True 33 | intersphinx_mapping = {'python': ('https://docs.python.org/3.11', None)} 34 | 35 | templates_path = ['_templates'] 36 | 37 | source_suffix = '.rst' 38 | 39 | master_doc = 'index' 40 | 41 | project = 'Kodistubs' 42 | copyright = f'{YEAR}, {AUTHOR}' 43 | author = AUTHOR 44 | 45 | version = VERSION 46 | 47 | language = 'en' 48 | 49 | exclude_patterns = ['_build'] 50 | 51 | pygments_style = 'sphinx' 52 | 53 | todo_include_todos = False 54 | 55 | html_theme = 'alabaster' 56 | 57 | html_theme_options = { 58 | 'github_button': True, 59 | 'github_type': 'star&v=2', 60 | 'github_user': 'romanvm', 61 | 'github_repo': 'Kodistubs', 62 | 'github_banner': True, 63 | } 64 | 65 | html_static_path = ['_static'] 66 | 67 | html_sidebars = { 68 | '**': [ 69 | 'about.html', 70 | 'navigation.html', 71 | 'relations.html', 72 | 'searchbox.html', 73 | ] 74 | } 75 | 76 | html_show_sourcelink = False 77 | 78 | html_show_copyright = True 79 | 80 | htmlhelp_basename = 'Kodistubsdoc' 81 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | Kodistubs 2 | ========= 3 | (former xbmcstubs) 4 | ------------------ 5 | 6 | .. image:: https://badge.fury.io/py/Kodistubs.svg 7 | :target: https://badge.fury.io/py/Kodistubs 8 | 9 | Kodi stubs are Python files that can help you develop addons for `Kodi (XBMC)`_ Media Center. 10 | Use them in your favorite IDE to enable autocompletion and view docstrings 11 | for Kodi Python API functions, classes and methods. 12 | Kodistubs also include `PEP-484`_ type annotations for all functions 13 | and methods. 14 | 15 | You can install Kodistubs into your working virtual environment using ``pip``:: 16 | 17 | $ pip install Kodistubs 18 | 19 | Read `Kodistubs documentation`_ for more info on how to use Kodi stubs. 20 | 21 | Kodistubs major version corresponds to the version of Kodi they have been generated from. 22 | Current Kodistubs are compatible with Python 3.6 and above. Kodistubs for Kodi versions that used 23 | Python 2.x for addons can be found in ``python2`` branch. 24 | 25 | **Warning**: Kodistubs are literally stubs and do not include any useful code, 26 | so don't try to run your program outside Kodi unless you add some testing code into Kodistubs 27 | or use some mocking library to mock Kodi Python API. 28 | 29 | Current Kodistubs have been generated from scratch using `this script`_ from Doxygen XML files and 30 | SWIG XML Python binding definitions that, in their turn, have been generated 31 | from Kodi sources. Old Kodistubs can be found in ``legacy`` branch. 32 | 33 | I try to keep Kodi stubs in sync with Kodi Python API development, but it may happen 34 | that I miss something. Don't hesitate to open issues or submit pull requests if you notice 35 | discrepancies with the actual state of Kodi Python API. 36 | 37 | 38 | `Discussion topic on Kodi forum`_ 39 | 40 | License: `GPL v.3`_ 41 | 42 | .. _Kodi (XBMC): http://kodi.tv 43 | .. _Discussion topic on Kodi forum: http://forum.kodi.tv/showthread.php?tid=173780 44 | .. _GPL v.3: http://www.gnu.org/licenses/gpl.html 45 | .. _Kodistubs documentation: https://romanvm.github.io/Kodistubs/ 46 | .. _PEP-484: https://www.python.org/dev/peps/pep-0484/#suggested-syntax-for-python-2-7-and-straddling-code 47 | .. _this script: https://github.com/romanvm/kodistubs-generator 48 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to Kodistubs documentation! 2 | =================================== 3 | (former xbmcstubs) 4 | ------------------ 5 | 6 | Kodi stubs are Python files that can help you develop addons for `Kodi (XBMC)`_ Media Center. 7 | Use them in your favorite :abbr:`IDE (Integrated Developement Environment)` 8 | to enable autocompletion and view docstrings for Kodi Python API functions, classes and methods. 9 | 10 | Currently Kodistubs are automatically generated (indirectly) from Kodi sources so they 11 | should reflect the exact state of Kodi Python API, including function and method 12 | signatures and return values. Kodistubs also include `PEP-484`_ type annotations 13 | for all functions and methods. 14 | 15 | The version of Kodistubs corresponds to the Kodi version they are created from. 16 | 17 | If you notice discrepancies with the actual state of Kodi Python API, don't hesitate to open issues 18 | or submit pull requests in the Kodistubs Github repo. 19 | 20 | .. note:: If a function/method docstring has discrepancies with the actual 21 | signature or type annotation of that function/method in Kodistubs, 22 | the signature or type annotation should be considered correct. 23 | 24 | .. warning:: Kodistubs are literally stubs and do not include any useful code beyond absolute minimum 25 | so that not to rise syntax errors. 26 | Don't try to run your program outside Kodi unless you add some testing code into Kodistubs 27 | or use some mocking library to mock Kodi Pyhton API. 28 | 29 | `Discussion topic on Kodi forum`_. 30 | 31 | License: `GPL v.3`_ 32 | 33 | .. _reStructuredText: http://docutils.sourceforge.net/rst.html 34 | .. _Kodi (XBMC): http://kodi.tv 35 | .. _PyCharm IDE: https://www.jetbrains.com/pycharm 36 | .. _Discussion topic on Kodi forum: http://forum.kodi.tv/showthread.php?tid=173780 37 | .. _GPL v.3: http://www.gnu.org/licenses/gpl.html 38 | .. _official Kodi Python API docs: https://codedocs.xyz/xbmc/xbmc/group__python.html 39 | .. _Kodi sources: https://github.com/xbmc/xbmc 40 | .. _PEP-484: https://www.python.org/dev/peps/pep-0484/#suggested-syntax-for-python-2-7-and-straddling-code 41 | 42 | .. toctree:: 43 | :caption: Contents: 44 | :maxdepth: 2 45 | 46 | using 47 | modules 48 | 49 | 50 | Indices and tables 51 | ================== 52 | 53 | * :ref:`genindex` 54 | * :ref:`modindex` 55 | * :ref:`search` 56 | 57 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### JetBrains template 3 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion 4 | 5 | *.iml 6 | 7 | ## Directory-based project format: 8 | .idea/ 9 | # if you remove the above rule, at least ignore the following: 10 | 11 | # User-specific stuff: 12 | # .idea/workspace.xml 13 | # .idea/tasks.xml 14 | # .idea/dictionaries 15 | 16 | # Sensitive or high-churn files: 17 | # .idea/dataSources.ids 18 | # .idea/dataSources.xml 19 | # .idea/sqlDataSources.xml 20 | # .idea/dynamic.xml 21 | # .idea/uiDesigner.xml 22 | 23 | # Gradle: 24 | # .idea/gradle.xml 25 | # .idea/libraries 26 | 27 | # Mongo Explorer plugin: 28 | # .idea/mongoSettings.xml 29 | 30 | ## File-based project format: 31 | *.ipr 32 | *.iws 33 | 34 | ## Plugin-specific files: 35 | 36 | # IntelliJ 37 | /out/ 38 | 39 | # mpeltonen/sbt-idea plugin 40 | .idea_modules/ 41 | 42 | # JIRA plugin 43 | atlassian-ide-plugin.xml 44 | 45 | # Crashlytics plugin (for Android Studio and IntelliJ) 46 | com_crashlytics_export_strings.xml 47 | crashlytics.properties 48 | crashlytics-build.properties 49 | 50 | 51 | ### Python template 52 | # Byte-compiled / optimized / DLL files 53 | __pycache__/ 54 | *.py[cod] 55 | *$py.class 56 | 57 | # C extensions 58 | *.so 59 | 60 | # Distribution / packaging 61 | .Python 62 | .venv/ 63 | env/ 64 | build/ 65 | develop-eggs/ 66 | dist/ 67 | downloads/ 68 | eggs/ 69 | .eggs/ 70 | lib/ 71 | lib64/ 72 | parts/ 73 | sdist/ 74 | var/ 75 | *.egg-info/ 76 | .installed.cfg 77 | *.egg 78 | 79 | # PyInstaller 80 | # Usually these files are written by a python script from a template 81 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 82 | *.manifest 83 | *.spec 84 | 85 | # Installer logs 86 | pip-log.txt 87 | pip-delete-this-directory.txt 88 | 89 | # Unit test / coverage reports 90 | htmlcov/ 91 | .tox/ 92 | .coverage 93 | .coverage.* 94 | .cache 95 | nosetests.xml 96 | coverage.xml 97 | *,cover 98 | 99 | # Translations 100 | *.mo 101 | *.pot 102 | 103 | # Django stuff: 104 | *.log 105 | 106 | # Sphinx documentation 107 | docs/_build/ 108 | 109 | # PyBuilder 110 | target/ 111 | 112 | epydoc.cmd 113 | epydoc.cfg 114 | _docs/ 115 | venv/ 116 | venv.cmd 117 | .venv3/ 118 | docs/_autosummary/xbmc* 119 | -------------------------------------------------------------------------------- /docs/using.rst: -------------------------------------------------------------------------------- 1 | Using Kodistubs 2 | =============== 3 | 4 | Writing Code 5 | ------------ 6 | 7 | The main purpose of Kodistubs is to help you to write Kodi addon code in various 8 | :abbr:`IDEs(Integrated Development Environments)` by providing code completion, 9 | quick access to Kodi Python API docstrings, and code inspection (linting) 10 | in IDEs that provide this feature. 11 | 12 | When developing Python addons for Kodi it is strongly recommended to use 13 | `virtual environments`_ to isolate your development dependencies. Virtual 14 | environments are supported by all popular Python IDEs. 15 | 16 | You can install Kodistubs in your working Python virtual environment 17 | either from sources using :file:`setup.py` script:: 18 | 19 | python setup.py install 20 | 21 | or directly from PyPI using ``pip``:: 22 | 23 | pip install Kodistubs 24 | 25 | Below are the examples of autocompletion and docstrings pup-ups in popular 26 | Python IDEs: 27 | 28 | .. figure:: _static/pycharm_autocompletion.jpg 29 | 30 | **Code completion and a docstring pop-up in PyCharm** 31 | 32 | PyCharm docstrings pop-ups partially support reStructuredText formatting. 33 | 34 | .. figure:: _static/pycharm_docstring.png 35 | 36 | **Function docstring pop-up in PyCharm** 37 | 38 | .. figure:: _static/pydev_autocompletion.jpg 39 | 40 | **Code completion and a docstring pop-up in Eclipse/PyDev** 41 | 42 | .. figure:: _static/ptvs_autocompletion.jpg 43 | 44 | **Code completion and a docstring pop-up in Visual Studio** 45 | 46 | .. figure:: _static/vscode-autocompletion.png 47 | 48 | **Code completion and a docstring pop-up in Visual Studio Code** 49 | 50 | .. figure:: _static/sublime_text_anaconda.jpg 51 | 52 | **Code completion and a docstring pop-up in Sublime Text 3** 53 | 54 | .. _virtual environments: https://virtualenv.pypa.io/en/latest/ 55 | 56 | Type Annotations 57 | ---------------- 58 | 59 | Kodistubs include `PEP-484`_ type annotations for all functions and methods 60 | so you can use `mypy`_ or other compatible tool to check types of function/method 61 | arguments and return values in your code. 62 | 63 | .. code-block:: python 64 | :emphasize-lines: 1 65 | 66 | def getInfoLabel(cLine: str) -> str: 67 | """ 68 | Get a info label 69 | 70 | :param infotag: string - infoTag for value you want returned. 71 | :return: InfoLabel as a string 72 | 73 | List of InfoTags - http://kodi.wiki/view/InfoLabels 74 | 75 | Example:: 76 | 77 | .. 78 | label = xbmc.getInfoLabel('Weather.Conditions') 79 | .. 80 | """ 81 | return "" 82 | 83 | Some IDEs, for example PyCharm, support type annotation and provide warnings 84 | about type incompatibility. 85 | 86 | .. note:: 87 | ``Union[type1, type2]`` means that a function or a method accepts or returns 88 | either ``type1`` or ``type2``. 89 | 90 | .. _PEP-484: https://www.python.org/dev/peps/pep-0484/ 91 | .. _mypy: http://mypy-lang.org/ 92 | 93 | Testing Code 94 | ------------ 95 | 96 | You can use Kodistubs in combination with some mocking library, e.g. `mock`_, 97 | to write unit tests for your addon code. 98 | 99 | .. _mock: https://pypi.python.org/pypi/mock 100 | 101 | Documenting Code 102 | ---------------- 103 | 104 | Currently `Sphinx`_ is *de facto* the standard tool for documenting Python code. But for generating 105 | documentation from docstrings it requires that your modules can be imported without any side-effects 106 | (i.e. exceptions). If you want to document your addon with Sphinx, add Kodi stubs folder to 107 | :data:`sys.path` of :file:`conf.py` file in your Sphinx project and in most cases your addon modules will be 108 | imported without issues. Just don't forget to protect your module-level exetutable code with 109 | ``if __name__ == '__main__'`` condition. 110 | 111 | Also the root URL of this documentation (without :file:`index.html`) can be used as a reference point 112 | for `intersphinx`_. For example:: 113 | 114 | intersphinx_mapping = { 115 | 'https://docs.python.org/3.8: None, 116 | 'http://romanvm.github.io/Kodistubs': None, # Reference to Kodi stubs 117 | } 118 | 119 | This will enable cross-references to Kodi Python API objects in your Sphinx-generated documentation. 120 | 121 | .. _Sphinx: http://www.sphinx-doc.org/en/stable/ 122 | .. _intersphinx: http://www.sphinx-doc.org/en/stable/ext/intersphinx.html 123 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # User-friendly check for sphinx-build 11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 13 | endif 14 | 15 | # Internal variables. 16 | PAPEROPT_a4 = -D latex_paper_size=a4 17 | PAPEROPT_letter = -D latex_paper_size=letter 18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 19 | # the i18n builder cannot share the environment and doctrees with the others 20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 21 | 22 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext 23 | 24 | help: 25 | @echo "Please use \`make ' where is one of" 26 | @echo " html to make standalone HTML files" 27 | @echo " dirhtml to make HTML files named index.html in directories" 28 | @echo " singlehtml to make a single large HTML file" 29 | @echo " pickle to make pickle files" 30 | @echo " json to make JSON files" 31 | @echo " htmlhelp to make HTML files and a HTML help project" 32 | @echo " qthelp to make HTML files and a qthelp project" 33 | @echo " applehelp to make an Apple Help Book" 34 | @echo " devhelp to make HTML files and a Devhelp project" 35 | @echo " epub to make an epub" 36 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 37 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 38 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 39 | @echo " text to make text files" 40 | @echo " man to make manual pages" 41 | @echo " texinfo to make Texinfo files" 42 | @echo " info to make Texinfo files and run them through makeinfo" 43 | @echo " gettext to make PO message catalogs" 44 | @echo " changes to make an overview of all changed/added/deprecated items" 45 | @echo " xml to make Docutils-native XML files" 46 | @echo " pseudoxml to make pseudoxml-XML files for display purposes" 47 | @echo " linkcheck to check all external links for integrity" 48 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 49 | @echo " coverage to run coverage check of the documentation (if enabled)" 50 | 51 | clean: 52 | rm -rf $(BUILDDIR)/* 53 | 54 | html: 55 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 56 | @echo 57 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 58 | 59 | dirhtml: 60 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 61 | @echo 62 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 63 | 64 | singlehtml: 65 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 66 | @echo 67 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 68 | 69 | pickle: 70 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 71 | @echo 72 | @echo "Build finished; now you can process the pickle files." 73 | 74 | json: 75 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 76 | @echo 77 | @echo "Build finished; now you can process the JSON files." 78 | 79 | htmlhelp: 80 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 81 | @echo 82 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 83 | ".hhp project file in $(BUILDDIR)/htmlhelp." 84 | 85 | qthelp: 86 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 87 | @echo 88 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 89 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 90 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Kodistubs.qhcp" 91 | @echo "To view the help file:" 92 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Kodistubs.qhc" 93 | 94 | applehelp: 95 | $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp 96 | @echo 97 | @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." 98 | @echo "N.B. You won't be able to view it unless you put it in" \ 99 | "~/Library/Documentation/Help or install it in your application" \ 100 | "bundle." 101 | 102 | devhelp: 103 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 104 | @echo 105 | @echo "Build finished." 106 | @echo "To view the help file:" 107 | @echo "# mkdir -p $$HOME/.local/share/devhelp/Kodistubs" 108 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Kodistubs" 109 | @echo "# devhelp" 110 | 111 | epub: 112 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 113 | @echo 114 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 115 | 116 | latex: 117 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 118 | @echo 119 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 120 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 121 | "(use \`make latexpdf' here to do that automatically)." 122 | 123 | latexpdf: 124 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 125 | @echo "Running LaTeX files through pdflatex..." 126 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 127 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 128 | 129 | latexpdfja: 130 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 131 | @echo "Running LaTeX files through platex and dvipdfmx..." 132 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 133 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 134 | 135 | text: 136 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 137 | @echo 138 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 139 | 140 | man: 141 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 142 | @echo 143 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 144 | 145 | texinfo: 146 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 147 | @echo 148 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 149 | @echo "Run \`make' in that directory to run these through makeinfo" \ 150 | "(use \`make info' here to do that automatically)." 151 | 152 | info: 153 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 154 | @echo "Running Texinfo files through makeinfo..." 155 | make -C $(BUILDDIR)/texinfo info 156 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 157 | 158 | gettext: 159 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 160 | @echo 161 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 162 | 163 | changes: 164 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 165 | @echo 166 | @echo "The overview file is in $(BUILDDIR)/changes." 167 | 168 | linkcheck: 169 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 170 | @echo 171 | @echo "Link check complete; look for any errors in the above output " \ 172 | "or in $(BUILDDIR)/linkcheck/output.txt." 173 | 174 | doctest: 175 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 176 | @echo "Testing of doctests in the sources finished, look at the " \ 177 | "results in $(BUILDDIR)/doctest/output.txt." 178 | 179 | coverage: 180 | $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage 181 | @echo "Testing of coverage in the sources finished, look at the " \ 182 | "results in $(BUILDDIR)/coverage/python.txt." 183 | 184 | xml: 185 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 186 | @echo 187 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 188 | 189 | pseudoxml: 190 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 191 | @echo 192 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 193 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=_build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . 10 | set I18NSPHINXOPTS=%SPHINXOPTS% . 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 31 | echo. text to make text files 32 | echo. man to make manual pages 33 | echo. texinfo to make Texinfo files 34 | echo. gettext to make PO message catalogs 35 | echo. changes to make an overview over all changed/added/deprecated items 36 | echo. xml to make Docutils-native XML files 37 | echo. pseudoxml to make pseudoxml-XML files for display purposes 38 | echo. linkcheck to check all external links for integrity 39 | echo. doctest to run all doctests embedded in the documentation if enabled 40 | echo. coverage to run coverage check of the documentation if enabled 41 | goto end 42 | ) 43 | 44 | if "%1" == "clean" ( 45 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 46 | del /q /s %BUILDDIR%\* 47 | goto end 48 | ) 49 | 50 | 51 | REM Check if sphinx-build is available and fallback to Python version if any 52 | %SPHINXBUILD% 1>NUL 2>NUL 53 | if errorlevel 9009 goto sphinx_python 54 | goto sphinx_ok 55 | 56 | :sphinx_python 57 | 58 | set SPHINXBUILD=python -m sphinx.__init__ 59 | %SPHINXBUILD% 2> nul 60 | if errorlevel 9009 ( 61 | echo. 62 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 63 | echo.installed, then set the SPHINXBUILD environment variable to point 64 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 65 | echo.may add the Sphinx directory to PATH. 66 | echo. 67 | echo.If you don't have Sphinx installed, grab it from 68 | echo.http://sphinx-doc.org/ 69 | exit /b 1 70 | ) 71 | 72 | :sphinx_ok 73 | 74 | 75 | if "%1" == "html" ( 76 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 77 | if errorlevel 1 exit /b 1 78 | echo. 79 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 80 | goto end 81 | ) 82 | 83 | if "%1" == "dirhtml" ( 84 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 85 | if errorlevel 1 exit /b 1 86 | echo. 87 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 88 | goto end 89 | ) 90 | 91 | if "%1" == "singlehtml" ( 92 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 93 | if errorlevel 1 exit /b 1 94 | echo. 95 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 96 | goto end 97 | ) 98 | 99 | if "%1" == "pickle" ( 100 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 101 | if errorlevel 1 exit /b 1 102 | echo. 103 | echo.Build finished; now you can process the pickle files. 104 | goto end 105 | ) 106 | 107 | if "%1" == "json" ( 108 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 109 | if errorlevel 1 exit /b 1 110 | echo. 111 | echo.Build finished; now you can process the JSON files. 112 | goto end 113 | ) 114 | 115 | if "%1" == "htmlhelp" ( 116 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 117 | if errorlevel 1 exit /b 1 118 | echo. 119 | echo.Build finished; now you can run HTML Help Workshop with the ^ 120 | .hhp project file in %BUILDDIR%/htmlhelp. 121 | goto end 122 | ) 123 | 124 | if "%1" == "qthelp" ( 125 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 126 | if errorlevel 1 exit /b 1 127 | echo. 128 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 129 | .qhcp project file in %BUILDDIR%/qthelp, like this: 130 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Kodistubs.qhcp 131 | echo.To view the help file: 132 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Kodistubs.ghc 133 | goto end 134 | ) 135 | 136 | if "%1" == "devhelp" ( 137 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 138 | if errorlevel 1 exit /b 1 139 | echo. 140 | echo.Build finished. 141 | goto end 142 | ) 143 | 144 | if "%1" == "epub" ( 145 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 146 | if errorlevel 1 exit /b 1 147 | echo. 148 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 149 | goto end 150 | ) 151 | 152 | if "%1" == "latex" ( 153 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 154 | if errorlevel 1 exit /b 1 155 | echo. 156 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 157 | goto end 158 | ) 159 | 160 | if "%1" == "latexpdf" ( 161 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 162 | cd %BUILDDIR%/latex 163 | make all-pdf 164 | cd %~dp0 165 | echo. 166 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 167 | goto end 168 | ) 169 | 170 | if "%1" == "latexpdfja" ( 171 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 172 | cd %BUILDDIR%/latex 173 | make all-pdf-ja 174 | cd %~dp0 175 | echo. 176 | echo.Build finished; the PDF files are in %BUILDDIR%/latex. 177 | goto end 178 | ) 179 | 180 | if "%1" == "text" ( 181 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 182 | if errorlevel 1 exit /b 1 183 | echo. 184 | echo.Build finished. The text files are in %BUILDDIR%/text. 185 | goto end 186 | ) 187 | 188 | if "%1" == "man" ( 189 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 190 | if errorlevel 1 exit /b 1 191 | echo. 192 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 193 | goto end 194 | ) 195 | 196 | if "%1" == "texinfo" ( 197 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 198 | if errorlevel 1 exit /b 1 199 | echo. 200 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 201 | goto end 202 | ) 203 | 204 | if "%1" == "gettext" ( 205 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 206 | if errorlevel 1 exit /b 1 207 | echo. 208 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 209 | goto end 210 | ) 211 | 212 | if "%1" == "changes" ( 213 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 214 | if errorlevel 1 exit /b 1 215 | echo. 216 | echo.The overview file is in %BUILDDIR%/changes. 217 | goto end 218 | ) 219 | 220 | if "%1" == "linkcheck" ( 221 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 222 | if errorlevel 1 exit /b 1 223 | echo. 224 | echo.Link check complete; look for any errors in the above output ^ 225 | or in %BUILDDIR%/linkcheck/output.txt. 226 | goto end 227 | ) 228 | 229 | if "%1" == "doctest" ( 230 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 231 | if errorlevel 1 exit /b 1 232 | echo. 233 | echo.Testing of doctests in the sources finished, look at the ^ 234 | results in %BUILDDIR%/doctest/output.txt. 235 | goto end 236 | ) 237 | 238 | if "%1" == "coverage" ( 239 | %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage 240 | if errorlevel 1 exit /b 1 241 | echo. 242 | echo.Testing of coverage in the sources finished, look at the ^ 243 | results in %BUILDDIR%/coverage/python.txt. 244 | goto end 245 | ) 246 | 247 | if "%1" == "xml" ( 248 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml 249 | if errorlevel 1 exit /b 1 250 | echo. 251 | echo.Build finished. The XML files are in %BUILDDIR%/xml. 252 | goto end 253 | ) 254 | 255 | if "%1" == "pseudoxml" ( 256 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml 257 | if errorlevel 1 exit /b 1 258 | echo. 259 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. 260 | goto end 261 | ) 262 | 263 | :end 264 | -------------------------------------------------------------------------------- /xbmcdrm.py: -------------------------------------------------------------------------------- 1 | # This file is generated from Kodi source code and post-edited 2 | # to correct code style and docstrings formatting. 3 | # License: GPL v.3 4 | """ 5 | **Kodi's DRM class.** 6 | """ 7 | from typing import Union, Dict 8 | 9 | __kodistubs__ = True 10 | 11 | 12 | class CryptoSession: 13 | """ 14 | **Kodi's DRM class.** 15 | 16 | Offers classes and functions that allow a developer to work with DRM-protected 17 | contents like Widevine. 18 | 19 | This type of functionality is closely related to the type of DRM used and the 20 | service to be implemented. 21 | 22 | Using the `CryptoSession` constructor allow you to have access to a DRM session. 23 | With a DRM session you can read and write the DRM 24 | properties `GetPropertyString`,`SetPropertyString` and establish session keys 25 | with GetKeyRequest and `ProvideKeyResponse`, or resume previous session keys 26 | with `RestoreKeys`. 27 | 28 | When the session keys are established you can use these methods to perform 29 | various operations:`Encrypt` /`Decrypt` for data encryption / decryption,`Sign` 30 | /`Verify` for make or verify data-signature. Useful for example to implement 31 | encrypted communication between a client and the server. 32 | 33 | An example where such functionality is useful is the Message Security Layer 34 | (MSL) transmission protocol used in some VOD applications. This protocol (or 35 | rather framework) is used to increase the level of security in the exchange of 36 | messages (such as licences, manifests or other data), which defines a security 37 | extension / layer on top of the HTTP protocol. 38 | 39 | Constructor for DRM crypto session 40 | 41 | :param UUID: string - 16 byte UUID of the DRM system to use 42 | :param cipherAlgorithm: string - Algorithm used for encryption / decryption ciphers 43 | :param macAlgorithm: string - Algorithm used for sign / verify 44 | :raises RuntimeException: If the session can not be established 45 | 46 | @python_v18 New class added. 47 | 48 | Example:: 49 | 50 | .. 51 | uuid_widevine = 'edef8ba9-79d6-4ace-a3c8-27dcd51d21ed' 52 | crypto_session = xbmcdrm.CryptoSession(uuid_widevine, 'AES/CBC/NoPadding', 'HmacSHA256') 53 | .. 54 | """ 55 | 56 | def __init__(self, UUID: str, 57 | cipherAlgorithm: str, 58 | macAlgorithm: str) -> None: 59 | pass 60 | 61 | def GetKeyRequest(self, init: Union[str, bytes, bytearray], 62 | mimeType: str, 63 | offlineKey: bool, 64 | optionalParameters: Dict[str, str]) -> bytearray: 65 | """ 66 | Generate a key request 67 | 68 | Generate a key request, used for request/response exchange between the app and a 69 | license server to obtain or release keys used to decrypt encrypted content. 70 | After the app has received the key request response from the license server, it 71 | should deliver to the response to the DRM instance using the 72 | method `ProvideKeyResponse`, to activate the keys. 73 | 74 | :param init: byte - Initialization bytes container-specific data, its meaning is 75 | interpreted based on the mime type provided in the mimeType 76 | parameter. It could contain, for example, the content ID, key ID 77 | or other data required in generating the key request. 78 | :param mimeType: string - Type of media which is exchanged (e.g. "application/xml", 79 | "video/mp4") 80 | :param offlineKey: bool - Specifies the type of the request. The request may be to 81 | acquire keys for Streaming or Offline content 82 | :param optionalParameters: [opt] map - Will be included in the key request message to allow a 83 | client application to provide additional message parameters to the 84 | server 85 | :return: byte - The opaque key request data (challenge) which is send to key server 86 | 87 | @python_v18 New function added. 88 | 89 | @python_v19 With python 3 the init param must be a bytearray instead of byte. 90 | """ 91 | return bytearray() 92 | 93 | def GetPropertyString(self, name: str) -> str: 94 | """ 95 | Request a system specific property value of the DRM system. 96 | 97 | :param Name: string - Name of the property to query 98 | :return: Value of the requested property 99 | 100 | @python_v18 New function added. 101 | """ 102 | return "" 103 | 104 | def ProvideKeyResponse(self, response: Union[str, bytes, bytearray]) -> str: 105 | """ 106 | Provide a key response 107 | 108 | When a key response is received from the license server, must be sent to the DRM 109 | instance by using provideKeyResponse. See also GetKeyRequest. 110 | 111 | :param response: byte - Key data returned from the license server 112 | :return: A keySetId if the response is for an offline key requests which can be used later 113 | with restoreKeys, else return empty for streaming key requests. 114 | 115 | @python_v18 New function added. 116 | 117 | @python_v19 With python 3 the response argument must be a bytearray instead of byte. 118 | """ 119 | return "" 120 | 121 | def RemoveKeys(self) -> None: 122 | """ 123 | Removes all keys currently loaded in a session. 124 | 125 | @python_v18 New function added. 126 | """ 127 | pass 128 | 129 | def RestoreKeys(self, keySetId: str) -> None: 130 | """ 131 | Restores session keys stored during previous `ProvideKeyResponse` call. 132 | 133 | :param keySetId: string - Identifies the saved key set to restore. This value must 134 | never be null. 135 | 136 | @python_v18 New function added. 137 | """ 138 | pass 139 | 140 | def SetPropertyString(self, name: str, value: str) -> None: 141 | """ 142 | Set a system specific property value in the DRM system. 143 | 144 | :param name: string - Name of the property. This value must never be null. 145 | :param value: string - Value of the property to set. This value must never be null. 146 | 147 | @python_v18 New function added. 148 | """ 149 | pass 150 | 151 | def Decrypt(self, cipherKeyId: Union[str, bytes, bytearray], 152 | input: Union[str, bytes, bytearray], 153 | iv: Union[str, bytes, bytearray]) -> bytearray: 154 | """ 155 | Decrypt an encrypted data by using session keys. 156 | 157 | :param cipherKeyId: byte - Encryption key id (provided from a service handshake) 158 | :param input: byte - Cipher text to decrypt 159 | :param iv: byte - Initialization vector of cipher text 160 | :return: Decrypted input data 161 | 162 | @python_v18 New function added. 163 | 164 | @python_v19 With python 3 all arguments need to be of type bytearray instead of byte. 165 | """ 166 | return bytearray() 167 | 168 | def Encrypt(self, cipherKeyId: Union[str, bytes, bytearray], 169 | input: Union[str, bytes, bytearray], 170 | iv: Union[str, bytes, bytearray]) -> bytearray: 171 | """ 172 | Encrypt data by using session keys. 173 | 174 | :param cipherKeyId: byte - Encryption key id (provided from a service handshake) 175 | :param input: byte - Encrypted text 176 | :param iv: byte - Initialization vector of encrypted text 177 | :return: byte - Encrypted input data 178 | 179 | @python_v18 New function added. 180 | 181 | @python_v19 With python 3 all arguments need to be of type bytearray instead of byte. 182 | """ 183 | return bytearray() 184 | 185 | def Sign(self, macKeyId: Union[str, bytes, bytearray], 186 | message: Union[str, bytes, bytearray]) -> bytearray: 187 | """ 188 | Generate a DRM encrypted signature for a text message. 189 | 190 | :param macKeyId: byte - HMAC key id (provided from a service handshake) 191 | :param message: byte - Message text on which to base the signature 192 | :return: byte - Signature 193 | 194 | @python_v18 New function added. 195 | 196 | @python_v19 With python 3 all arguments need to be of type bytearray instead of byte. 197 | """ 198 | return bytearray() 199 | 200 | def Verify(self, macKeyId: Union[str, bytes, bytearray], 201 | message: Union[str, bytes, bytearray], 202 | signature: Union[str, bytes, bytearray]) -> bool: 203 | """ 204 | Verify the validity of a DRM signature of a text message. 205 | 206 | :param macKeyId: byte - HMAC key id (provided from a service handshake) 207 | :param message: byte - Message text on which the signature is based 208 | :param signature: byte - The signature to verify 209 | :return: true when the signature is valid 210 | 211 | @python_v18 New function added. 212 | 213 | @python_v19 With python 3 for all arguments is needed to pass bytearray instead of byte. 214 | """ 215 | return True 216 | -------------------------------------------------------------------------------- /xbmcvfs.py: -------------------------------------------------------------------------------- 1 | # This file is generated from Kodi source code and post-edited 2 | # to correct code style and docstrings formatting. 3 | # License: GPL v.3 4 | """ 5 | **Virtual file system functions on Kodi.** 6 | 7 | Offers classes and functions offers access to the Virtual File Server (VFS) 8 | which you can use to manipulate files and folders. 9 | """ 10 | from typing import Union, List, Tuple, Optional 11 | 12 | __kodistubs__ = True 13 | 14 | 15 | class File: 16 | """ 17 | **Kodi's file class.** 18 | 19 | :param filepath: string Selected file path 20 | :param mode: [opt] string Additional mode options (if no mode is supplied, the 21 | default is Open for Read). 22 | 23 | ==== ============== 24 | Mode Description 25 | ==== ============== 26 | w Open for write 27 | ==== ============== 28 | 29 | @python_v19 Added context manager support 30 | 31 | Example:: 32 | 33 | .. 34 | f = xbmcvfs.File(file, 'w') 35 | .. 36 | 37 | Example (v19 and up):: 38 | 39 | .. 40 | with xbmcvfs.File(file, 'w') as f: 41 | .. 42 | .. 43 | """ 44 | 45 | def __init__(self, filepath: str, mode: Optional[str] = None) -> None: 46 | pass 47 | 48 | def __enter__(self) -> 'File': # Required for context manager 49 | return self 50 | 51 | def __exit__(self, exc_type, exc_val, exc_tb): # Required for context manager 52 | pass 53 | 54 | def read(self, numBytes: int = 0) -> str: 55 | """ 56 | Read file parts as string. 57 | 58 | :param bytes: [opt] How many bytes to read - if not set it will read the whole file 59 | :return: string 60 | 61 | Example:: 62 | 63 | .. 64 | f = xbmcvfs.File(file) 65 | b = f.read() 66 | f.close() 67 | .. 68 | 69 | Example (v19 and up):: 70 | 71 | .. 72 | with xbmcvfs.File(file) as file: 73 | b = f.read() 74 | .. 75 | """ 76 | return "" 77 | 78 | def readBytes(self, numBytes: int = 0) -> bytearray: 79 | """ 80 | Read bytes from file. 81 | 82 | :param numbytes: How many bytes to read [opt]- if not set it will read the whole file 83 | :return: bytearray 84 | 85 | Example:: 86 | 87 | .. 88 | f = xbmcvfs.File(file) 89 | b = f.readBytes() 90 | f.close() 91 | .. 92 | 93 | Example (v19 and up):: 94 | 95 | .. 96 | with xbmcvfs.File(file) as f: 97 | b = f.readBytes() 98 | .. 99 | """ 100 | return bytearray() 101 | 102 | def write(self, buffer: Union[str, bytes, bytearray]) -> bool: 103 | """ 104 | To write given data in file. 105 | 106 | :param buffer: Buffer to write to file 107 | :return: True on success. 108 | 109 | Example:: 110 | 111 | .. 112 | f = xbmcvfs.File(file, 'w') 113 | result = f.write(buffer) 114 | f.close() 115 | .. 116 | 117 | Example (v19 and up):: 118 | 119 | .. 120 | with xbmcvfs.File(file, 'w') as f: 121 | result = f.write(buffer) 122 | .. 123 | """ 124 | return True 125 | 126 | def size(self) -> int: 127 | """ 128 | Get the file size. 129 | 130 | :return: The file size 131 | 132 | Example:: 133 | 134 | .. 135 | f = xbmcvfs.File(file) 136 | s = f.size() 137 | f.close() 138 | .. 139 | 140 | Example (v19 and up):: 141 | 142 | .. 143 | with xbmcvfs.File(file) as f: 144 | s = f.size() 145 | .. 146 | """ 147 | return 0 148 | 149 | def seek(self, seekBytes: int, iWhence: int = 0) -> int: 150 | """ 151 | Seek to position in file. 152 | 153 | :param seekBytes: position in the file 154 | :param iWhence: [opt] where in a file to seek from[0 beginning, 1 current , 2 end 155 | position] 156 | 157 | @python_v19 Function changed. param **iWhence** is now optional. 158 | 159 | Example:: 160 | 161 | .. 162 | f = xbmcvfs.File(file) 163 | result = f.seek(8129, 0) 164 | f.close() 165 | .. 166 | 167 | Example (v19 and up):: 168 | 169 | .. 170 | with xbmcvfs.File(file) as f: 171 | result = f.seek(8129, 0) 172 | .. 173 | """ 174 | return 0 175 | 176 | def tell(self) -> int: 177 | """ 178 | Get the current position in the file. 179 | 180 | :return: The file position 181 | 182 | @python_v19 New function added 183 | 184 | Example:: 185 | 186 | .. 187 | f = xbmcvfs.File(file) 188 | s = f.tell() 189 | f.close() 190 | .. 191 | 192 | Example (v19 and up):: 193 | 194 | .. 195 | with xbmcvfs.File(file) as f: 196 | s = f.tell() 197 | .. 198 | """ 199 | return 0 200 | 201 | def close(self) -> None: 202 | """ 203 | Close opened file. 204 | 205 | Example:: 206 | 207 | .. 208 | f = xbmcvfs.File(file) 209 | f.close() 210 | .. 211 | 212 | Example (v19 and up):: 213 | 214 | .. 215 | with xbmcvfs.File(file) as f: 216 | .. 217 | .. 218 | """ 219 | pass 220 | 221 | 222 | class Stat: 223 | """ 224 | **Get file or file system status.** 225 | 226 | These class return information about a file. Execute (search) permission is 227 | required on all of the directories in path that lead to the file. 228 | 229 | :param path: [string] file or folder 230 | 231 | @python_v12 New function added 232 | 233 | Example:: 234 | 235 | .. 236 | st = xbmcvfs.Stat(path) 237 | modified = st.st_mtime() 238 | .. 239 | """ 240 | 241 | def __init__(self, path: str) -> None: 242 | pass 243 | 244 | def st_mode(self) -> int: 245 | """ 246 | To get file protection. 247 | 248 | :return: st_mode 249 | """ 250 | return 0 251 | 252 | def st_ino(self) -> int: 253 | """ 254 | To get inode number. 255 | 256 | :return: st_ino 257 | """ 258 | return 0 259 | 260 | def st_dev(self) -> int: 261 | """ 262 | To get ID of device containing file. 263 | 264 | The st_dev field describes the device on which this file resides. 265 | 266 | :return: st_dev 267 | """ 268 | return 0 269 | 270 | def st_nlink(self) -> int: 271 | """ 272 | To get number of hard links. 273 | 274 | :return: st_nlink 275 | """ 276 | return 0 277 | 278 | def st_uid(self) -> int: 279 | """ 280 | To get user ID of owner. 281 | 282 | :return: st_uid 283 | """ 284 | return 0 285 | 286 | def st_gid(self) -> int: 287 | """ 288 | To get group ID of owner. 289 | 290 | :return: st_gid 291 | """ 292 | return 0 293 | 294 | def st_size(self) -> int: 295 | """ 296 | To get total size, in bytes. 297 | 298 | The st_size field gives the size of the file (if it is a regular file or a 299 | symbolic link) in bytes. The size of a symbolic link (only on Linux and Mac OS X) 300 | is the length of the pathname it contains, without a terminating null byte. 301 | 302 | :return: st_size 303 | """ 304 | return 0 305 | 306 | def st_atime(self) -> int: 307 | """ 308 | To get time of last access. 309 | 310 | :return: st_atime 311 | """ 312 | return 0 313 | 314 | def st_mtime(self) -> int: 315 | """ 316 | To get time of last modification. 317 | 318 | :return: st_mtime 319 | """ 320 | return 0 321 | 322 | def st_ctime(self) -> int: 323 | """ 324 | To get time of last status change. 325 | 326 | :return: st_ctime 327 | """ 328 | return 0 329 | 330 | 331 | def copy(strSource: str, strDestination: str) -> bool: 332 | """ 333 | Copy file to destination, returns true/false. 334 | 335 | :param source: file to copy. 336 | :param destination: destination file 337 | :return: True if successed 338 | 339 | Example:: 340 | 341 | .. 342 | success = xbmcvfs.copy(source, destination) 343 | .. 344 | """ 345 | return True 346 | 347 | 348 | def delete(file: str) -> bool: 349 | """ 350 | Delete a file 351 | 352 | :param file: File to delete 353 | :return: True if successed 354 | 355 | Example:: 356 | 357 | .. 358 | xbmcvfs.delete(file) 359 | .. 360 | """ 361 | return True 362 | 363 | 364 | def rename(file: str, newFile: str) -> bool: 365 | """ 366 | Rename a file 367 | 368 | :param file: File to rename 369 | :param newFileName: New filename, including the full path 370 | :return: True if successed 371 | 372 | .. note:: 373 | Moving files between different filesystem (eg. local to nfs://) is 374 | not possible on all platforms. You may have to do it manually by 375 | using the copy and deleteFile functions. 376 | 377 | Example:: 378 | 379 | .. 380 | success = xbmcvfs.rename(file,newFileName) 381 | .. 382 | """ 383 | return True 384 | 385 | 386 | def exists(path: str) -> bool: 387 | """ 388 | Check for a file or folder existence 389 | 390 | :param path: File or folder (folder must end with slash or backslash) 391 | :return: True if successed 392 | 393 | Example:: 394 | 395 | .. 396 | success = xbmcvfs.exists(path) 397 | .. 398 | """ 399 | return True 400 | 401 | 402 | def makeLegalFilename(filename: str) -> str: 403 | """ 404 | Returns a legal filename or path as a string. 405 | 406 | :param filename: string - filename/path to make legal 407 | :return: Legal filename or path as a string 408 | 409 | .. note:: 410 | The returned value is platform-specific. This is due to the fact 411 | that the chars that need to be replaced to make a path legal 412 | depend on the underlying OS filesystem. This is useful, for 413 | example, if you want to create a file or folder based on data over 414 | which you have no control (e.g. an external API). 415 | 416 | @python_v19 New function added (replaces old **xbmc.makeLegalFilename**) 417 | 418 | Example:: 419 | 420 | .. 421 | # windows 422 | >> xbmcvfs.makeLegalFilename('C://Trailers/Ice Age: The Meltdown.avi') 423 | C:\Trailers\Ice Age_ The Meltdown.avi 424 | # non-windows 425 | >> xbmcvfs.makeLegalFilename("///\\jk???lj????.mpg") 426 | /jk___lj____.mpg 427 | .. 428 | """ 429 | return "" 430 | 431 | 432 | def translatePath(path: str) -> str: 433 | """ 434 | Returns the translated path. 435 | 436 | :param path: string - Path to format 437 | :return: Translated path 438 | 439 | .. note:: 440 | Only useful if you are coding for both Linux and Windows. e.g. 441 | Converts 'special://home' -> '/home/[username]/.kodi' on Linux. 442 | 443 | @python_v19 New function added (replaces old **xbmc.translatePath**) 444 | 445 | Example:: 446 | 447 | .. 448 | fpath = xbmcvfs.translatePath('special://home') 449 | .. 450 | """ 451 | return "" 452 | 453 | 454 | def validatePath(path: str) -> str: 455 | """ 456 | Returns the validated path. 457 | 458 | :param path: string - Path to format 459 | :return: Validated path 460 | 461 | .. note:: 462 | The result is platform-specific. Only useful if you are coding for 463 | multiple platfforms for fixing slash problems (e.g. Corrects 464 | 'Z://something' -> 'Z:\something'). 465 | 466 | @python_v19 New function added (replaces old **xbmc.validatePath**) 467 | 468 | Example:: 469 | 470 | .. 471 | fpath = xbmcvfs.validatePath(somepath) 472 | .. 473 | """ 474 | return "" 475 | 476 | 477 | def mkdir(path: str) -> bool: 478 | """ 479 | Create a folder. 480 | 481 | :param path: Folder to create 482 | :return: True if successed 483 | 484 | Example:: 485 | 486 | .. 487 | success = xbmcvfs.mkdir(path) 488 | .. 489 | """ 490 | return True 491 | 492 | 493 | def mkdirs(path: str) -> bool: 494 | """ 495 | Make all directories along the path 496 | 497 | Create folder(s) - it will create all folders in the path. 498 | 499 | :param path: Folders to create 500 | :return: True if successed 501 | 502 | Example:: 503 | 504 | .. 505 | success = xbmcvfs.mkdirs(path) 506 | .. 507 | """ 508 | return True 509 | 510 | 511 | def rmdir(path: str, force: bool = False) -> bool: 512 | """ 513 | Remove a folder. 514 | 515 | :param path: string - Folder to remove 516 | :param force: [opt] bool - Force directory removal (default False). This can be 517 | useful if the directory is not empty. 518 | :return: bool - True if successful, False otherwise 519 | 520 | Example:: 521 | 522 | .. 523 | success = xbmcvfs.rmdir(path) 524 | .. 525 | """ 526 | return True 527 | 528 | 529 | def listdir(path: str) -> Tuple[List[str], List[str]]: 530 | """ 531 | Lists content of a folder. 532 | 533 | :param path: Folder to get list from 534 | :return: Directory content list 535 | 536 | Example:: 537 | 538 | .. 539 | dirs, files = xbmcvfs.listdir(path) 540 | .. 541 | """ 542 | return [""], [""] 543 | -------------------------------------------------------------------------------- /xbmcplugin.py: -------------------------------------------------------------------------------- 1 | # This file is generated from Kodi source code and post-edited 2 | # to correct code style and docstrings formatting. 3 | # License: GPL v.3 4 | """ 5 | **Plugin functions on Kodi.** 6 | 7 | Offers classes and functions that allow a developer to present information 8 | through Kodi's standard menu structure. While plugins don't have the same 9 | flexibility as scripts, they boast significantly quicker development time and a 10 | more consistent user experience. 11 | """ 12 | from typing import List, Tuple, Optional 13 | 14 | __kodistubs__ = True 15 | 16 | SORT_METHOD_ALBUM = 14 17 | SORT_METHOD_ALBUM_IGNORE_THE = 15 18 | SORT_METHOD_ARTIST = 11 19 | SORT_METHOD_ARTIST_IGNORE_THE = 13 20 | SORT_METHOD_BITRATE = 43 21 | SORT_METHOD_CHANNEL = 41 22 | SORT_METHOD_COUNTRY = 17 23 | SORT_METHOD_DATE = 3 24 | SORT_METHOD_DATEADDED = 21 25 | SORT_METHOD_DATE_TAKEN = 44 26 | SORT_METHOD_DRIVE_TYPE = 6 27 | SORT_METHOD_DURATION = 8 28 | SORT_METHOD_EPISODE = 24 29 | SORT_METHOD_FILE = 5 30 | SORT_METHOD_FULLPATH = 35 31 | SORT_METHOD_GENRE = 16 32 | SORT_METHOD_LABEL = 1 33 | SORT_METHOD_LABEL_IGNORE_FOLDERS = 36 34 | SORT_METHOD_LABEL_IGNORE_THE = 2 35 | SORT_METHOD_LASTPLAYED = 37 36 | SORT_METHOD_LISTENERS = 39 37 | SORT_METHOD_MPAA_RATING = 31 38 | SORT_METHOD_NONE = 0 39 | SORT_METHOD_PLAYCOUNT = 38 40 | SORT_METHOD_PLAYLIST_ORDER = 23 41 | SORT_METHOD_PRODUCTIONCODE = 28 42 | SORT_METHOD_PROGRAM_COUNT = 22 43 | SORT_METHOD_SIZE = 4 44 | SORT_METHOD_SONG_RATING = 29 45 | SORT_METHOD_SONG_USER_RATING = 30 46 | SORT_METHOD_STUDIO = 33 47 | SORT_METHOD_STUDIO_IGNORE_THE = 34 48 | SORT_METHOD_TITLE = 9 49 | SORT_METHOD_TITLE_IGNORE_THE = 10 50 | SORT_METHOD_TRACKNUM = 7 51 | SORT_METHOD_UNSORTED = 40 52 | SORT_METHOD_VIDEO_ORIGINAL_TITLE = 49 53 | SORT_METHOD_VIDEO_ORIGINAL_TITLE_IGNORE_THE = 50 54 | SORT_METHOD_VIDEO_RATING = 19 55 | SORT_METHOD_VIDEO_RUNTIME = 32 56 | SORT_METHOD_VIDEO_SORT_TITLE = 26 57 | SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE = 27 58 | SORT_METHOD_VIDEO_TITLE = 25 59 | SORT_METHOD_VIDEO_USER_RATING = 20 60 | SORT_METHOD_VIDEO_YEAR = 18 61 | 62 | 63 | def addDirectoryItem(handle: int, 64 | url: str, 65 | listitem: 'xbmcgui.ListItem', 66 | isFolder: bool = False, 67 | totalItems: int = 0) -> bool: 68 | """ 69 | Callback function to pass directory contents back to Kodi. 70 | 71 | :param handle: integer - handle the plugin was started with. 72 | :param url: string - url of the entry. would be ``plugin://`` for another virtual 73 | directory 74 | :param listitem: ListItem - item to add. 75 | :param isFolder: [opt] bool - True=folder / False=not a folder(default). 76 | :param totalItems: [opt] integer - total number of items that will be passed.(used for 77 | progressbar) 78 | :return: Returns a bool for successful completion. 79 | 80 | .. note:: 81 | You can use the above as keywords for arguments and skip certain 82 | optional arguments. Once you use a keyword, all following 83 | arguments require the keyword. 84 | 85 | Example:: 86 | 87 | .. 88 | if not xbmcplugin.addDirectoryItem(int(sys.argv[1]), 'F:\\Trailers\\300.mov', listitem, totalItems=50): break 89 | .. 90 | """ 91 | return True 92 | 93 | 94 | def addDirectoryItems(handle: int, 95 | items: List[Tuple[str, 'xbmcgui.ListItem', bool]], 96 | totalItems: int = 0) -> bool: 97 | """ 98 | Callback function to pass directory contents back to Kodi as a list. 99 | 100 | :param handle: integer - handle the plugin was started with. 101 | :param items: List - list of (url, listitem[, isFolder]) as a tuple to add. 102 | :param totalItems: [opt] integer - total number of items that will be passed.(used for 103 | progressbar) 104 | :return: Returns a bool for successful completion. 105 | 106 | Large lists benefit over using the standard `addDirectoryItem()`. You may call 107 | this more than once to add items in chunks. 108 | 109 | Example:: 110 | 111 | .. 112 | if not xbmcplugin.addDirectoryItems(int(sys.argv[1]), [(url, listitem, False,)]: raise 113 | .. 114 | """ 115 | return True 116 | 117 | 118 | def endOfDirectory(handle: int, 119 | succeeded: bool = True, 120 | updateListing: bool = False, 121 | cacheToDisc: bool = True) -> None: 122 | """ 123 | Callback function to tell Kodi that the end of the directory listing in a 124 | virtualPythonFolder module is reached. 125 | 126 | :param handle: integer - handle the plugin was started with. 127 | :param succeeded: [opt] bool - True=script completed successfully(Default)/False=Script 128 | did not. 129 | :param updateListing: [opt] bool - True=this folder should update the current 130 | listing/False=Folder is a subfolder(Default). 131 | :param cacheToDisc: [opt] bool - True=Folder will cache if extended 132 | time(default)/False=this folder will never cache to disc. 133 | 134 | Example:: 135 | 136 | .. 137 | xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=False) 138 | .. 139 | """ 140 | pass 141 | 142 | 143 | def setResolvedUrl(handle: int, 144 | succeeded: bool, 145 | listitem: 'xbmcgui.ListItem') -> None: 146 | """ 147 | Callback function to tell Kodi that the file plugin has been resolved to a url 148 | 149 | :param handle: integer - handle the plugin was started with. 150 | :param succeeded: bool - True=script completed successfully/False=Script did not. 151 | :param listitem: ListItem - item the file plugin resolved to for playback. 152 | 153 | Example:: 154 | 155 | .. 156 | xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, listitem) 157 | .. 158 | """ 159 | pass 160 | 161 | 162 | def addSortMethod(handle: int, 163 | sortMethod: int, 164 | labelMask: str = "", 165 | label2Mask: str = "") -> None: 166 | """ 167 | @brief \python_func{ xbmcplugin.addSortMethod(handle, sortMethod 168 | [,labelMask, label2Mask]) }Adds a sorting method for the media list. 169 | 170 | :param handle: integer - handle the plugin was started with. 171 | :param sortMethod: integer - see available sort methods at the bottom (or see SortUtils). 172 | 173 | =================================================================== ================================================ 174 | Value Description 175 | =================================================================== ================================================ 176 | xbmcplugin.SORT_METHOD_NONE Do not sort 177 | xbmcplugin.SORT_METHOD_LABEL Sort by label 178 | xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE Sort by the label and ignore "The" before 179 | xbmcplugin.SORT_METHOD_DATE Sort by the date 180 | xbmcplugin.SORT_METHOD_SIZE Sort by the size 181 | xbmcplugin.SORT_METHOD_FILE Sort by the file 182 | xbmcplugin.SORT_METHOD_DRIVE_TYPE Sort by the drive type 183 | xbmcplugin.SORT_METHOD_TRACKNUM Sort by the track number 184 | xbmcplugin.SORT_METHOD_DURATION Sort by the duration 185 | xbmcplugin.SORT_METHOD_TITLE Sort by the title 186 | xbmcplugin.SORT_METHOD_TITLE_IGNORE_THE Sort by the title and ignore "The" before 187 | xbmcplugin.SORT_METHOD_ARTIST Sort by the artist 188 | xbmcplugin.SORT_METHOD_ARTIST_IGNORE_THE Sort by the artist and ignore "The" before 189 | xbmcplugin.SORT_METHOD_ALBUM Sort by the album 190 | xbmcplugin.SORT_METHOD_ALBUM_IGNORE_THE Sort by the album and ignore "The" before 191 | xbmcplugin.SORT_METHOD_GENRE Sort by the genre 192 | xbmcplugin.SORT_SORT_METHOD_VIDEO_YEAR, xbmcplugin.SORT_METHOD_YEAR Sort by the year 193 | xbmcplugin.SORT_METHOD_VIDEO_RATING Sort by the video rating 194 | xbmcplugin.SORT_METHOD_PROGRAM_COUNT Sort by the program count 195 | xbmcplugin.SORT_METHOD_PLAYLIST_ORDER Sort by the playlist order 196 | xbmcplugin.SORT_METHOD_EPISODE Sort by the episode 197 | xbmcplugin.SORT_METHOD_VIDEO_TITLE Sort by the video title 198 | xbmcplugin.SORT_METHOD_VIDEO_SORT_TITLE Sort by the video sort title 199 | xbmcplugin.SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE Sort by the video sort title and ignore 200 | "The" before 201 | xbmcplugin.SORT_METHOD_PRODUCTIONCODE Sort by the production code 202 | xbmcplugin.SORT_METHOD_SONG_RATING Sort by the song rating 203 | xbmcplugin.SORT_METHOD_MPAA_RATING Sort by the mpaa rating 204 | xbmcplugin.SORT_METHOD_VIDEO_RUNTIME Sort by video runtime 205 | xbmcplugin.SORT_METHOD_STUDIO Sort by the studio 206 | xbmcplugin.SORT_METHOD_STUDIO_IGNORE_THE Sort by the studio and ignore "The" before 207 | xbmcplugin.SORT_METHOD_UNSORTED Use list not sorted 208 | xbmcplugin.SORT_METHOD_BITRATE Sort by the bitrate 209 | xbmcplugin.SORT_METHOD_LISTENERS Sort by the listeners 210 | xbmcplugin.SORT_METHOD_COUNTRY Sort by the country 211 | xbmcplugin.SORT_METHOD_DATEADDED Sort by the added date 212 | xbmcplugin.SORT_METHOD_FULLPATH Sort by the full path name 213 | xbmcplugin.SORT_METHOD_LABEL_IGNORE_FOLDERS Sort by the label names and ignore related 214 | folder names 215 | xbmcplugin.SORT_METHOD_LASTPLAYED Sort by last played date 216 | xbmcplugin.SORT_METHOD_PLAYCOUNT Sort by the play count 217 | xbmcplugin.SORT_METHOD_CHANNEL Sort by the channel 218 | xbmcplugin.SORT_METHOD_DATE_TAKEN Sort by the taken date 219 | xbmcplugin.SORT_METHOD_VIDEO_USER_RATING Sort by the rating of the user of video 220 | xbmcplugin.SORT_METHOD_SONG_USER_RATING Sort by the rating of the user of song 221 | =================================================================== ================================================ 222 | 223 | :param labelMask: [opt] string - the label mask to use for the first label. applies to: 224 | 225 | ========================== ======================= 226 | sortMethod labelMask 227 | ========================== ======================= 228 | SORT_METHOD_TRACKNUM Defaults to``[%N. ]%T`` 229 | SORT_METHOD_EPISODE Defaults to``%H. %T`` 230 | SORT_METHOD_PRODUCTIONCODE Defaults to``%H. %T`` 231 | All other sort methods Defaults to``%T`` 232 | ========================== ======================= 233 | 234 | :param label2Mask: [opt] string - the label mask to use for the second label. Defaults 235 | to``%D`` applies to: 236 | 237 | ================================ ==================== ======================================= 238 | SORT_METHOD_NONE SORT_METHOD_UNSORTED SORT_METHOD_VIDEO_TITLE 239 | SORT_METHOD_TRACKNUM SORT_METHOD_FILE SORT_METHOD_TITLE 240 | SORT_METHOD_TITLE_IGNORE_THE SORT_METHOD_LABEL SORT_METHOD_LABEL_IGNORE_THE 241 | SORT_METHOD_VIDEO_SORT_TITLE SORT_METHOD_FULLPATH SORT_METHOD_VIDEO_SORT_TITLE_IGNORE_THE 242 | SORT_METHOD_LABEL_IGNORE_FOLDERS SORT_METHOD_CHANNEL 243 | ================================ ==================== ======================================= 244 | 245 | .. note:: 246 | to add multiple sort methods just call the method multiple times. 247 | 248 | @python_v13 Added new sort **SORT_METHOD_DATE_TAKEN**, **SORT_METHOD_COU 249 | NTRY**, **SORT_METHOD_DATEADDED**, **SORT_METHOD_FULLPATH**, **SORT_METHO 250 | D_LABEL_IGNORE_FOLDERS**, **SORT_METHOD_LASTPLAYED**, **SORT_METHOD_PLAY 251 | COUNT**, **SORT_METHOD_CHANNEL**. 252 | 253 | @python_v17 Added new sort **SORT_METHOD_VIDEO_USER_RATING**. 254 | 255 | @python_v19 Added new option **labelMask**. 256 | 257 | Example:: 258 | 259 | .. 260 | xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORTMETHOD_DATEADDED) 261 | .. 262 | """ 263 | pass 264 | 265 | 266 | def getSetting(handle: int, id: str) -> str: 267 | """ 268 | Returns the value of a setting as a string. 269 | 270 | :param handle: integer - handle the plugin was started with. 271 | :param id: string - id of the setting that the module needs to access. 272 | :return: Setting value as string 273 | 274 | .. note:: 275 | You can use the above as a keyword. 276 | 277 | Example:: 278 | 279 | .. 280 | apikey = xbmcplugin.getSetting(int(sys.argv[1]), 'apikey') 281 | .. 282 | """ 283 | return "" 284 | 285 | 286 | def setSetting(handle: int, id: str, value: str) -> None: 287 | """ 288 | Sets a plugin setting for the current running plugin. 289 | 290 | :param handle: integer - handle the plugin was started with. 291 | :param id: string - id of the setting that the module needs to access. 292 | :param value: string or unicode - value of the setting. 293 | 294 | Example:: 295 | 296 | .. 297 | xbmcplugin.setSetting(int(sys.argv[1]), id='username', value='teamxbmc') 298 | .. 299 | """ 300 | pass 301 | 302 | 303 | def setContent(handle: int, content: str) -> None: 304 | """ 305 | Sets the plugins content. 306 | 307 | :param handle: integer - handle the plugin was started with. 308 | :param content: string - content type (eg. movies) 309 | 310 | Available content strings 311 | 312 | ====== ======= ======== =========== 313 | files songs artists albums 314 | movies tvshows episodes musicvideos 315 | videos images games 316 | ====== ======= ======== =========== 317 | 318 | Use **videos** for all videos which do not apply to the more specific mentioned 319 | ones like "movies", "episodes" etc. A good example is youtube. 320 | 321 | @python_v18 Added new **games** contentExample:: 322 | 323 | .. 324 | xbmcplugin.setContent(int(sys.argv[1]), 'movies') 325 | .. 326 | """ 327 | pass 328 | 329 | 330 | def setPluginCategory(handle: int, category: str) -> None: 331 | """ 332 | Sets the plugins name for skins to display. 333 | 334 | :param handle: integer - handle the plugin was started with. 335 | :param category: string or unicode - plugins sub category. 336 | 337 | Example:: 338 | 339 | .. 340 | xbmcplugin.setPluginCategory(int(sys.argv[1]), 'Comedy') 341 | .. 342 | """ 343 | pass 344 | 345 | 346 | def setPluginFanart(handle: int, 347 | image: Optional[str] = None, 348 | color1: Optional[str] = None, 349 | color2: Optional[str] = None, 350 | color3: Optional[str] = None) -> None: 351 | """ 352 | Sets the plugins fanart and color for skins to display. 353 | 354 | :param handle: integer - handle the plugin was started with. 355 | :param image: [opt] string - path to fanart image. 356 | :param color1: [opt] hexstring - color1. (e.g. '0xFFFFFFFF') 357 | :param color2: [opt] hexstring - color2. (e.g. '0xFFFF3300') 358 | :param color3: [opt] hexstring - color3. (e.g. '0xFF000000') 359 | 360 | Example:: 361 | 362 | .. 363 | xbmcplugin.setPluginFanart(int(sys.argv[1]), 'special://home/addons/plugins/video/Apple movie trailers II/fanart.png', 364 | color2='0xFFFF3300') 365 | .. 366 | """ 367 | pass 368 | 369 | 370 | def setProperty(handle: int, key: str, value: str) -> None: 371 | """ 372 | Sets a container property for this plugin. 373 | 374 | :param handle: integer - handle the plugin was started with. 375 | :param key: string - property name. 376 | :param value: string or unicode - value of property. 377 | 378 | .. note:: 379 | Key is NOT case sensitive. 380 | 381 | Example:: 382 | 383 | .. 384 | xbmcplugin.setProperty(int(sys.argv[1]), 'Emulator', 'M.A.M.E.') 385 | .. 386 | """ 387 | pass 388 | -------------------------------------------------------------------------------- /xbmcaddon.py: -------------------------------------------------------------------------------- 1 | # This file is generated from Kodi source code and post-edited 2 | # to correct code style and docstrings formatting. 3 | # License: GPL v.3 4 | """ 5 | **Kodi's addon class.** 6 | """ 7 | from typing import List, Optional 8 | 9 | __kodistubs__ = True 10 | 11 | 12 | class Addon: 13 | """ 14 | **Kodi's addon class.** 15 | 16 | Offers classes and functions that manipulate the add-on settings, information 17 | and localization. 18 | 19 | Creates a new AddOn class. 20 | 21 | :param id: [opt] string - id of the addon as specified inaddon.xml 22 | 23 | .. note:: 24 | Specifying the addon id is not needed. Important however is that 25 | the addon folder has the same name as the AddOn id provided 26 | inaddon.xml. You can optionally specify the addon id from another 27 | installed addon to retrieve settings from it. 28 | 29 | @python_v13 **id** is optional as it will be auto detected for this 30 | add-on instance. 31 | 32 | Example:: 33 | 34 | .. 35 | self.Addon = xbmcaddon.Addon() 36 | self.Addon = xbmcaddon.Addon('script.foo.bar') 37 | .. 38 | """ 39 | 40 | def __init__(self, id: Optional[str] = None) -> None: 41 | pass 42 | 43 | def getLocalizedString(self, id: int) -> str: 44 | """ 45 | Returns an addon's localized 'string'. 46 | 47 | :param id: integer - id# for string you want to localize. 48 | :return: Localized 'string' 49 | 50 | @python_v13 **id** is optional as it will be auto detected for this 51 | add-on instance. 52 | 53 | Example:: 54 | 55 | .. 56 | locstr = self.Addon.`getLocalizedString`(32000) 57 | .. 58 | """ 59 | return "" 60 | 61 | def getSettings(self) -> 'Settings': 62 | """ 63 | Returns a wrapper around the addon's settings. 64 | 65 | :return: `Settings` wrapper 66 | 67 | @python_v20 New function added. 68 | 69 | Example:: 70 | 71 | .. 72 | settings = self.Addon.getSettings() 73 | .. 74 | """ 75 | return Settings() 76 | 77 | def getSetting(self, id: str) -> str: 78 | """ 79 | Returns the value of a setting as string. 80 | 81 | :param id: string - id of the setting that the module needs to access. 82 | :return: Setting as a string 83 | 84 | @python_v13 **id** is optional as it will be auto detected for this 85 | add-on instance. 86 | 87 | Example:: 88 | 89 | .. 90 | apikey = self.Addon.getSetting('apikey') 91 | .. 92 | """ 93 | return "" 94 | 95 | def getSettingBool(self, id: str) -> bool: 96 | """ 97 | Returns the value of a setting as a boolean. 98 | 99 | :param id: string - id of the setting that the module needs to access. 100 | :return: Setting as a boolean 101 | 102 | @python_v18 New function added. 103 | 104 | @python_v20 Deprecated. Use **`Settings.getBool()`** instead. 105 | 106 | Example:: 107 | 108 | .. 109 | enabled = self.Addon.getSettingBool('enabled') 110 | .. 111 | """ 112 | return True 113 | 114 | def getSettingInt(self, id: str) -> int: 115 | """ 116 | Returns the value of a setting as an integer. 117 | 118 | :param id: string - id of the setting that the module needs to access. 119 | :return: Setting as an integer 120 | 121 | @python_v18 New function added. 122 | 123 | @python_v20 Deprecated. Use **`Settings.getInt()`** instead. 124 | 125 | Example:: 126 | 127 | .. 128 | max = self.Addon.getSettingInt('max') 129 | .. 130 | """ 131 | return 0 132 | 133 | def getSettingNumber(self, id: str) -> float: 134 | """ 135 | Returns the value of a setting as a floating point number. 136 | 137 | :param id: string - id of the setting that the module needs to access. 138 | :return: Setting as a floating point number 139 | 140 | @python_v18 New function added. 141 | 142 | @python_v20 Deprecated. Use **`Settings.getNumber()`** instead. 143 | 144 | Example:: 145 | 146 | .. 147 | max = self.Addon.getSettingNumber('max') 148 | .. 149 | """ 150 | return 0.0 151 | 152 | def getSettingString(self, id: str) -> str: 153 | """ 154 | Returns the value of a setting as a string. 155 | 156 | :param id: string - id of the setting that the module needs to access. 157 | :return: Setting as a string 158 | 159 | @python_v18 New function added. 160 | 161 | @python_v20 Deprecated. Use **`Settings.getString()`** instead. 162 | 163 | Example:: 164 | 165 | .. 166 | apikey = self.Addon.getSettingString('apikey') 167 | .. 168 | """ 169 | return "" 170 | 171 | def setSetting(self, id: str, value: str) -> None: 172 | """ 173 | Sets a script setting. 174 | 175 | :param id: string - id of the setting that the module needs to access. 176 | :param value: string - value of the setting. 177 | 178 | .. note:: 179 | You can use the above as keywords for arguments. 180 | 181 | @python_v13 **id** is optional as it will be auto detected for this 182 | add-on instance. 183 | 184 | Example:: 185 | 186 | .. 187 | self.Addon.`setSetting`(id='username', value='teamkodi') 188 | .. 189 | """ 190 | pass 191 | 192 | def setSettingBool(self, id: str, value: bool) -> bool: 193 | """ 194 | Sets a script setting. 195 | 196 | :param id: string - id of the setting that the module needs to access. 197 | :param value: boolean - value of the setting. 198 | :return: True if the value of the setting was set, false otherwise 199 | 200 | .. note:: 201 | You can use the above as keywords for arguments. 202 | 203 | @python_v18 New function added. 204 | 205 | @python_v20 Deprecated. Use **`Settings.setBool()`** instead. 206 | 207 | Example:: 208 | 209 | .. 210 | self.Addon.setSettingBool(id='enabled', value=True) 211 | .. 212 | """ 213 | return True 214 | 215 | def setSettingInt(self, id: str, value: int) -> bool: 216 | """ 217 | Sets a script setting. 218 | 219 | :param id: string - id of the setting that the module needs to access. 220 | :param value: integer - value of the setting. 221 | :return: True if the value of the setting was set, false otherwise 222 | 223 | .. note:: 224 | You can use the above as keywords for arguments. 225 | 226 | @python_v18 New function added. 227 | 228 | @python_v20 Deprecated. Use **`Settings.setInt()`** instead. 229 | 230 | Example:: 231 | 232 | .. 233 | self.Addon.setSettingInt(id='max', value=5) 234 | .. 235 | """ 236 | return True 237 | 238 | def setSettingNumber(self, id: str, value: float) -> bool: 239 | """ 240 | Sets a script setting. 241 | 242 | :param id: string - id of the setting that the module needs to access. 243 | :param value: float - value of the setting. 244 | :return: True if the value of the setting was set, false otherwise 245 | 246 | .. note:: 247 | You can use the above as keywords for arguments. 248 | 249 | @python_v18 New function added. 250 | 251 | @python_v20 Deprecated. Use **`Settings.setNumber()`** instead. 252 | 253 | Example:: 254 | 255 | .. 256 | self.Addon.setSettingNumber(id='max', value=5.5) 257 | .. 258 | """ 259 | return True 260 | 261 | def setSettingString(self, id: str, value: str) -> bool: 262 | """ 263 | Sets a script setting. 264 | 265 | :param id: string - id of the setting that the module needs to access. 266 | :param value: string or unicode - value of the setting. 267 | :return: True if the value of the setting was set, false otherwise 268 | 269 | .. note:: 270 | You can use the above as keywords for arguments. 271 | 272 | @python_v18 New function added. 273 | 274 | @python_v20 Deprecated. Use **`Settings.setString()`** instead. 275 | 276 | Example:: 277 | 278 | .. 279 | self.Addon.setSettingString(id='username', value='teamkodi') 280 | .. 281 | """ 282 | return True 283 | 284 | def openSettings(self) -> None: 285 | """ 286 | Opens this scripts settings dialog. 287 | 288 | Example:: 289 | 290 | .. 291 | self.Addon.openSettings() 292 | .. 293 | """ 294 | pass 295 | 296 | def getAddonInfo(self, id: str) -> str: 297 | """ 298 | Returns the value of an addon property as a string. 299 | 300 | :param id: string - id of the property that the module needs to access. 301 | 302 | Choices for the property are 303 | 304 | ====== ========= =========== ========== 305 | author changelog description disclaimer 306 | fanart icon id name 307 | path profile stars summary 308 | type version 309 | ====== ========= =========== ========== 310 | 311 | :return: AddOn property as a string 312 | 313 | Example:: 314 | 315 | .. 316 | version = self.Addon.getAddonInfo('version') 317 | .. 318 | """ 319 | return "" 320 | 321 | 322 | class Settings: 323 | """ 324 | **Add-on settings** 325 | 326 | This wrapper provides access to the settings specific to an add-on. It supports 327 | reading and writing specific setting values. 328 | 329 | @python_v20 New class added. 330 | 331 | Example:: 332 | 333 | ... 334 | settings = xbmcaddon.Addon('id').getSettings() 335 | ... 336 | """ 337 | 338 | def getBool(self, id: str) -> bool: 339 | """ 340 | Returns the value of a setting as a boolean. 341 | 342 | :param id: string - id of the setting that the module needs to access. 343 | :return: bool - Setting as a boolean 344 | 345 | @python_v20 New function added. 346 | 347 | Example:: 348 | 349 | .. 350 | enabled = settings.getBool('enabled') 351 | .. 352 | """ 353 | return True 354 | 355 | def getInt(self, id: str) -> int: 356 | """ 357 | Returns the value of a setting as an integer. 358 | 359 | :param id: string - id of the setting that the module needs to access. 360 | :return: integer - Setting as an integer 361 | 362 | @python_v20 New function added. 363 | 364 | Example:: 365 | 366 | .. 367 | max = settings.getInt('max') 368 | .. 369 | """ 370 | return 0 371 | 372 | def getNumber(self, id: str) -> float: 373 | """ 374 | Returns the value of a setting as a floating point number. 375 | 376 | :param id: string - id of the setting that the module needs to access. 377 | :return: float - Setting as a floating point number 378 | 379 | @python_v20 New function added. 380 | 381 | Example:: 382 | 383 | .. 384 | max = settings.getNumber('max') 385 | .. 386 | """ 387 | return 0.0 388 | 389 | def getString(self, id: str) -> str: 390 | """ 391 | Returns the value of a setting as a unicode string. 392 | 393 | :param id: string - id of the setting that the module needs to access. 394 | :return: string - Setting as a unicode string 395 | 396 | @python_v20 New function added. 397 | 398 | Example:: 399 | 400 | .. 401 | apikey = settings.getString('apikey') 402 | .. 403 | """ 404 | return "" 405 | 406 | def getBoolList(self, id: str) -> List[bool]: 407 | """ 408 | Returns the value of a setting as a list of booleans. 409 | 410 | :param id: string - id of the setting that the module needs to access. 411 | :return: list - Setting as a list of booleans 412 | 413 | @python_v20 New function added. 414 | 415 | Example:: 416 | 417 | .. 418 | enabled = settings.getBoolList('enabled') 419 | .. 420 | """ 421 | return [True] 422 | 423 | def getIntList(self, id: str) -> List[int]: 424 | """ 425 | Returns the value of a setting as a list of integers. 426 | 427 | :param id: string - id of the setting that the module needs to access. 428 | :return: list - Setting as a list of integers 429 | 430 | @python_v20 New function added. 431 | 432 | Example:: 433 | 434 | .. 435 | ids = settings.getIntList('ids') 436 | .. 437 | """ 438 | return [0] 439 | 440 | def getNumberList(self, id: str) -> List[float]: 441 | """ 442 | Returns the value of a setting as a list of floating point numbers. 443 | 444 | :param id: string - id of the setting that the module needs to access. 445 | :return: list - Setting as a list of floating point numbers 446 | 447 | @python_v20 New function added. 448 | 449 | Example:: 450 | 451 | .. 452 | max = settings.getNumberList('max') 453 | .. 454 | """ 455 | return [0.0] 456 | 457 | def getStringList(self, id: str) -> List[str]: 458 | """ 459 | Returns the value of a setting as a list of unicode strings. 460 | 461 | :param id: string - id of the setting that the module needs to access. 462 | :return: list - Setting as a list of unicode strings 463 | 464 | @python_v20 New function added. 465 | 466 | Example:: 467 | 468 | .. 469 | views = settings.getStringList('views') 470 | .. 471 | """ 472 | return [""] 473 | 474 | def setBool(self, id: str, value: bool) -> None: 475 | """ 476 | Sets the value of a setting. 477 | 478 | :param id: string - id of the setting that the module needs to access. 479 | :param value: bool - value of the setting. 480 | :return: bool - True if the value of the setting was set, false otherwise 481 | 482 | .. note:: 483 | You can use the above as keywords for arguments. 484 | 485 | @python_v20 New function added. 486 | 487 | Example:: 488 | 489 | .. 490 | settings.setBool(id='enabled', value=True) 491 | .. 492 | """ 493 | pass 494 | 495 | def setInt(self, id: str, value: int) -> None: 496 | """ 497 | Sets the value of a setting. 498 | 499 | :param id: string - id of the setting that the module needs to access. 500 | :param value: integer - value of the setting. 501 | :return: bool - True if the value of the setting was set, false otherwise 502 | 503 | .. note:: 504 | You can use the above as keywords for arguments. 505 | 506 | @python_v20 New function added. 507 | 508 | Example:: 509 | 510 | .. 511 | settings.setInt(id='max', value=5) 512 | .. 513 | """ 514 | pass 515 | 516 | def setNumber(self, id: str, value: float) -> None: 517 | """ 518 | Sets the value of a setting. 519 | 520 | :param id: string - id of the setting that the module needs to access. 521 | :param value: float - value of the setting. 522 | :return: bool - True if the value of the setting was set, false otherwise 523 | 524 | .. note:: 525 | You can use the above as keywords for arguments. 526 | 527 | @python_v20 New function added. 528 | 529 | Example:: 530 | 531 | .. 532 | settings.setNumber(id='max', value=5.5) 533 | .. 534 | """ 535 | pass 536 | 537 | def setString(self, id: str, value: str) -> None: 538 | """ 539 | Sets the value of a setting. 540 | 541 | :param id: string - id of the setting that the module needs to access. 542 | :param value: string or unicode - value of the setting. 543 | :return: bool - True if the value of the setting was set, false otherwise 544 | 545 | .. note:: 546 | You can use the above as keywords for arguments. 547 | 548 | @python_v20 New function added. 549 | 550 | Example:: 551 | 552 | .. 553 | settings.setString(id='username', value='teamkodi') 554 | .. 555 | """ 556 | pass 557 | 558 | def setBoolList(self, id: str, values: List[bool]) -> None: 559 | """ 560 | Sets the boolean values of a list setting. 561 | 562 | :param id: string - id of the setting that the module needs to access. 563 | :param values: list of boolean - values of the setting. 564 | :return: bool - True if the values of the setting were set, false otherwise 565 | 566 | .. note:: 567 | You can use the above as keywords for arguments. 568 | 569 | @python_v20 New function added. 570 | 571 | Example:: 572 | 573 | .. 574 | settings.setBoolList(id='enabled', values=[ True, False ]) 575 | .. 576 | """ 577 | pass 578 | 579 | def setIntList(self, id: str, values: List[int]) -> None: 580 | """ 581 | Sets the integer values of a list setting. 582 | 583 | :param id: string - id of the setting that the module needs to access. 584 | :param values: list of int - values of the setting. 585 | :return: bool - True if the values of the setting were set, false otherwise 586 | 587 | .. note:: 588 | You can use the above as keywords for arguments. 589 | 590 | @python_v20 New function added. 591 | 592 | Example:: 593 | 594 | .. 595 | settings.setIntList(id='max', values=[ 5, 23 ]) 596 | .. 597 | """ 598 | pass 599 | 600 | def setNumberList(self, id: str, values: List[float]) -> None: 601 | """ 602 | Sets the floating point values of a list setting. 603 | 604 | :param id: string - id of the setting that the module needs to access. 605 | :param values: list of float - values of the setting. 606 | :return: bool - True if the values of the setting were set, false otherwise 607 | 608 | .. note:: 609 | You can use the above as keywords for arguments. 610 | 611 | @python_v20 New function added. 612 | 613 | Example:: 614 | 615 | .. 616 | settings.setNumberList(id='max', values=[ 5.5, 5.8 ]) 617 | .. 618 | """ 619 | pass 620 | 621 | def setStringList(self, id: str, values: List[str]) -> None: 622 | """ 623 | Sets the string values of a list setting. 624 | 625 | :param id: string - id of the setting that the module needs to access. 626 | :param values: list of string or unicode - values of the setting. 627 | :return: bool - True if the values of the setting were set, false otherwise 628 | 629 | .. note:: 630 | You can use the above as keywords for arguments. 631 | 632 | @python_v20 New function added. 633 | 634 | Example:: 635 | 636 | .. 637 | settings.setStringList(id='username', values=[ 'team', 'kodi' ]) 638 | .. 639 | """ 640 | pass 641 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 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 | --------------------------------------------------------------------------------