]> git.lizzy.rs Git - cheatdb.git/blob - setup.py
8ce8395bdc0694d196a2aa754e37ab3e5c7a0ef0
[cheatdb.git] / setup.py
1 import os, sys, datetime
2
3 if not "FLASK_CONFIG" in os.environ:
4         os.environ["FLASK_CONFIG"] = "../config.cfg"
5
6 delete_db = len(sys.argv) >= 2 and sys.argv[1].strip() == "-d"
7
8 if delete_db and os.path.isfile("db.sqlite"):
9         os.remove("db.sqlite")
10
11 if not os.path.isfile("db.sqlite"):
12         from app.models import *
13
14         print("Creating database tables...")
15         db.create_all()
16         print("Filling database...")
17
18         ruben = User("rubenwardy")
19         ruben.github_username = "rubenwardy"
20         ruben.rank = UserRank.EDITOR
21         db.session.add(ruben)
22
23         ez = User("Shara")
24         ez.github_username = "Ezhh"
25         ez.rank = UserRank.EDITOR
26         db.session.add(ez)
27
28         jeija = User("Jeija")
29         jeija.github_username = "Jeija"
30         db.session.add(jeija)
31
32         sam = User("fillthisinlater")
33         sam.github_username = "fillthisinlater"
34         sam.rank = UserRank.EDITOR
35         db.session.add(sam)
36
37         mod1 = Package()
38         mod1.approved = True
39         mod1.name = "awards"
40         mod1.title = "Awards"
41         mod1.type = PackageType.MOD
42         mod1.author = ruben
43         mod1.repo = "https://github.com/rubenwardy/awards"
44         mod1.issueTracker = "https://github.com/rubenwardy/awards/issues"
45         mod1.forums = 4870
46         mod1.shortDesc = "Adds achievements and an API to register new ones."
47         mod1.desc = """
48 Majority of awards are back ported from Calinou's old fork in Carbone, under same license.
49
50 ```
51 awards.register_achievement("award_mesefind",{
52     title = "First Mese Find",
53     description = "Found some Mese!",
54     trigger = {
55         type   = "dig",          -- award is given when
56         node   = "default:mese", -- this type of node has been dug
57         target = 1,              -- this number of times
58     },
59 })
60 ```
61 """
62
63         rel = PackageRelease()
64         rel.package = mod1
65         rel.title = "v1.0.0"
66         rel.url = "https://github.com/rubenwardy/awards/archive/master.zip"
67         db.session.add(rel)
68
69         mod2 = Package()
70         mod2.approved = True
71         mod2.name = "mesecons"
72         mod2.title = "Mesecons"
73         mod2.type = PackageType.MOD
74         mod2.author = jeija
75         mod2.repo = "https://github.com/minetest-mods/mesecons/"
76         mod2.issueTracker = "https://github.com/minetest-mods/mesecons/issues"
77         mod2.forums = 628
78         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."
79         mod2.desc = """
80     ########################################################################
81     ##  __    __   _____   _____   _____   _____   _____   _   _   _____  ##
82     ## |  \  /  | |  ___| |  ___| |  ___| |  ___| |  _  | | \ | | |  ___| ##
83     ## |   \/   | | |___  | |___  | |___  | |     | | | | |  \| | | |___  ##
84     ## | |\__/| | |  ___| |___  | |  ___| | |     | | | | |     | |___  | ##
85     ## | |    | | | |___   ___| | | |___  | |___  | |_| | | |\  |  ___| | ##
86     ## |_|    |_| |_____| |_____| |_____| |_____| |_____| |_| \_| |_____| ##
87     ##                                                                    ##
88     ########################################################################
89
90 MESECONS by Jeija and contributors
91
92 Mezzee-what?
93 ------------
94 [Mesecons](http://mesecons.net/)! They're yellow, they're conductive, and they'll add a whole new dimension to Minetest's gameplay.
95
96 Mesecons is a mod for [Minetest](http://minetest.net/) that implements a ton of items related to digital circuitry, such as wires, buttons, lights, and even programmable controllers. Among other things, there are also pistons, solar panels, pressure plates, and note blocks.
97
98 Mesecons has a similar goal to Redstone in Minecraft, but works in its own way, with different rules and mechanics.
99
100 OK, I want in.
101 --------------
102 Go get it!
103
104 [DOWNLOAD IT NOW](https://github.com/minetest-mods/mesecons/archive/master.zip)
105
106 Now go ahead and install it like any other Minetest mod. Don't know how? Check out [the wonderful page about it](http://wiki.minetest.com/wiki/Mods) over at the Minetest Wiki. For your convenience, here's a quick summary:
107
108 1. If Mesecons is still in a ZIP file, extract the folder inside to somewhere on the computer.
109 2. Make sure that when you open the folder, you can directly find `README.md` in the listing. If you just see another folder, move that folder up one level and delete the old one.
110 3. Open up the Minetest mods folder - usually `/mods/`. If you see the `minetest` or folder inside of that, that is your mod folder instead.
111 4. Copy the Mesecons folder into the mods folder.
112
113 Don't like some parts of Mesecons? Open up the Mesecons folder and delete the subfolder containing the mod you don't want. If you didn't want movestones, for example, all you have to do is delete the `mesecons_movestones` folder and they will no longer be available.
114
115 There are no dependencies - it will work right after installing!
116
117 How do I use this thing?
118 ------------------------
119 How about a [quick overview video](https://www.youtube.com/watch?v=6kmeQj6iW5k)?
120
121 Or maybe a [comprehensive reference](http://mesecons.net/items.html) is your style?
122
123 An overview for the very newest of new beginners? How does [this one](http://uberi.mesecons.net/projects/MeseconsBasics/index.html) look?
124
125 Want to get more into building? Why not check out the [Mesecons Laboratory](http://uberi.mesecons.net/), a website dedicated to advanced Mesecons builders?
126
127 Want to contribute to Mesecons itself? Check out the [source code](https://github.com/minetest-mods/mesecons)!
128
129 Who wrote it anyways?
130 ---------------------
131 These awesome people made Mesecons possible!
132
133 | Contributor     | Contribution                     |
134 | --------------- | -------------------------------- |
135 | Hawk777         | Code for VoxelManip caching      |
136 | Jat15           | Various tweaks.                  |
137 | Jeija           | **Main developer! Everything.**  |
138 | Jordach         | Noteblock sounds.                |
139 | khonkhortistan  | Code, recipes, textures.         |
140 | Kotolegokot     | Nodeboxes for items.             |
141 | minerd247       | Textures.                        |
142 | Nore/Novatux    | Code.                            |
143 | RealBadAngel    | Fixes, improvements.             |
144 | sfan5           | Code, recipes, textures.         |
145 | suzenako        | Piston sounds.                   |
146 | Uberi/Temperest | Code, textures, documentation.   |
147 | VanessaE        | Code, recipes, textures, design. |
148 | Whiskers75      | Logic gates implementation.      |
149
150 There are also a whole bunch of other people helping with everything from code to testing and feedback. Mesecons would also not be possible without their help!
151
152 Alright, how can I use it?
153 --------------------------
154 All textures in this project are licensed under the CC-BY-SA 3.0 (Creative Commons Attribution-ShareAlike 3.0 Generic). That means you can distribute and remix them as much as you want to, under the condition that you give credit to the authors and the project, and that if you remix and release them, they must be under the same or similar license to this one.
155
156 All code in this project is licensed under the LGPL version 3 or later. That means you have unlimited freedom to distribute and modify the work however you see fit, provided that if you decide to distribute it or any modified versions of it, you must also use the same license. The LGPL also grants the additional freedom to write extensions for the software and distribute them without the extensions being subject to the terms of the LGPL, although the software itself retains its license.
157
158 No warranty is provided, express or implied, for any part of the project.
159
160 """
161
162         db.session.add(mod1)
163         db.session.add(mod2)
164
165
166         game1 = Package()
167         game1.approved = True
168         game1.name = "capturetheflag"
169         game1.title = "Capture The Flag"
170         game1.type = PackageType.GAME
171         game1.author = ruben
172         game1.repo = "https://github.com/rubenwardy/capturetheflag"
173         game1.issueTracker = "https://github.com/rubenwardy/capturetheflag/issues"
174         game1.forums = 12835
175         game1.shortDesc = "Two teams battle to snatch and return the enemy's flag, before the enemy takes their own!"
176         game1.desc = """
177 As seen on the Capture the Flag server (minetest.rubenwardy.com:30000)
178
179 Uses the CTF PvP Engine.
180 """
181
182         db.session.add(game1)
183
184
185
186         db.session.commit()
187 else:
188         print("Database already exists")