Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Commit bd7663f

Browse files
committed
update docs
1 parent b8443b0 commit bd7663f

File tree

6 files changed

+47
-25
lines changed

6 files changed

+47
-25
lines changed

docs/api/index.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
API
22
===
33

4-
fhfghfghfgh
5-
fdghfdghdfghdfgh
6-
dfg
7-
h
8-
fdgh
9-
dfghdfghfdghfdhgfdh
4+
Table of Contents.
105

116
.. toctree::
127
:maxdepth: 1

docs/index.rst

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
1-
.. CodeQuick documentation master file, created by
2-
sphinx-quickstart on Sun Aug 6 02:34:34 2017.
3-
You can adapt this file completely to your liking, but it should at least
4-
contain the root `toctree` directive.
5-
61
============
72
Introduction
83
============
9-
sdasdfasf asdf asfd asdf asdf asdf asdf asdf asdf
4+
Codequick is a framework for kodi add-on's. The goal of this framework is to simplify add-on development.
5+
This is achieved by reducing the amount of boilerplate code to a minimum, automating tasks like route dispatching
6+
and sort method selection. Ultimately allowing the developer to focus primarily on scraping content from websites
7+
and passing it to kodi.
8+
9+
This framework utilizes 3 other kodi modules.
10+
* urlquick: https://github.com/willforde/urlquick
11+
* htmlement: https://github.com/willforde/python-htmlement
12+
* youtube.dl: https://forum.kodi.tv/showthread.php?tid=200877
13+
14+
Urlquick is a light-weight http client with requests like interface.
15+
Featuring persistent connections and caching support.
16+
17+
Htmlement is a pure-python HTML parser which aims to be faster than beautifulsoup.
18+
And like beautifulsoup, it will also parse invalid html.
19+
Parsing is then achieved by utilizing ElementTree with XPath expressions.
20+
21+
Youtube-dl is a video downloader written in python and released in the public domain.
22+
It supports 270+ sites and is updated frequently. Can be used to parse video sources and forward them to kodi.
23+
1024

1125
Contents
1226
========

docs/tutorial.rst

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
########
22
Tutorial
33
########
4-
sdasdfasf asdf asfd asdf asdf asdf asdf asdf asdf
5-
ghjghjghjghj
6-
ghj
7-
gh
8-
jgh
9-
jghjgjh
4+
Here we will document the creation of an add-on.
5+
In this case, plugin.video.metalvideo. This will be a simplifyed version of the full add-on
6+
witch can be found @ https://github.com/willforde/plugin.video.metalvideo
7+
8+
First thing is to import the required codequick components.
9+
10+
* ``Route`` will be used to list folder items.
11+
* ``Resolver`` will be used to resolve video urls.
12+
* ``Listitem`` is used to create items within kodi.
13+
* ``run`` is the function that controls the execution of the add-on.
14+
15+
.. code-block:: python
16+
17+
from codequick import Route, Resolver, Listitem, run
18+
19+
20+
Next we will create the root function that will be the starting point for the add-on.
21+
It is very important that the root function is called 'root'.
22+
23+
The root function will have to be registered so codequick can find it.

script.module.codequick/lib/codequick/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@
2121
start_time = __import__("time").time()
2222

2323
# Package imports
24-
from codequick.storage import PersistentDict, PersistentList
25-
from codequick.support import dispatcher as _dispatcher
24+
from codequick.support import run
2625
from codequick.resolver import Resolver
2726
from codequick.listing import Listitem
2827
from codequick.script import Script
2928
from codequick.route import Route
30-
from codequick import utils
31-
32-
# Convenience function to call dispatcher
33-
run = _dispatcher.dispatch
29+
from codequick import utils, storage

script.module.codequick/lib/codequick/script.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def register_metacall(func, *args, **kwargs):
183183
dispatcher.metacalls.append(callback)
184184

185185
@staticmethod
186-
def log(msg, args, lvl=10):
186+
def log(msg, args=None, lvl=10):
187187
"""
188188
Logs a message with logging level of 'lvl'.
189189
@@ -326,6 +326,8 @@ def request(self):
326326
>>> def root(plugin):
327327
>>> html = plugin.request.get("http://example.com/index.html")
328328
>>> root_element = html.parse()
329+
>>> print(root_element)
330+
>>> "xml.etree.ElementTree.Element"
329331
"""
330332
return urlquick.Session()
331333

script.module.codequick/lib/codequick/support.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,3 +365,4 @@ def build_path(path=None, query=None, **extra_query):
365365

366366
# Dispatcher to manage route callbacks
367367
dispatcher = Dispatcher()
368+
run = dispatcher.dispatch

0 commit comments

Comments
 (0)