Skip to content

Commit

Permalink
Release 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandmn committed Nov 21, 2020
1 parent 6c82af4 commit 86239f5
Show file tree
Hide file tree
Showing 1,055 changed files with 161,683 additions and 182 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.svn
.git
.idea
.svnignore
246 changes: 246 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
SHELL:=/bin/bash
ROOT=$(shell pwd)
NAME=$(shell basename $(ROOT))

ifndef VERBOSE
.SILENT:
endif

OUTDIR=
SYSDIR=sys
SRCDIR=src
RESDIR=res

ifeq ($(OUTPUT),)
export OUTPUT=$(ROOT)/../Clue-out
endif

ifeq ($(PUBLISH),)
export PUBLISH=~/AMSD/Web/clue/repos/addons
endif

OUTDIR=$(OUTPUT)/$(NAME)
DISTRO_VER=$(shell xmlstarlet sel -t -v "//addon/@version" $(ROOT)/$(SRCDIR)/addon.xml)
DISTRO_REL=$(shell echo "$(DISTRO_VER)" | cut -f1 -d".")
DISTRO_MAJ=$(shell echo "$(DISTRO_VER)" | cut -f2 -d".")
DISTRO_MIN=$(shell echo "$(DISTRO_VER)" | cut -f3 -d".")
NEXT_MIN=$(shell python -c "print int($(DISTRO_MIN)) + 1")
NEXT_VER="${DISTRO_REL}.${DISTRO_MAJ}.${NEXT_MIN}"


info:
echo -e "\tName: $(NAME)"
echo -e "\tVersion ID: $(DISTRO_VER)"
echo -e "\tPackage File: $(OUTPUT)/targets/$(NAME).zip"


