summaryrefslogtreecommitdiff
path: root/plugin.video.mlbtv/resources
diff options
context:
space:
mode:
authoreracknaphobia <eracknaphobia@hotmail.com>2017-04-04 18:30:50 -0400
committerenen92 <enen92@users.noreply.github.com>2017-04-04 23:30:50 +0100
commit589caec2fda22c104d3341eb685b9e9270b7b2bf (patch)
tree3ee3511f0bc4219449bec1a75f58ec6d0ad47223 /plugin.video.mlbtv/resources
parentfb03a9c73debfb78ae6a3717b4677cd455a4c37b (diff)
[plugin.video.mlbtv] 2017.4.2 (#1105)
* [plugin.video.mlbtv] 2017.4.2 * [plugin.video.mlbtv] 2017.4.2
Diffstat (limited to 'plugin.video.mlbtv/resources')
-rw-r--r--plugin.video.mlbtv/resources/language/resource.language.en_gb/strings.po24
-rw-r--r--plugin.video.mlbtv/resources/lib/globals.py27
-rw-r--r--plugin.video.mlbtv/resources/settings.xml8
3 files changed, 49 insertions, 10 deletions
diff --git a/plugin.video.mlbtv/resources/language/resource.language.en_gb/strings.po b/plugin.video.mlbtv/resources/language/resource.language.en_gb/strings.po
index a2538c2..46d5ecf 100644
--- a/plugin.video.mlbtv/resources/language/resource.language.en_gb/strings.po
+++ b/plugin.video.mlbtv/resources/language/resource.language.en_gb/strings.po
@@ -98,4 +98,28 @@ msgstr ""
msgctxt "#700"
msgid "Sports"
+msgstr ""
+
+msgctxt "#30200"
+msgid "Proxy Settings"
+msgstr ""
+
+msgctxt "#30210"
+msgid "Enabled"
+msgstr ""
+
+msgctxt "#30220"
+msgid "Server"
+msgstr ""
+
+msgctxt "#30230"
+msgid "Port"
+msgstr ""
+
+msgctxt "#30240"
+msgid "Username"
+msgstr ""
+
+msgctxt "#30250"
+msgid "Password"
msgstr "" \ No newline at end of file
diff --git a/plugin.video.mlbtv/resources/lib/globals.py b/plugin.video.mlbtv/resources/lib/globals.py
index cd47c53..15d15a3 100644
--- a/plugin.video.mlbtv/resources/lib/globals.py
+++ b/plugin.video.mlbtv/resources/lib/globals.py
@@ -12,7 +12,7 @@ import math
from bs4 import BeautifulSoup
from datetime import date, datetime, timedelta
from urllib2 import URLError, HTTPError
-from PIL import Image
+#from PIL import Image
from cStringIO import StringIO
@@ -27,7 +27,7 @@ ADDON_PATH = xbmc.translatePath(ADDON.getAddonInfo('path'))
ADDON_PATH_PROFILE = xbmc.translatePath(ADDON.getAddonInfo('profile'))
XBMC_VERSION = float(re.findall(r'\d{2}\.\d{1}', xbmc.getInfoLabel("System.BuildVersion"))[0])
LOCAL_STRING = ADDON.getLocalizedString
-ROOTDIR = xbmcaddon.Addon(id='plugin.video.mlbtv').getAddonInfo('path')
+ROOTDIR = ADDON.getAddonInfo('path')
#Settings
settings = xbmcaddon.Addon(id='plugin.video.mlbtv')
@@ -42,7 +42,12 @@ FAV_TEAM = str(settings.getSetting(id="fav_team"))
TEAM_NAMES = settings.getSetting(id="team_names")
TIME_FORMAT = settings.getSetting(id="time_format")
SINGLE_TEAM = str(settings.getSetting(id='single_team'))
-
+#Proxy Settings
+PROXY_ENABLED = str(settings.getSetting(id='use_proxy'))
+PROXY_SERVER = str(settings.getSetting(id='proxy_server'))
+PROXY_PORT = str(settings.getSetting(id='proxy_port'))
+PROXY_USER = str(settings.getSetting(id='proxy_user'))
+PROXY_PWD = str(settings.getSetting(id='proxy_pwd'))
#Colors
SCORE_COLOR = 'FF00B7EB'
@@ -60,10 +65,10 @@ FREE = 'FF43CD80'
#Images
-ICON = ROOTDIR+"/icon.png"
-FANART = ROOTDIR+"/fanart.jpg"
-PREV_ICON = ROOTDIR+"/icon.png"
-NEXT_ICON = ROOTDIR+"/icon.png"
+ICON = os.path.join(ROOTDIR,"icon.png")
+FANART = os.path.join(ROOTDIR,"fanart.jpg")
+PREV_ICON = os.path.join(ROOTDIR,"icon.png")
+NEXT_ICON = os.path.join(ROOTDIR,"icon.png")
if SINGLE_TEAM == 'true':
MASTER_FILE_TYPE = 'master_wired.m3u8'
@@ -95,9 +100,11 @@ def find(source,start_str,end_str):
else:
return ''
+
def getGameIcon(home,away):
#Check if game image already exists
- image_path = ROOTDIR+'/resources/images/'+away+'vs'+home+'.png'
+ #image_path = ROOTDIR+'/resources/images/'+away+'vs'+home+'.png'
+ image_path = os.path.join(ROOTDIR,'resources/images/'+away+'vs'+home+'.png')
file_name = os.path.join(image_path)
if not os.path.isfile(file_name):
try:
@@ -113,14 +120,14 @@ def createGameIcon(home,away,image_path):
bg = Image.new('RGB', (500,250), (0,0,0))
#http://mlb.mlb.com/mlb/images/devices/240x240/110.png
#img_file = urllib.urlopen('http://mlb.mlb.com/mlb/images/devices/76x76/'+home+'.png ')
- img_file = urllib.urlopen('http://mlb.mlb.com/mlb/images/devices/240x240/'+home+'.png ')
+ img_file = urllib.urlopen('http://mlb.mlb.com/mlb/images/devices/240x240/'+home+'.png')
im = StringIO(img_file.read())
home_image = Image.open(im)
#bg.paste(home_image, (267,74), home_image)
bg.paste(home_image, (255,5), home_image)
#img_file = urllib.urlopen('http://mlb.mlb.com/mlb/images/devices/76x76/'+away+'.png ')
- img_file = urllib.urlopen('http://mlb.mlb.com/mlb/images/devices/240x240/'+away+'.png ')
+ img_file = urllib.urlopen('http://mlb.mlb.com/mlb/images/devices/240x240/'+away+'.png')
im = StringIO(img_file.read())
away_image = Image.open(im)
#bg.paste(away_image, (57,74), away_image)
diff --git a/plugin.video.mlbtv/resources/settings.xml b/plugin.video.mlbtv/resources/settings.xml
index 2b6512b..f579877 100644
--- a/plugin.video.mlbtv/resources/settings.xml
+++ b/plugin.video.mlbtv/resources/settings.xml
@@ -23,5 +23,13 @@
<setting id="old_username" type="text" label="" default="" visible="false"/>
<setting id="old_password" type="text" label="" default="" visible="false"/>
</category>
+ <!--Proxy-->
+ <category label='30200'>
+ <setting id='use_proxy' type='bool' label='30210' default='false'/>
+ <setting id='proxy_server' type='text' label='30220' default=''/>
+ <setting id='proxy_port' type='number' label='30230' default=''/>
+ <setting id='proxy_user' type='text' label='30240' default=''/>
+ <setting id='proxy_pwd' type='text' label='30250' option='hidden' default=''/>
+ </category>
</settings>