]> git.lizzy.rs Git - cheatdb.git/blob - setup.py
6e0d25be5ad6adedfa0fdc1a93be5bde89a5da42
[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.ADMIN
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         tags = {}
38         for tag in ["Inventory", "Mapgen", "Building", \
39                         "Mobs and NPCs", "Tools", "Player effects", \
40                         "Environment", "Transport", "Maintenance", "Plants and farming", \
41                         "PvP", "PvE", "Survival", "Creative", "Puzzle", "Multiplayer", "Singleplayer"]:
42                 row = Tag(tag)
43                 tags[row.name] = row
44                 db.session.add(row)
45
46
47
48         licenses = {}
49         for license in ["LGPLv2.1", "LGPLv3", "GPLv2.1", "GPLv3", "AGPLv2.1", "AGPLv3",
50                                         "MIT", "Apache", "BSD", "ZLib", "CC0", "CC-BY-SA", "CC-BY", "CC-BY-NC-SA"]:
51                 row = License(license)
52                 licenses[row.name] = row
53                 db.session.add(row)
54
55         mod1 = Package()
56         mod1.approved = True
57         mod1.name = "awards"
58         mod1.title = "Awards"
59         mod1.license = licenses["LGPLv2.1"]
60         mod1.type = PackageType.MOD
61         mod1.author = ruben
62         mod1.tags.append(tags["player_effects"])
63         mod1.repo = "https://github.com/rubenwardy/awards"
64         mod1.issueTracker = "https://github.com/rubenwardy/awards/issues"
65         mod1.forums = 4870
66         mod1.shortDesc = "Adds achievements and an API to register new ones."
67         mod1.desc = """
68 Majority of awards are back ported from Calinou's old fork in Carbone, under same license.
69
70 ```
71 awards.register_achievement("award_mesefind",{
72     title = "First Mese Find",
73     description = "Found some Mese!",
74     trigger = {
75         type   = "dig",          -- award is given when
76         node   = "default:mese", -- this type of node has been dug
77         target = 1,              -- this number of times
78     },
79 })
80 ```
81 """
82
83         rel = PackageRelease()
84         rel.package = mod1
85         rel.title = "v1.0.0"
86         rel.url = "https://github.com/rubenwardy/awards/archive/master.zip"
87         rel.approved = True
88         db.session.add(rel)
89
90         mod2 = Package()
91         mod2.approved = True
92         mod2.name = "mesecons"
93         mod2.title = "Mesecons"
94         mod2.tags.append(tags["tools"])
95         mod2.type = PackageType.MOD
96         mod2.license = licenses["LGPLv3"]
97         mod2.author = jeija
98         mod2.repo = "https://github.com/minetest-mods/mesecons/"
99         mod2.issueTracker = "https://github.com/minetest-mods/mesecons/issues"
100         mod2.forums = 628
101         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."
102         mod2.desc = """
103     ########################################################################
104     ##  __    __   _____   _____   _____   _____   _____   _   _   _____  ##
105     ## |  \  /  | |  ___| |  ___| |  ___| |  ___| |  _  | | \ | | |  ___| ##
106     ## |   \/   | | |___  | |___  | |___  | |     | | | | |  \| | | |___  ##
107     ## | |\__/| | |  ___| |___  | |  ___| | |     | | | | |     | |___  | ##
108     ## | |    | | | |___   ___| | | |___  | |___  | |_| | | |\  |  ___| | ##
109     ## |_|    |_| |_____| |_____| |_____| |_____| |_____| |_| \_| |_____| ##
110     ##                                                                    ##
111     ########################################################################
112
113 MESECONS by Jeija and contributors
114
115 Mezzee-what?
116 ------------
117 [Mesecons](http://mesecons.net/)! They're yellow, they're conductive, and they'll add a whole new dimension to Minetest's gameplay.
118
119 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.
120
121 Mesecons has a similar goal to Redstone in Minecraft, but works in its own way, with different rules and mechanics.
122
123 OK, I want in.
124 --------------
125 Go get it!
126
127 [DOWNLOAD IT NOW](https://github.com/minetest-mods/mesecons/archive/master.zip)
128
129 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:
130
131 1. If Mesecons is still in a ZIP file, extract the folder inside to somewhere on the computer.
132 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.
133 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.
134 4. Copy the Mesecons folder into the mods folder.
135
136 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.
137
138 There are no dependencies - it will work right after installing!
139
140 How do I use this thing?
141 ------------------------
142 How about a [quick overview video](https://www.youtube.com/watch?v=6kmeQj6iW5k)?
143
144 Or maybe a [comprehensive reference](http://mesecons.net/items.html) is your style?
145
146 An overview for the very newest of new beginners? How does [this one](http://uberi.mesecons.net/projects/MeseconsBasics/index.html) look?
147
148 Want to get more into building? Why not check out the [Mesecons Laboratory](http://uberi.mesecons.net/), a website dedicated to advanced Mesecons builders?
149
150 Want to contribute to Mesecons itself? Check out the [source code](https://github.com/minetest-mods/mesecons)!
151
152 Who wrote it anyways?
153 ---------------------
154 These awesome people made Mesecons possible!
155
156 | Contributor     | Contribution                     |
157 | --------------- | -------------------------------- |
158 | Hawk777         | Code for VoxelManip caching      |
159 | Jat15           | Various tweaks.                  |
160 | Jeija           | **Main developer! Everything.**  |
161 | Jordach         | Noteblock sounds.                |
162 | khonkhortistan  | Code, recipes, textures.         |
163 | Kotolegokot     | Nodeboxes for items.             |
164 | minerd247       | Textures.                        |
165 | Nore/Novatux    | Code.                            |
166 | RealBadAngel    | Fixes, improvements.             |
167 | sfan5           | Code, recipes, textures.         |
168 | suzenako        | Piston sounds.                   |
169 | Uberi/Temperest | Code, textures, documentation.   |
170 | VanessaE        | Code, recipes, textures, design. |
171 | Whiskers75      | Logic gates implementation.      |
172
173 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!
174
175 Alright, how can I use it?
176 --------------------------
177 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.
178
179 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.
180
181 No warranty is provided, express or implied, for any part of the project.
182
183 """
184
185         db.session.add(mod1)
186         db.session.add(mod2)
187
188         mod = Package()
189         mod.approved = True
190         mod.name = "handholds"
191         mod.title = "Mountain Climbing"
192         mod.license = licenses["MIT"]
193         mod.type = PackageType.MOD
194         mod.author = ez
195         mod.tags.append(tags["player_effects"])
196         mod.repo = "https://github.com/ezhh/handholds"
197         mod.issueTracker = "https://github.com/ezhh/handholds/issues"
198         mod.forums = 17069
199         mod.shortDesc = "Adds hand holds and climbing thingies"
200         mod.desc = "This is the long desc"
201         db.session.add(mod)
202
203         rel = PackageRelease()
204         rel.package = mod
205         rel.title = "v1.0.0"
206         rel.url = "https://github.com/ezhh/handholds/archive/master.zip"
207         rel.approved = True
208         db.session.add(rel)
209
210         mod = Package()
211         mod.approved = True
212         mod.name = "other_worlds"
213         mod.title = "Other Worlds"
214         mod.license = licenses["MIT"]
215         mod.type = PackageType.MOD
216         mod.author = ez
217         mod.tags.append(tags["mapgen"])
218         mod.tags.append(tags["environment"])
219         mod.repo = "https://github.com/ezhh/other_worlds"
220         mod.issueTracker = "https://github.com/ezhh/other_worlds/issues"
221         mod.forums = 16015
222         mod.shortDesc = "Adds space with asteroids and comets"
223         mod.desc = "This is the long desc"
224         db.session.add(mod)
225
226         mod = Package()
227         mod.approved = True
228         mod.name = "food"
229         mod.title = "Food"
230         mod.license = licenses["LGPLv2.1"]
231         mod.type = PackageType.MOD
232         mod.author = ruben
233         mod.tags.append(tags["player_effects"])
234         mod.repo = "https://github.com/rubenwardy/food/"
235         mod.issueTracker = "https://github.com/rubenwardy/food/issues/"
236         mod.forums = 2960
237         mod.shortDesc = "Adds lots of food and an API to manage ingredients"
238         mod.desc = "This is the long desc"
239         db.session.add(mod)
240
241         mod = Package()
242         mod.approved = True
243         mod.name = "food_sweet"
244         mod.title = "Sweet Foods"
245         mod.license = licenses["CC0"]
246         mod.type = PackageType.MOD
247         mod.author = ruben
248         mod.tags.append(tags["player_effects"])
249         mod.repo = "https://github.com/rubenwardy/food_sweet/"
250         mod.issueTracker = "https://github.com/rubenwardy/food_sweet/issues/"
251         mod.forums = 9039
252         mod.shortDesc = "Adds sweet food"
253         mod.desc = "This is the long desc"
254         db.session.add(mod)
255
256         game1 = Package()
257         game1.approved = True
258         game1.name = "capturetheflag"
259         game1.title = "Capture The Flag"
260         game1.type = PackageType.GAME
261         game1.license = licenses["LGPLv2.1"]
262         game1.author = ruben
263         game1.tags.append(tags["pvp"])
264         game1.tags.append(tags["survival"])
265         game1.tags.append(tags["multiplayer"])
266         game1.repo = "https://github.com/rubenwardy/capturetheflag"
267         game1.issueTracker = "https://github.com/rubenwardy/capturetheflag/issues"
268         game1.forums = 12835
269         game1.shortDesc = "Two teams battle to snatch and return the enemy's flag, before the enemy takes their own!"
270         game1.desc = """
271 As seen on the Capture the Flag server (minetest.rubenwardy.com:30000)
272
273 Uses the CTF PvP Engine.
274 """
275
276         db.session.add(game1)
277
278         rel = PackageRelease()
279         rel.package = game1
280         rel.title = "v1.0.0"
281         rel.url = "https://github.com/rubenwardy/capturetheflag/archive/master.zip"
282         rel.approved = True
283         db.session.add(rel)
284
285         db.session.commit()
286 else:
287         print("Database already exists")