Code: Alles auswählen
blob = {
'id': unicode('SP.%s.%s' % (i, category)),
'tvshow': unicode(data.tvshowname),
'staffel': unicode(data.staffel),
'episode': unicode(data.episode),
'title': unicode(data.title),
'starttime': unicode(data.tvshowstarttime),
'date': unicode(data.date),
'neueepisode': unicode(data.neueepisode),
'channel': unicode(data.channel),
'pvrchannel': unicode(channel),
'logo': unicode(logoURL),
'pvrid': unicode(pvrchannelID),
'description': unicode(details.plot),
'rating': unicode(details.rating),
'content_rating': unicode(details.content_rating),
'genre': unicode(details.genre),
'studio': unicode(details.studio),
'status': unicode(details.status),
'year': unicode(details.year),
'thumb': unicode(thumbpath),
'firstaired': unicode(details.firstaired),
'runtime': unicode(data.runtime),
'poster': unicode(details.posterUrl),
'category': unicode(category),
}
conn = sqlite3.connect(SerienPlaner)
cur = conn.cursor()
cur.execute("""CREATE TABLE IF NOT EXISTS TVShowData(
Watchtype,
Date,
StartTime,
Channel,
TVShow,
Season,
Episode,
Title,
newEpisode,
Description,
Rating,
ContentRating,
Genre,
Studio,
Status,
Year,
FirstAired,
RunningTime,
Thumb,
Poster,
ChannelID,
ChannelLogo,
UNIQUE(Date, StartTime, Channel)
ON CONFLICT REPLACE);""")
sql_command = """INSERT INTO TVShowData(
Watchtype,
Date,
StartTime,
Channel,
TVShow,
Season,
Episode,
Title,
newEpisode,
Description,
Rating,
ContentRating,
Genre,
Studio,
Status,
Year,
FirstAired,
RunningTime,
Thumb,
Poster,
ChannelID,
ChannelLogo) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""";
cur.execute(sql_command, (SPTranslations[blob['category']], blob['date'], blob['starttime'], blob['pvrchannel'], blob['tvshow'], blob['staffel'], blob['episode'], blob['title'], blob['neueepisode'], blob['description'], blob['rating'], blob['content_rating'], blob['genre'], blob['studio'], blob['status'], blob['year'], blob['firstaired'], blob['runtime'], blob['thumb'], blob['poster'], blob['pvrid'], blob['logo']))
conn.commit()
conn.close()
also:
Code: Alles auswählen
conn = sqlite3.connect(SerienPlaner)
cur = conn.cursor()
sql = "SELECT * FROM TVShowData Order BY StartTime"
cur.execute(sql)
Code: Alles auswählen
widget = 1
for i in range
if widget > 16
conn. close
break
conn = sqlite3.connect(SerienPlaner)
cur = conn.cursor()
sql = "SELECT * FROM TVShowData Order BY StartTime"
cur.execute(sql)
WINDOW.setProperty('SerienPlaner.%s.Starttime' % (widget), data['starttime'])
WINDOW.setProperty('SerienPlaner.%s.TVShow' % (offset + widget), data['tvshow'])
usw...
widget +=1
return widget - 1
also datensaz[1], datensatz[2] usw...