]> git.lizzy.rs Git - cheatdb.git/blobdiff - setup.py
Fix release auto-approval
[cheatdb.git] / setup.py
index df57698556b11eac63ddff4b61d2dc296e215e6e..4fd5ff162571416e4254adc13e6a0b9b5ba7370f 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,9 @@ import os, sys, datetime
 if not "FLASK_CONFIG" in os.environ:
        os.environ["FLASK_CONFIG"] = "../config.cfg"
 
-test_data = len(sys.argv) >= 2 and sys.argv[1].strip() == "-t"
+delete_db = len(sys.argv) >= 2 and sys.argv[1].strip() == "-d"
+create_db = not (len(sys.argv) >= 2 and sys.argv[1].strip() == "-o")
+test_data = len(sys.argv) >= 2 and sys.argv[1].strip() == "-t" or not create_db
 
 from app.models import *
 from app.utils import make_flask_user_password
@@ -53,7 +55,7 @@ def defineDummyData(licenses, tags, ruben):
        mod.repo = "https://github.com/ezhh/other_worlds"
        mod.issueTracker = "https://github.com/ezhh/other_worlds/issues"
        mod.forums = 16015
-       mod.shortDesc = "The content library should not be used yet as it is still in alpha"
+       mod.short_desc = "The content library should not be used yet as it is still in alpha"
        mod.desc = "This is the long desc"
        db.session.add(mod)
 
@@ -75,7 +77,7 @@ def defineDummyData(licenses, tags, ruben):
        mod1.repo = "https://github.com/rubenwardy/awards"
        mod1.issueTracker = "https://github.com/rubenwardy/awards/issues"
        mod1.forums = 4870
-       mod1.shortDesc = "Adds achievements and an API to register new ones."
+       mod1.short_desc = "Adds achievements and an API to register new ones."
        mod1.desc = """
 Majority of awards are back ported from Calinou's old fork in Carbone, under same license.
 
@@ -110,7 +112,7 @@ awards.register_achievement("award_mesefind",{
        mod2.repo = "https://github.com/minetest-mods/mesecons/"
        mod2.issueTracker = "https://github.com/minetest-mods/mesecons/issues"
        mod2.forums = 628
-       mod2.shortDesc = "Mesecons adds everything digital, from all kinds of sensors, switches, solar panels, detectors, pistons, lamps, sound blocks to advanced digital circuitry like logic gates and programmable blocks."
+       mod2.short_desc = "Mesecons adds everything digital, from all kinds of sensors, switches, solar panels, detectors, pistons, lamps, sound blocks to advanced digital circuitry like logic gates and programmable blocks."
        mod2.desc = """
     ########################################################################
     ##  __    __   _____   _____   _____   _____   _____   _   _   _____  ##
@@ -208,7 +210,7 @@ No warranty is provided, express or implied, for any part of the project.
        mod.repo = "https://github.com/ezhh/handholds"
        mod.issueTracker = "https://github.com/ezhh/handholds/issues"
        mod.forums = 17069
-       mod.shortDesc = "Adds hand holds and climbing thingies"
+       mod.short_desc = "Adds hand holds and climbing thingies"
        mod.desc = "This is the long desc"
        db.session.add(mod)
 
@@ -231,7 +233,7 @@ No warranty is provided, express or implied, for any part of the project.
        mod.repo = "https://github.com/ezhh/other_worlds"
        mod.issueTracker = "https://github.com/ezhh/other_worlds/issues"
        mod.forums = 16015
-       mod.shortDesc = "Adds space with asteroids and comets"
+       mod.short_desc = "Adds space with asteroids and comets"
        mod.desc = "This is the long desc"
        db.session.add(mod)
 
@@ -246,7 +248,7 @@ No warranty is provided, express or implied, for any part of the project.
        mod.repo = "https://github.com/rubenwardy/food/"
        mod.issueTracker = "https://github.com/rubenwardy/food/issues/"
        mod.forums = 2960
-       mod.shortDesc = "Adds lots of food and an API to manage ingredients"
+       mod.short_desc = "Adds lots of food and an API to manage ingredients"
        mod.desc = "This is the long desc"
        food = mod
        db.session.add(mod)
@@ -262,7 +264,7 @@ No warranty is provided, express or implied, for any part of the project.
        mod.repo = "https://github.com/rubenwardy/food_sweet/"
        mod.issueTracker = "https://github.com/rubenwardy/food_sweet/issues/"
        mod.forums = 9039
-       mod.shortDesc = "Adds sweet food"
+       mod.short_desc = "Adds sweet food"
        mod.desc = "This is the long desc"
        food_sweet = mod
        db.session.add(mod)
@@ -280,7 +282,7 @@ No warranty is provided, express or implied, for any part of the project.
        game1.repo = "https://github.com/rubenwardy/capturetheflag"
        game1.issueTracker = "https://github.com/rubenwardy/capturetheflag/issues"
        game1.forums = 12835
-       game1.shortDesc = "Two teams battle to snatch and return the enemy's flag, before the enemy takes their own!"
+       game1.short_desc = "Two teams battle to snatch and return the enemy's flag, before the enemy takes their own!"
        game1.desc = """
 As seen on the Capture the Flag server (minetest.rubenwardy.com:30000)
 
@@ -305,7 +307,7 @@ Uses the CTF PvP Engine.
        mod.type = PackageType.TXP
        mod.author = ruben
        mod.forums = 14132
-       mod.shortDesc = "This is an update of the original PixelBOX texture pack by the brillant artist Gambit"
+       mod.short_desc = "This is an update of the original PixelBOX texture pack by the brillant artist Gambit"
        mod.desc = "This is the long desc"
        db.session.add(mod)
 
@@ -333,13 +335,14 @@ Uses the CTF PvP Engine.
        db.session.add(dep)
 
 
-
-delete_db = len(sys.argv) >= 2 and sys.argv[1].strip() == "-d"
 if delete_db and os.path.isfile("db.sqlite"):
        os.remove("db.sqlite")
 
-print("Creating database tables...")
-db.create_all()
+
+if create_db:
+       print("Creating database tables...")
+       db.create_all()
+
 print("Filling database...")
 
 ruben = User("rubenwardy")