diff --git a/Gamez.Python.VS2010.suo b/Gamez.Python.VS2010.suo new file mode 100644 index 0000000..3dfbad1 Binary files /dev/null and b/Gamez.Python.VS2010.suo differ diff --git a/Gamez.py b/Gamez.py index 5e48955..93abd24 100644 --- a/Gamez.py +++ b/Gamez.py @@ -68,7 +68,8 @@ def RunWebServer(self,isToDaemonize): def GenerateSabPostProcessScript(): config = ConfigParser.RawConfigParser() - config.read('Gamez.ini') + print(os.path.join(app_path,'Gamez.ini')) + config.read(os.path.join(app_path,'Gamez.ini')) gamezWebHost = config.get('global','server.socket_host').replace('"','') gamezWebport = config.get('global','server.socket_port').replace('"','') gamezBaseUrl = "http://" + gamezWebHost + ":" + gamezWebport + "/" @@ -119,10 +120,10 @@ def RunGameTask(): print(sys.exc_info()[0]) if __name__ == '__main__': + app_path = sys.path[0] + ValidateDB() LogEvent("Checking config file for completeness") CheckConfigForAllKeys(app_path) - LogEvent("Checking to make sure all tables exist in the database") - ValidateDB() isToDaemonize = 0 params = sys.argv for param in params: diff --git a/lib/ConfigFunctions.py b/lib/ConfigFunctions.py index 56c8e9b..145ba7a 100644 --- a/lib/ConfigFunctions.py +++ b/lib/ConfigFunctions.py @@ -51,6 +51,10 @@ def CheckConfigForAllKeys(app_path): config.set('Sabnzbd','host','"127.0.0.1"') changesMade = True + if(config.has_option('Sabnzbd','port') == False): + config.set('Sabnzbd','port','') + changesMade = True + if(config.has_option('Scheduler','download_interval') == False): config.set('Scheduler','download_interval','60') changesMade = True diff --git a/lib/DBFunctions.py b/lib/DBFunctions.py index 7b74c64..a8bef90 100644 --- a/lib/DBFunctions.py +++ b/lib/DBFunctions.py @@ -167,7 +167,6 @@ def UpdateStatus(game_id,status): return def ValidateDB(): - LogEvent("Checking to make sure database has the correct tables") db_path = os.path.join(os.path.abspath(""),"Gamez.db") sql = "select name from sqlite_master where type='table'" logTableExists = False @@ -182,7 +181,6 @@ def ValidateDB(): logTableExists = True cursor.close() if(logTableExists == False): - LogEvent("Creating table 'gamez_log'") sql = "create table gamez_log(ID INTEGER NOT NULL PRIMARY KEY UNIQUE,message TEXT(255) NOT NULL,created_date DATE)" connection = sqlite3.connect(db_path) cursor = connection.cursor()