Skip to content

Commit 685b786

Browse files
committed
Refactor addon structure
1 parent 096f4cc commit 685b786

File tree

13 files changed

+26
-32
lines changed

13 files changed

+26
-32
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ python:
1010
sudo: false
1111

1212
env:
13-
PYTHONPATH: lib:test
13+
PYTHONPATH: resources/lib:test
1414
PYTHONIOENCODING: utf-8
1515

1616
install:
@@ -19,12 +19,12 @@ install:
1919
script:
2020
- tox
2121
- tox -e flake8
22-
- pylint lib/ test/
22+
- pylint resources/lib/ test/
2323
#- kodi-addon-checker . --branch=krypton
2424
#- kodi-addon-checker . --branch=leia
2525
- proxy.py &
2626
- coverage run -m unittest discover
27-
- coverage run -a default.py
27+
- coverage run -a resources/lib/default.py
2828

2929
after_success:
3030
- codecov

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export PYTHONPATH := $(CURDIR)/lib:$(CURDIR)/test
1+
export PYTHONPATH := $(CURDIR)/resources/lib:$(CURDIR)/test
22
PYTHON := python
33

44
name = $(shell xmllint --xpath 'string(/addon/@id)' addon.xml)
@@ -7,7 +7,7 @@ git_branch = $(shell git rev-parse --abbrev-ref HEAD)
77
git_hash = $(shell git rev-parse --short HEAD)
88

99
zip_name = $(name)-$(version)-$(git_branch)-$(git_hash).zip
10-
include_files = addon.xml changelog.txt default.py LICENSE.txt README.md lib/ resources/
10+
include_files = addon.xml changelog.txt default.py LICENSE.txt README.md resources/
1111
include_paths = $(patsubst %,$(name)/%,$(include_files))
1212
exclude_files = \*.new \*.orig \*.pyc \*.pyo
1313
zip_dir = $(name)/
@@ -34,7 +34,7 @@ tox:
3434

3535
pylint:
3636
@echo -e "$(white)=$(blue) Starting sanity pylint test$(reset)"
37-
$(PYTHON) -m pylint -e useless-suppression lib/ test/
37+
$(PYTHON) -m pylint -e useless-suppression resources/lib/ test/
3838

3939
language:
4040
@echo -e "$(white)=$(blue) Starting language test$(reset)"

addon.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<import addon="script.module.pysocks" version="1.6.8" optional="true"/>
66
</requires>
77
<!-- This is needed to get an addon icon -->
8-
<extension point="xbmc.python.script" library="default.py">
8+
<extension point="xbmc.python.script" library="resources/lib/default.py">
99
<provides>executable</provides>
1010
</extension>
11-
<extension point="xbmc.python.module" library="lib"/>
11+
<extension point="xbmc.python.module" library="resources/lib"/>
1212
<extension point="xbmc.addon.metadata">
1313
<summary lang="en_GB">Kodi InputStream and DRM playback made easy</summary>
1414
<summary lang="de_DE">Kodi InputStream und DRM Wiedergabe einfach gemacht</summary>

default.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

lib/__init__.py

Whitespace-only changes.

resources/lib/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# -*- coding: utf-8 -*-
2+
# MIT License (see LICENSE.txt or https://opensource.org/licenses/MIT)
3+
"""InputStream Helper package"""
4+
__all__ = ['inputstreamhelper']

resources/lib/default.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# -*- coding: utf-8 -*-
2+
"""This is the actual InputStream Helper API script entry point"""
3+
4+
from __future__ import absolute_import, division, unicode_literals
5+
import sys
6+
from inputstreamhelper.api import run
7+
8+
9+
run(sys.argv)
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)