Skip to content

Commit

Permalink
Restructure project so GitHub zip files work out-of-the-box
Browse files Browse the repository at this point in the history
  • Loading branch information
dagwieers committed Mar 26, 2019
1 parent 11766eb commit a9ae74b
Show file tree
Hide file tree
Showing 36 changed files with 33 additions and 12 deletions.
22 changes: 10 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
ENVS := py27,py36

addon_xml = plugin.video.vrt.nu/addon.xml
addon_xml = addon.xml

# Collect information to build as sensible package name
name = $(shell xmllint --xpath 'string(/addon/@id)' $(addon_xml))
version = $(shell xmllint --xpath 'string(/addon/@version)' $(addon_xml))
git_hash = $(shell git rev-parse --short HEAD)

zip_name = $(name)-$(version)-$(git_hash).zip
exclude_files = $(name).pyproj vrtnutests/ vrtnutests/*
exclude_paths = $(patsubst %,$(name)/%,$(exclude_files))
include_files = LICENSE README.md
include_files = addon.py addon.xml LICENSE README.md resources/ service.py
include_paths = $(patsubst %,$(name)/%,$(include_files))
exclude_files = \*.new \*.orig
zip_dir = $(name)/

.PHONY: test
Expand All @@ -24,20 +24,18 @@ clean:

test: unittest
@echo -e "\e[1;37m=\e[1;34m Starting tests\e[0m"
pylint $(name)/*.py
pylint $(name)/resources/lib/*/*.py
pylint *.py
pylint resources/lib/*/*.py
tox -e $(ENVS)
@echo -e "\e[1;37m=\e[1;34m Tests finished successfully.\e[0m"

unittest:
@echo -e "\e[1;37m=\e[1;34m Starting unit tests\e[0m"
PYTHONPATH=$(name) python $(name)/vrtnutests/vrtplayertests.py
PYTHONPATH=$(pwd) python test/vrtplayertests.py
@echo -e "\e[1;37m=\e[1;34m Unit tests finished successfully.\e[0m"

zip: test clean
@echo -e "\e[1;37m=\e[1;34m Building new package\e[0m"
rm -f $(zip_name)
cp -v $(include_files) $(zip_dir)
zip -r $(zip_name) $(zip_dir) -x $(exclude_paths)
cd $(zip_dir); rm -vf $(include_files)
@echo -e "\e[1;37m=\e[1;34m Successfully wrote package as: \e[1;37m$(zip_name)\e[0m"
rm -f ../$(zip_name)
cd ..; zip -r $(zip_name) $(include_paths) -x $(exclude_files)
@echo -e "\e[1;37m=\e[1;34m Successfully wrote package as: \e[1;37m../$(zip_name)\e[0m"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def __init__(self):
self._subtitle = None
self._brands = None
self._geolocked = None
self._videoid = None
self._whatsonid = None

@property
def title(self):
Expand Down Expand Up @@ -153,6 +155,22 @@ def geolocked(self):
def geolocked(self, value):
self._geolocked = value

@property
def videoid(self):
return self._videoid

@videoid.setter
def videoid(self, value):
self._videoid = value

@property
def whatsonid(self):
return self._whatsonid

@whatsonid.setter
def whatsonid(self, value):
self._whatsonid = value

def get_video_dict(self):
video_dict = dict()

Expand Down Expand Up @@ -205,6 +223,11 @@ def get_video_dict(self):
if self.url:
video_dict['path'] = self.url

if self.whatsonid:
video_dict['dbid'] = self.whatsonid
#if self.videoid:
# video_dict['dbid'] = self.videoid

if self.brands:
# NOTE: Does not seem to have any effect
video_dict['channelname'] = self.brands[0] if isinstance(self.brands, list) else self.brands
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a9ae74b

Please sign in to comment.