summaryrefslogtreecommitdiff
path: root/plugin.video.mlbtv/resources/lib/globals.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugin.video.mlbtv/resources/lib/globals.py')
-rw-r--r--plugin.video.mlbtv/resources/lib/globals.py27
1 files changed, 17 insertions, 10 deletions
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)