# Deploy resources (sources and/or system files) into the remote test RPi device,
# having Kodi v18* or CLue 2.0 linux OS with all components and packages.
deploy:
ifneq ($(RPIHOST),)
ifeq ($(shell [[ -d $(ROOT)/$(SRCDIR) ]] && echo -n yes),yes)
/usr/bin/rsync -a -zvh --progress --delete -e ssh $(ROOT)/$(SRCDIR)/ root@$(RPIHOST):/clue/.kodi/addons/$(NAME)
endif
ifeq ($(shell [[ -d $(ROOT)/$(SYSDIR) ]] && echo -n yes),yes)
/usr/bin/scp -r $(ROOT)/$(SYSDIR)/* root@$(RPIHOST):/clue/
endif
else
echo "Your remote RPi device should have SSH service enabled, local public SSH key \
already shared and RPIHOST local variable setted up with the host name or \
IP address of the RPi device!"
endif


# Run testing process (for source files) for any remote host and location settled up
# using TESTPATH variable. IN case this variable is not set the test can be done
# for RPi host (identified by RPIHOST variable). Variable TESTPATH should have complete
# ssh location format: <user>@HOST/<base path>
test:
ifneq ($(TESTPATH),)
ifeq ($(shell [[ -d $(ROOT)/$(SRCDIR) ]] && echo -n yes),yes)
/usr/bin/rsync -a -zvh --progress --delete -e ssh $(ROOT)/$(SRCDIR)/ $(TESTPATH)/.kodi/addons/$(NAME)
endif
else
ifneq ($(RPIHOST),)
ifeq ($(shell [[ -d $(ROOT)/$(SRCDIR) ]] && echo -n yes),yes)
/usr/bin/rsync -a -zvh --progress --delete -e ssh $(ROOT)/$(SRCDIR)/ root@$(RPIHOST):/clue/.kodi/addons/$(NAME)
endif
else
echo "For testing process you have to set TESTPATH variable to test on any Kodi\
environment (syncronized over rsync with ssh) or RPIHOST variable to test on a RPi\
device. Test process suppose to synchronize only sourse files, system files can be\
tested using 'deploy' target - only on RPi devices!"
endif
endif

# Mark new revision (addon version) in the development copy
version:
xmlstarlet edit -L -P -u "//addon/@version" -v "$(NEXT_VER)" $(ROOT)/$(SRCDIR)/addon.xml


# Build addon package in deployment format
build:
mkdir -p $(OUTDIR) $(OUTDIR)/$(TARGETS)
cp -rf ${SRCDIR}/* $(OUTDIR)/
cp -rf LICENSE $(OUTDIR)/
cd $(OUTPUT) && /usr/bin/zip -q -y -r $(NAME).zip $(NAME) && cd $(ROOT)
mv -f $(OUTPUT)/$(NAME).zip $(OUTPUT)/targets/$(NAME).zip


# Publish the last build in the addon repository
publish:
ifeq ($(shell [[ -f $(OUTPUT)/targets/$(NAME).zip ]] && echo -n yes),yes)
ifneq ($(PUBLISH),)
# deploy package resources, rebuild repository descriptor
ifeq ($(shell [[ -f $(PUBLISH)/addons.xml ]] && echo -n yes),yes)
# define location and copy meta files
$(shell [[ ! -d $(PUBLISH)/$(NAME) ]] && mkdir $(PUBLISH)/$(NAME))
cp -f $(ROOT)/$(SRCDIR)/addon.xml $(PUBLISH)/$(NAME)/
$(shell [[ -f $(ROOT)/$(SRCDIR)/icon.png ]] && cp -f $(ROOT)/$(SRCDIR)/icon.png $(PUBLISH)/$(NAME)/)
$(shell [[ -f $(ROOT)/$(SRCDIR)/fanart.jpg ]] && cp -f $(ROOT)/$(SRCDIR)/fanart.jpg $(PUBLISH)/$(NAME)/)
$(shell [[ -f $(ROOT)/$(SRCDIR)/changelog.txt ]] && cp -f $(ROOT)/$(SRCDIR)/changelog.txt $(PUBLISH)/$(NAME)/)
cp -f $(OUTPUT)/targets/$(NAME).zip $(PUBLISH)/$(NAME)/$(NAME)-$(DISTRO_VER).zip
sha256sum $(PUBLISH)/$(NAME)/$(NAME)-$(DISTRO_VER).zip > $(PUBLISH)/$(NAME)/$(NAME)-$(DISTRO_VER).zip.sha256
python $(PUBLISH)/xmlgen.py
else
echo "Repository location described by PUBLISH variable is not correct (doesn't \
contain the expected structure and remote resources)!"
endif
else
echo "Repository location is not specified in PUBLISH variable. Set it up and try again!"
endif
else
echo "Repository location is not specified in PUBLISH variable. Set it up and try again!"
endif


# Commit and push updated files into versioning system (GitHUB). The 'message' input
# parameter is required.
gitrev:
ifneq ($(message),)
git add .
git commit -m "$(message)"
git push
else
@printf "\n* Please specify 'message' parameter!\n\n"
exit 1
endif



# Create and push a new versioning tag equals with the addon release. The uploaded can be
# done later - manually or through a separate task and thus the tag is transformed into a
# addon release
gitrel:
git tag "$(DISTRO_VER)"
git push origin --tags

# Combine git commit and git release tasks into a single one, the only exception is that
# the commit doesn't require a message, if the message exist it will be used, if not a
# standard commit message will be composed using the addon version number
git:
ifeq ($(message),)
$(MAKE) gitrev -e message="Release $(DISTRO_VER)"
else
$(MAKE) gitrev
endif
$(MAKE) gitrel


# Create a complete release: new build, publish it in the repository, update the versioning
release: version build publish git


# Clean-up the release
clean:
rm -rf $(OUTDIR)


# Clean-up all build distributions, cache and stamps
cleanall:
rm -rf $(OUTDIR)/* $(OUTDIR)/.stamp $(OUTDIR)/.ccache


# Display the help text
help:
echo -e "\
\nSYNOPSIS\n\
make info | deploy | test \n\
version | build | publish | release \n\
make gitrev | gittag | version \n\
make clean | cleanall \n\
make help \n\
\nDESCRIPTION\n\
Executes one of the make targets defined through this Makefile flow, according \n\
to the scope of this project.\n\n\
info\n\
provides main details about current release: package name, version id\n\
and package file (should be found after execution of 'build' target)\n\
>> this is the default target wihin the CCM process\n\
deploy\n\
deploys addon resources (sources and system files) on a remote test system\n\
(RPi device described by RPIHOST variable)\n\
test\n\
runs testing process (for source files) for any remote host and location \n\
settled up using TESTPATH variable. In case this variable is not set the \n\
test can be done for RPi host (identified by RPIHOST variable).\n\
version\n\
create local new version within local addon descriptor (addon.xml),\n\
the new version being the incremented value fo previous version\n\
(for the minor version number)\n\
build\n\
build the addon package along to the new version and prepare the release\n\
package file within location $(OUTPUT)/targets/$(NAME).zip\n\
publish\n\
install/publish the addon (already built) on the repository file\n\
system (it has to be already mounted to the development environment)\n\
release\n\
Build the addon providing new local version, make release and publish it\n\
on the Clue repository (already mounted to the local file system). Then\n\
the released version is submitted in the versioning system (GitHUB) over a\n\
new release tag version\n\
gitrev\n\
Commit the new release changes into versioning repository (GitHub)\n\
gitrel\n\
Create a new release tag into versioning repository (GitHub) using current\n\
addon version (defined in the addon descriptor - addon.xml file)\n\
git\n\
Combine git commit and git release targets into a single one, the only exception\n\
is that the commit doesn't require a message description; in case the message exist\n\
it will be used as such, otherwise a standard commit message will be composed using\n\
the addon version number\n\
clean\n\
cleanup the build resources within the output location\n\
cleanall\n\
Clean-up all resources from the output location (related or nor directly\n\
connected to the addon build process\n\
help\n\
Shows this text\n\
\n\
There are couple of system variables that should be be set in order to drive the execution\n\
of particular tasks:\n\
PUBLISH\n\
Indicates the remote file system mounted to the local development environment,\n\
in order to deploy releases in the repository container.\n\
OUTPUT\n\
Describes the local file system location where the build process will be \n\
executed. Default value is '$(ROOT)/../Clue-out'\n\
RPIHOST\n\
Indicates the host name or the IP address of the test system in order to deploy\n\
addon resources through deploy or test task. The remote system should have SSH\n\
service enabled and active.\n\
TESTPATH\n\
Describes the remote location for testing purposes. It should contain complete \n\
ssh location format: <user>@HOST/<base path>\n\
\n\
EXAMPLES\n\
deploy the entire distribution on a testing environment ('deploy' task is default)\n\
> make\n\
> make deploy\n\n\
build the entire distribution ('build' make task is default)\n\
> make build\n\n\
publish new release in the addon repository\n\
> make publish\n\n\
make complete addon release: build it, publish it and commit the changes on GitHub\n\
> make release\n\n\
" | more
64 changes: 42 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# Clue Weather for MCPi and/or Kodi
# Clue Weather for Kodi

**Clue Weather** package is designed to become main weather plugin for
MCPi and an alternative weather add-on for Kodi. The package comes with
two content providers the default one being **OpenWeatherMap** and the
secondary one is **Dark Sky**. Additionally, can be developed and plugged
_Kodi_ within **Clue** system or an alternative weather add-on for any _Kodi_
instance. The package comes with three content providers the default one being
**Yahoo**, alternatively might be used **OpenWeatherMap** and the last one is
**Dark Sky** weather provider. Additionally, can be developed and plugged
other sources using built-in plugin object model (see `ContentProvider` class
definition).

Below are described the main skin properties published by the content provides
through their lifecycle.
Development, testing and deployment activities are driven by CCM process (Clue
Configuration Management), built over GNU `make` utility. To see all make rules
try `make help`.

_Enjoy!_


## Details for Skinners or Plugin Developers

All values returned by the addon will include their units.
Below are described the main skin properties published by the content provides
through the addon execution flow. All values returned by the addon will include
their units.


### Weather Labels
Expand All @@ -38,6 +45,12 @@ All values returned by the addon will include their units.
* Current.OutlookIcon
* Current.Visibility

* Forecast.City
* Forecast.Country
* Forecast.Latitude
* Forecast.Longitude
* Forecast.Updated

#### Today

* Today.IsFetched
Expand All @@ -48,21 +61,28 @@ All values returned by the addon will include their units.

#### Day [0-6]

* Day.%i.IsFetched
* Day.%i.Title
* Day.%i.HighTemp
* Day.%i.LowTemp
* Day.%i.Outlook
* Day.%i.OutlookIcon
* Day.%i.FanartCode
* Day.%i.WindSpeed
* Day.%i.WindDirection
* Day.%i.Humidity
* Day.%i.DewPoint
* Day.%i.UVIndex
* Day.%i.Visibility
* Day.%i.HighTemperature
* Day.%i.LowTemperature
Day%i.Title
Day%i.HighTemp
Day%i.LowTemp
Day%i.Outlook
Day%i.OutlookIcon
Day%i.FanartCode

* Daily.%i.IsFetched
* Daily.%i.Title
* Daily.%i.HighTemp
* Daily.%i.LowTemp
* Daily.%i.Outlook
* Daily.%i.OutlookIcon
* Daily.%i.FanartCode
* Daily.%i.WindSpeed
* Daily.%i.WindDirection
* Daily.%i.Humidity
* Daily.%i.DewPoint
* Daily.%i.UVIndex
* Daily.%i.Visibility
* Daily.%i.HighTemperature
* Daily.%i.LowTemperature


#### Hourly[0-16]
Expand Down
Binary file added res/yahoo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions src/addon.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="weather.clue" version="1.4.7" name="Clue Weather" provider-name="AMSD">
<addon id="weather.clue" version="2.0.1" name="Clue Weather" provider-name="AMSD">
<requires>
<import addon="xbmc.python" version="2.20.0"/>
<import addon="module.clue" version="1.4.1"/>
<import addon="xbmc.python" version="2.25.0"/>
<import addon="module.clue" version="2.0.0"/>
</requires>
<extension point="xbmc.python.weather" library="default.py"/>
<extension point="xbmc.addon.metadata">
<summary lang="en">Clue Weather for MCPi</summary>
<description lang="en">Weather service for Clue MCPi or Kodi, providing weather forecast content from various providers</description>
<summary lang="en">Clue Weather for Kodi</summary>
<description lang="en">Weather service for Clue and Kodi, providing weather forecast content from Yahoo, OpenWeatherMap and Dark Sky weather providers</description>
</extension>
</addon>
4 changes: 4 additions & 0 deletions src/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v2.0
- Implementation of Yahoo provider
- Migrate addon to Python3

v1.4
- Adapt addon configuration and the logic behind
- Implementation of DarkSky new provider
Expand Down
2 changes: 1 addition & 1 deletion src/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def setLocation(self, config):
commons.debug("Setting new location (%s)" %config)
provider = self.getProviderByCode(commons.getAddonSetting('Provider'))
if provider is None:
raise StandardError("No content provider selected for configuration")
raise RuntimeError("No content provider selected for configuration")
inputval = commons.StringInputDialog(14024, commons.getAddonSetting(config + "Action"))
if inputval is not None and inputval != '':
locnames, locids = provider.location(inputval)
Expand Down
Binary file added src/resources/media/yahoo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 86239f5

Please sign in to comment.