diff options
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/doxygen/Modules/modules_python.dox')
| -rw-r--r-- | xbmc/addons/kodi-addon-dev-kit/doxygen/Modules/modules_python.dox | 179 |
1 files changed, 0 insertions, 179 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/doxygen/Modules/modules_python.dox b/xbmc/addons/kodi-addon-dev-kit/doxygen/Modules/modules_python.dox deleted file mode 100644 index 2812c8a..0000000 --- a/xbmc/addons/kodi-addon-dev-kit/doxygen/Modules/modules_python.dox +++ /dev/null | |||
| @@ -1,179 +0,0 @@ | |||
| 1 | /*! | ||
| 2 | |||
| 3 | |||
| 4 | \defgroup python Python | ||
| 5 | \image html logo-python.png | ||
| 6 | \brief \htmlonly | ||
| 7 | <h3><span style="text-decoration: underline;"><span style="font-style: italic;"><span | ||
| 8 | style="color: rgb(102, 102, 102);">Python Script Add-On Development</span></span></span></h3> | ||
| 9 | \endhtmlonly | ||
| 10 | |||
| 11 | Kodi includes a built-in [Python interpreter](http://en.wikipedia.org/wiki/Python_%28programming_language%29) | ||
| 12 | that allows users to develop add-ons (scripts and plugins) that interface easily | ||
| 13 | and cleanly with the Kodi dashboard. These add-ons can extend the functionality | ||
| 14 | of Kodi without requiring extensive programming experience or ability. While you | ||
| 15 | may not feel comfortable browsing the Kodi source code and submitting patches (or | ||
| 16 | even bug reports), you can learn how to write a script or plugin with just a few | ||
| 17 | hours' practice, using the information available in these pages. | ||
| 18 | |||
| 19 | This page is intended as an introduction to Kodi Python for new developers, and | ||
| 20 | a quick reference for more experienced programmers. If you're not interested in | ||
| 21 | programming, you might want to visit [this page](http://kodi.wiki/view/Add-ons) | ||
| 22 | for information about installing and using Python add-ons as an end user. If | ||
| 23 | you're already familiar with Kodi Python, you can probably skip on down to the | ||
| 24 | [environment details](http://kodi.wiki/view/Python_Development#Environment_details) | ||
| 25 | or the [resource links](http://kodi.wiki/view/Python_Development#Resource_links) | ||
| 26 | below for quick reference material. | ||
| 27 | |||
| 28 | _ _ _ | ||
| 29 | |||
| 30 | Built-in modules | ||
| 31 | ---------------- | ||
| 32 | |||
| 33 | In addition to the standard libraries, Kodi [Python](https://www.python.org/) | ||
| 34 | uses a handful of custom modules to expose Kodi functionality to Python. | ||
| 35 | |||
| 36 | | Module | Description | | ||
| 37 | |------------------------------------:|:-----------------------------------------------------------| | ||
| 38 | | \ref python_xbmc "xbmc" | Offers classes and functions that provide information about the media currently playing and that allow manipulation of the media player (such as starting a new song). You can also find system information using the functions available in this library. | ||
| 39 | | \ref python_xbmcgui "xbmcgui" | Offers classes and functions that manipulate the Graphical User Interface through windows, dialogs, and various control widgets. | ||
| 40 | | \ref python_xbmcplugin "xbmcplugin" | Offers classes and functions that allow a developer to present information through Kodi's standard menu structure. While plugins don't have the same flexibility as scripts, they boast significantly quicker development time and a more consistent user experience. | ||
| 41 | | \ref python_xbmcaddon "xbmcaddon" | Offers classes and functions that manipulate the add-on settings, information and localization. | ||
| 42 | | \ref python_xbmcvfs "xbmcvfs" | Offers classes and functions offers access to the Virtual File Server (VFS) which you can use to manipulate files and folders. | ||
| 43 | | \ref python_xbmcwsgi "xbmcwsgi" | The [<b>Web Server Gateway Interface (WSGI)</b>](https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface) is a specification for simple and universal interface between web servers and web applications or frameworks for the Python programming language. | ||
| 44 | |||
| 45 | _ _ _ | ||
| 46 | |||
| 47 | Installing additional modules | ||
| 48 | ---------------- | ||
| 49 | |||
| 50 | Additional modules may be installed by simply adding the module to the root | ||
| 51 | folder of your add-on. | ||
| 52 | |||
| 53 | A common way to organized third-party modules that are not part of add-on source | ||
| 54 | code itself, is to add a lib directory and place an __init__.py file and other | ||
| 55 | third-party modules inside it. These modules may then normally be imported using | ||
| 56 | from lib import some module. | ||
| 57 | |||
| 58 | _ _ _ | ||
| 59 | |||
| 60 | Python plugins versus scripts | ||
| 61 | ---------------- | ||
| 62 | |||
| 63 | Please do not confuse "Plugins" with "Scripts". Unlike the Scripts, Plugins are | ||
| 64 | not meant to be directly invoked by the user. Instead, Plugins are automatically | ||
| 65 | invoked when the user enters such a virtual folder. Do not try to run Plugins | ||
| 66 | files from the scripts window as that will only give you a weird error message. | ||
| 67 | Plugins, unlike Scripts, do not really provide new functionality to Kodi, | ||
| 68 | instead what they do do is provide an easy way to present content listings in | ||
| 69 | Kodi through the native GUI interface. | ||
| 70 | |||
| 71 | _ _ _ | ||
| 72 | |||
| 73 | Script development | ||
| 74 | ---------------- | ||
| 75 | |||
| 76 | If you're new to Python programming (or just new to Kodi Python), the easiest | ||
| 77 | way to get started is with a script. The traditional Hello World program, | ||
| 78 | written as an Kodi Python script, would look like this: | ||
| 79 | ~~~~~~~~~~~~~{.py} | ||
| 80 | print("Hello World!") | ||
| 81 | ~~~~~~~~~~~~~ | ||
| 82 | That's the same code you would enter at the Python command line, because Kodi | ||
| 83 | runs a full-featured, standard Python interpreter (for more information | ||
| 84 | concerning the current version number and included modules see the environment | ||
| 85 | details below). If you're already familiar with Python programming, the only new | ||
| 86 | challenge is learning the custom modules that allow you to gather information | ||
| 87 | from Kodi and manipulate the Graphical User Interface (GUI). | ||
| 88 | |||
| 89 | There are some excellent tutorials available to introduce you to Kodi scripting | ||
| 90 | (and Python in general). See the [HOW-TO](http://kodi.wiki/view/HOW-TO_write_Python_Scripts) | ||
| 91 | included in the Kodi Online Manual, or visit Alexpoet's Kodi Scripting site for | ||
| 92 | a popular beginner's tutorial (PDF). | ||
| 93 | |||
| 94 | _ _ _ | ||
| 95 | Plugin development | ||
| 96 | ---------------- | ||
| 97 | |||
| 98 | While scripts offer you flexibility and full control over the Kodi GUI, plugins | ||
| 99 | allow you to quickly and consistently present information to the user through | ||
| 100 | the standard Kodi menu structure. | ||
| 101 | |||
| 102 | When a user launches a plugin, the plugin generates a list of menu items and | ||
| 103 | hands them to Kodi to draw on the screen (regardless of screen resolution, skin, | ||
| 104 | or any other user setting). While plugin developers lose some amount of control | ||
| 105 | over the presentation, they no longer have to make up their own UIs, or worry | ||
| 106 | about creating a usable look and feel across multiple displays. | ||
| 107 | |||
| 108 | Plugins are most commonly used to scrape websites for links to streaming videos, | ||
| 109 | displaying the video list in Kodi just like it would movie files on the local | ||
| 110 | hard drive, but a plugin can be used anywhere a script could, as long as the | ||
| 111 | menu structure is a sufficient GUI for the add-on's needs. | ||
| 112 | |||
| 113 | Also, note that a script can launch a plugin, and a plugin can launch a script | ||
| 114 | (and, for that matter, it can call all the same functions available to a script) | ||
| 115 | so the distinction is more theoretical than practical. | ||
| 116 | |||
| 117 | |||
| 118 | @{ | ||
| 119 | \ingroup python | ||
| 120 | \defgroup python_xbmc Library - xbmc | ||
| 121 | |||
| 122 | \ingroup python | ||
| 123 | \defgroup python_xbmcgui Library - xbmcgui | ||
| 124 | |||
| 125 | \ingroup python | ||
| 126 | \defgroup python_xbmcplugin Library - xbmcplugin | ||
| 127 | |||
| 128 | \ingroup python | ||
| 129 | \defgroup python_xbmcaddon Library - xbmcaddon | ||
| 130 | |||
| 131 | \ingroup python | ||
| 132 | \defgroup python_xbmcvfs Library - xbmcvfs | ||
| 133 | |||
| 134 | \ingroup python | ||
| 135 | \defgroup python_xbmcwsgi Library - xbmcwsgi | ||
| 136 | @brief **Web Server Gateway Interface** | ||
| 137 | |||
| 138 | The [<b>Web Server Gateway Interface (WSGI)</b>](https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface) | ||
| 139 | is a specification for simple and universal interface between web servers and | ||
| 140 | web applications or frameworks for the Python programming language. | ||
| 141 | @} | ||
| 142 | |||
| 143 | */ | ||
| 144 | |||
| 145 | /*! | ||
| 146 | @page python_v12 Python API v12 | ||
| 147 | */ | ||
| 148 | /*! | ||
| 149 | @page python_v13 Python API v13 | ||
| 150 | */ | ||
| 151 | /*! | ||
| 152 | @page python_v14 Python API v14 | ||
| 153 | */ | ||
| 154 | /*! | ||
| 155 | @page python_v15 Python API v15 | ||
| 156 | */ | ||
| 157 | /*! | ||
| 158 | @page python_v16 Python API v16 | ||
| 159 | */ | ||
| 160 | /*! | ||
| 161 | @page python_v17 Python API v17 | ||
| 162 | */ | ||
| 163 | /*! | ||
| 164 | @page python_v18 Python API v18 | ||
| 165 | */ | ||
| 166 | |||
| 167 | /*! | ||
| 168 | @page python_revisions Python API Changes | ||
| 169 | @brief Overview of changes on Python API for Kodi | ||
| 170 | |||
| 171 | - @subpage python_v12 | ||
| 172 | - @subpage python_v13 | ||
| 173 | - @subpage python_v14 | ||
| 174 | - @subpage python_v15 | ||
| 175 | - @subpage python_v16 | ||
| 176 | - @subpage python_v17 | ||
| 177 | - @subpage python_v18 | ||
| 178 | +*/ | ||
| 179 | \ No newline at end of file | ||
