def __init__(self, addon): self.KEY += '.' + dixie.GetKey() self.xml = None gmt = addon.getSetting('gmtfrom').replace('GMT', '') if gmt == '': self.offset = 0 else: self.offset = int(gmt)
def __init__(self, addon): self.KEY += '.' + dixie.GetKey() self.xml = None # Check to see if the global offset has been set gmt = addon.getSetting('gmtfrom').replace('GMT', '') if gmt == '': self.offset = 0 else: self.offset = int(gmt)
# You should have received a copy of the GNU General Public License # along with XBMC; see the file COPYING. If not, write to # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # http://www.gnu.org/copyleft/gpl.html # import datetime import os import sqlite3 import time import dixie from source import Program PROGRAM_DB = 'program.db' DB_KEY = 'dixie.' + dixie.GetKey() class InfoService(object): def __init__(self): # initialise database connection sqlite3.register_adapter(datetime.datetime, self.adapt_datetime) sqlite3.register_converter('timestamp', self.convert_datetime) path = os.path.join(dixie.PROFILE, PROGRAM_DB) self.conn = sqlite3.connect(path, timeout=10, detect_types=sqlite3.PARSE_DECLTYPES, check_same_thread=False) self.conn.row_factory = sqlite3.Row