- getSeason() only for staff members
- new view staff() - updated bootstrap to version 3.4.1 - updated jquery to 3.6.3 - changed container layout in main view 'matchday'
This commit is contained in:
@@ -18,25 +18,25 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with TipPy. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
import sys
|
||||
import locale
|
||||
from suds.client import Client
|
||||
import urllib.request
|
||||
import urllib.error
|
||||
import urllib.parse
|
||||
import psycopg2
|
||||
import urllib.request
|
||||
|
||||
from suds.client import Client
|
||||
|
||||
|
||||
class OpenLiga(object):
|
||||
version = "0.1"
|
||||
error = ""
|
||||
proxyurl = None
|
||||
debug = None
|
||||
client = None
|
||||
version = "0.1"
|
||||
error = ""
|
||||
proxyurl = None
|
||||
debug = None
|
||||
client = None
|
||||
|
||||
def __init__(self, proxyurl=None, debug=False):
|
||||
|
||||
# set locale to environment (for dispaying localized dates)
|
||||
locale.setlocale(locale.LC_TIME, "")
|
||||
locale.setlocale(locale.LC_TIME, "")
|
||||
|
||||
self.debug = debug
|
||||
|
||||
@@ -44,30 +44,30 @@ class OpenLiga(object):
|
||||
if self.proxyurl is None:
|
||||
try:
|
||||
self.client = Client(
|
||||
'http://www.openligadb.de/'
|
||||
+ 'Webservices/Sportsdata.asmx?WSDL')
|
||||
except (urllib.error.URLError):
|
||||
'http://www.openligadb.de/'
|
||||
+ 'Webservices/Sportsdata.asmx?WSDL')
|
||||
except (urllib.error.URLError):
|
||||
self.error += "Connect to webservice failed."
|
||||
else:
|
||||
try:
|
||||
t = suds.transport.http.HttpTransport()
|
||||
proxy = urllib.request.ProxyHandler({'http':proxyurl})
|
||||
proxy = urllib.request.ProxyHandler({'http': proxyurl})
|
||||
opener = urllib.request.build_opener(proxy)
|
||||
t.urlopener = opener
|
||||
self.client = suds.client.Client(
|
||||
'http://www.openligadb.de/Webservices/'
|
||||
+ 'Sportsdata.asmx?WSDL', transport=t)
|
||||
except urllib.error.URLError as e:
|
||||
'http://www.openligadb.de/Webservices/'
|
||||
+ 'Sportsdata.asmx?WSDL', transport=t)
|
||||
except urllib.error.URLError as e:
|
||||
self.error += "Connect to webservice failed " \
|
||||
+ "(via proxy " + proxyurl + "): " + str(e) + "\n"
|
||||
+ "(via proxy " + proxyurl + "): " + str(e) + "\n"
|
||||
|
||||
def getSeason(self, season, league='bl1'):
|
||||
""" Get the whole season.
|
||||
|
||||
Args: season and league shortcut (optional)
|
||||
"""
|
||||
return(self.client.service.GetMatchdataByLeagueSaison(
|
||||
leagueShortcut=league,leagueSaison=season)
|
||||
return (self.client.service.GetMatchdataByLeagueSaison(
|
||||
leagueShortcut=league, leagueSaison=season)
|
||||
)
|
||||
|
||||
def getMatchday(self, season, matchdaynumber, league='bl1'):
|
||||
@@ -75,22 +75,19 @@ class OpenLiga(object):
|
||||
|
||||
Args: season, matchdaynumber and league shortcut (optional)
|
||||
"""
|
||||
return(self.client.service.GetMatchdataByGroupLeagueSaison(
|
||||
return (self.client.service.GetMatchdataByGroupLeagueSaison(
|
||||
groupOrderID=matchdaynumber,
|
||||
leagueShortcut=league,
|
||||
leagueSaison=season)
|
||||
)
|
||||
|
||||
def getTeams(self, season, league='bl1'):
|
||||
return(self.client.service.GetTeamsByLeagueSaison(
|
||||
return (self.client.service.GetTeamsByLeagueSaison(
|
||||
leagueShortcut=league,
|
||||
leagueSaison=season)
|
||||
)
|
||||
|
||||
def getCurrentGroup(self, league):
|
||||
return(self.client.service.GetCurrentGroup(
|
||||
return (self.client.service.GetCurrentGroup(
|
||||
leagueShortcut=league)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user