def open_db(self): # get where CrossEPG save data (dbroot) dbroot = crossepg.epgdb_get_dbroot() # open CrossEPG database if not crossepg.epgdb_open(dbroot): print("ERROR opening CrossEPG database") sys.exit(1) # load database structures (index, ....) crossepg.epgdb_load()
def main(): # log_add() print to stdout a text message crossepg.log_add("---- START EXAMPLE TEST SCRIPT ----") # get installation dir instdir = crossepg.epgdb_get_installroot() if instdir == False: crossepg.log_add("ERROR: cannot find CrossEPG installation directory") sys.exit(1) crossepg.log_add("Installation dir : %s" % instdir) # get dbroot path dbroot = crossepg.epgdb_get_dbroot() if dbroot == False: crossepg.log_add("ERROR: cannot find CrossEPG database directory") sys.exit(1) crossepg.log_add("Database dir : %s" % dbroot) # open CrossEPG internal database if crossepg.epgdb_open(dbroot): crossepg.log_add("EPGDB opened successfully (root = %s)" % dbroot); else: crossepg.log_add("Error opening EPGDB"); crossepg.epgdb_close(); sys.exit(1) crossepg.log_add("Closing EPGDB"); crossepg.epgdb_close(); delta_timezone = scriptlib.delta_utc() crossepg.log_add("GMT vs. LocalTime difference (in seconds): %d" % delta_timezone) delta_daylight = scriptlib.delta_dst() crossepg.log_add("DayLight Saving (DST) difference now: %d" % delta_daylight) crossepg.log_add("---- END EXAMPLE TEST SCRIPT ----")
def main(): # log_add() print to stdout a text message crossepg.log_add("---- START EXAMPLE TEST SCRIPT ----") # get installation dir instdir = crossepg.epgdb_get_installroot() if instdir == False: crossepg.log_add("ERROR: cannot find CrossEPG installation directory") sys.exit(1) crossepg.log_add("Installation dir : %s" % instdir) # get dbroot path dbroot = crossepg.epgdb_get_dbroot() if dbroot == False: crossepg.log_add("ERROR: cannot find CrossEPG database directory") sys.exit(1) crossepg.log_add("Database dir : %s" % dbroot) # open CrossEPG internal database if crossepg.epgdb_open(dbroot): crossepg.log_add("EPGDB opened successfully (root = %s)" % dbroot) else: crossepg.log_add("Error opening EPGDB") crossepg.epgdb_close() sys.exit(1) crossepg.log_add("Closing EPGDB") crossepg.epgdb_close() delta_timezone = scriptlib.delta_utc() crossepg.log_add("GMT vs. LocalTime difference (in seconds): %d" % delta_timezone) delta_daylight = scriptlib.delta_dst() crossepg.log_add("DayLight Saving (DST) difference now: %d" % delta_daylight) crossepg.log_add("---- END EXAMPLE TEST SCRIPT ----")