Git Product home page Git Product logo

pvr.python's Introduction

Kodi Python PVR Client

A PVR client supporting Python scripting for Kodi

Build instructions

Linux

  1. mkdir build && cd build
  2. cmake -DADDONS_TO_BUILD=pvr.python -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/path/to/xbmc/addons -DPACKAGE_ZIP=1 /path/to/xbmc/project/cmake/addons
  3. make

To use, name the Python PVR implementation pvrimpl.py and place it in the addon directory, e.g. ~/.kodi/addons/pvr.python/pvrimpl.py or /usr/share/kodi/addons/pvr.python/pvrimpl.py. The default pvrimpl.py is a re-implementation of the Demo PVR backend. Other examples are located in the examples directory.

Developer notes

  • As the Python scripts are executed by the pvr.python addon, there is no direct access to the usual Kodi modules (xbmc, xbmcgui and so on). Access to a limited range of the Kodi functions available to the addon is provided through the bridge module (e.g. bridge.XBMC_Log).
  • The interface to the PVR API has been Python-ified. Multiple return values are used instead of pass-by-reference, Hungarian notation type prefixes are dropped, enums have their own namespace, generators are used instead of callbacks, and so on. Camel case, however, has generally been retained. When in doubt, check the implementation in client.cpp, or the reference implementation.
  • This addon is currently in its infancy. The Python API is likely to undergo significant compatibility-breaking changes in future. The first nonzero component of the version code will be incremented to indicate a backwards-incompatible API change (e.g. 0.0.1.0 to 0.0.2.0; 0.1.4 to 0.2.0).
  • Error handling is currently not very robust. Like, at all. No, seriously, error handling was literally an afterthought. Double-check your damn ~~pointers!~~types! Pull requests would be much appreciated!

Implementation details

  • Python functions beginning with _c are called to convert the Python attributes or processes to their C equivalents. For example, _cstartTime converts the startTime datetime.datetime object to a C timestamp; _cGetChannels passes the results from the iterator-based GetChannels to the native callback-based C API. Ideally, it should not be necessary to override these functions: the Python-based interface (without the _c) should be sufficient.

Licence

Copyright © 2016 RunasSudo (Yingtong Li)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Limited portions of supporting code are based on code © 2011 Pulse-Eight, licensed under the GPLv2 or later.

pvr.python's People

Contributors

runassudo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.