Skip to content

Commit

Permalink
backing up
Browse files Browse the repository at this point in the history
  • Loading branch information
elParaguayo committed Jan 6, 2015
1 parent b903aed commit d595b0d
Show file tree
Hide file tree
Showing 18 changed files with 1,488 additions and 1,139 deletions.
674 changes: 674 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="service.bbclivefootballscores"
name="BBC Football Scores"
version="0.1.1"
version="0.1.2"
provider-name="elParaguayo">
<requires>
<import addon="xbmc.addon" version="12.0.0"/>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.beautifulsoup" version="3.2.1"/>
<import addon="script.module.simplejson" version="2.0.10" />
<import addon="script.module.pyxbmct" version="1.1.4"/>
</requires>
<extension point="xbmc.service" library="default.py" start="login"/>
<extension point="xbmc.addon.metadata">

<platform>all</platform>
<summary lang="en">Provides live football score updates</summary>
<language></language>
<license>GNU GENERAL PUBLIC LICENSE. Version 3, 29 June 2007</license>
<forum>http://forum.kodi.tv/showthread.php?tid=196499</forum>
<source>https://github.com/elParaguayo/service.bbclivefootballscores</source>
<email></email>
<disclaimer lang="en"></disclaimer>
</extension>
</addon>
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
v0.1.2
- Trying to make Kodi compatible structure so can be installed from zip file
- Fixed import requirements
- Added additional functionality
- League table
- Match detail
18 changes: 15 additions & 3 deletions default.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def debug(msg):
msg: debug message to send to XBMC log
'''

xbmc.log(msg,xbmc.LOGDEBUG)
xbmc.log(u"bbclivefootballscores: {}".format(msg),xbmc.LOGDEBUG)

def getSelectedLeagues():
'''Returns list of leagues selected by user in settings file.'''
Expand Down Expand Up @@ -169,7 +169,7 @@ def checkMatch(match):

# Gooooooooooooooooooooooooooooollllllllllllllll!
Notify("GOAL!", str(match), IMG_GOAL)
print "GOAL: %s" % (match)
debug("GOAL: %s" % (match))

# Has the status changed? e.g. kick-off, half-time, full-time?
if match.StatusChanged:
Expand All @@ -179,7 +179,7 @@ def checkMatch(match):

# Send the notification
Notify(info[0], str(match), info[1])
print "STATUS: %s" % (match)
debug("STATUS: %s" % (match))

def doUpdates(matchdict):
'''Main function to updated leagues and check matches for updates.
Expand All @@ -190,18 +190,27 @@ def doUpdates(matchdict):
Returns updated dictionary
'''

ticker = u""

# Loop through each league that we're following
for league in matchdict:


# Get the league to update each match
matchdict[league].Update()

ticker += u"[B]{}[/B]: ".format(matchdict[league].LeagueName)
ticker += u", ".join(unicode(m) for m in matchdict[league].LeagueMatches)

# Loop through the matches
for match in matchdict[league].LeagueMatches:

# and check it for updates
checkMatch(match)

debug(ticker)
xbmc.executebuiltin(u"skin.setstring(tickertext,{})".format(ticker))

# Return the updated dicitonary object
return matchdict

Expand All @@ -211,6 +220,7 @@ def doUpdates(matchdict):

# Build dictionary of leagues we want to follow
matchdict = updateWatchedLeagues({}, getSelectedLeagues())
debug("LeagueList - {}".format(matchdict))

# Check if we need to show alerts or not.
alerts = checkAlerts()
Expand All @@ -219,6 +229,7 @@ def doUpdates(matchdict):
i = 0

# Main service loop - need to exit script cleanly if XBMC is shutting down
debug("Entering main loop...")
while not xbmc.abortRequested:

# 5 seconds before we do main update, let's check and see if there are any
Expand All @@ -232,6 +243,7 @@ def doUpdates(matchdict):
if alerts and not i:

# Update our match dictionary and check for updates.
debug("Checking scores...")
matchdict = doUpdates(matchdict)

# Sleep for 5 seconds (if this is longer, XBMC may not shut down cleanly.)
Expand Down
Binary file added fanart.jpg
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 d595b0d

Please sign in to comment.