]> git.lizzy.rs Git - cheatdb.git/blob - setup.py
Add work queue
[cheatdb.git] / setup.py
1 import os, sys, datetime
2
3 delete_db = len(sys.argv) >= 2 and sys.argv[1].strip() == "-d"
4
5 if delete_db and os.path.isfile("db.sqlite"):
6         os.remove("db.sqlite")
7
8 if not os.path.isfile("db.sqlite"):
9         from app.models import *
10
11         print("Creating database tables...")
12         db.create_all()
13         print("Filling database...")
14
15         ruben = User("rubenwardy")
16         ruben.github_username = "rubenwardy"
17         ruben.rank = UserRank.EDITOR
18         db.session.add(ruben)
19
20         jeija = User("Jeija")
21         jeija.github_username = "Jeija"
22         db.session.add(jeija)
23
24         mod1 = Package()
25         mod1.approved = True
26         mod1.name = "awards"
27         mod1.title = "Awards"
28         mod1.type = PackageType.MOD
29         mod1.author = ruben
30         mod1.repo = "https://github.com/rubenwardy/awards"
31         mod1.issueTracker = "https://github.com/rubenwardy/awards/issues"
32         mod1.forums = 4870
33         mod1.shortDesc = "Adds achievements and an API to register new ones."
34         mod1.desc = """
35 Majority of awards are back ported from Calinou's old fork in Carbone, under same license.
36
37 ```
38 awards.register_achievement("award_mesefind",{
39     title = "First Mese Find",
40     description = "Found some Mese!",
41     trigger = {
42         type   = "dig",          -- award is given when
43         node   = "default:mese", -- this type of node has been dug
44         target = 1,              -- this number of times
45     },
46 })
47 ```
48 """
49
50         rel = PackageRelease()
51         rel.package = mod1
52         rel.title = "v1.0.0"
53         rel.url = "https://github.com/rubenwardy/awards/archive/master.zip"
54         db.session.add(rel)
55
56         mod2 = Package()
57         mod2.approved = True
58         mod2.name = "mesecons"
59         mod2.title = "Mesecons"
60         mod2.type = PackageType.MOD
61         mod2.author = jeija
62         mod2.repo = "https://github.com/minetest-mods/mesecons/"
63         mod2.issueTracker = "https://github.com/minetest-mods/mesecons/issues"
64         mod2.forums = 628
65         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."
66         mod2.desc = """
67     ########################################################################
68     ##  __    __   _____   _____   _____   _____   _____   _   _   _____  ##
69     ## |  \  /  | |  ___| |  ___| |  ___| |  ___| |  _  | | \ | | |  ___| ##
70     ## |   \/   | | |___  | |___  | |___  | |     | | | | |  \| | | |___  ##
71     ## | |\__/| | |  ___| |___  | |  ___| | |     | | | | |     | |___  | ##
72     ## | |    | | | |___   ___| | | |___  | |___  | |_| | | |\  |  ___| | ##
73     ## |_|    |_| |_____| |_____| |_____| |_____| |_____| |_| \_| |_____| ##
74     ##                                                                    ##
75     ########################################################################
76
77 MESECONS by Jeija and contributors
78
79 Mezzee-what?
80 ------------
81 [Mesecons](http://mesecons.net/)! They're yellow, they're conductive, and they'll add a whole new dimension to Minetest's gameplay.
82
83 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.
84
85 Mesecons has a similar goal to Redstone in Minecraft, but works in its own way, with different rules and mechanics.
86
87 OK, I want in.
88 --------------
89 Go get it!
90
91 [DOWNLOAD IT NOW](https://github.com/minetest-mods/mesecons/archive/master.zip)
92
93 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:
94
95 1. If Mesecons is still in a ZIP file, extract the folder inside to somewhere on the computer.
96 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.
97 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.
98 4. Copy the Mesecons folder into the mods folder.
99
100 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.
101
102 There are no dependencies - it will work right after installing!
103
104 How do I use this thing?
105 ------------------------
106 How about a [quick overview video](https://www.youtube.com/watch?v=6kmeQj6iW5k)?
107
108 Or maybe a [comprehensive reference](http://mesecons.net/items.html) is your style?
109
110 An overview for the very newest of new beginners? How does [this one](http://uberi.mesecons.net/projects/MeseconsBasics/index.html) look?
111
112 Want to get more into building? Why not check out the [Mesecons Laboratory](http://uberi.mesecons.net/), a website dedicated to advanced Mesecons builders?
113
114 Want to contribute to Mesecons itself? Check out the [source code](https://github.com/minetest-mods/mesecons)!
115
116 Who wrote it anyways?
117 ---------------------
118 These awesome people made Mesecons possible!
119
120 | Contributor     | Contribution                     |
121 | --------------- | -------------------------------- |
122 | Hawk777         | Code for VoxelManip caching      |
123 | Jat15           | Various tweaks.                  |
124 | Jeija           | **Main developer! Everything.**  |
125 | Jordach         | Noteblock sounds.                |
126 | khonkhortistan  | Code, recipes, textures.         |
127 | Kotolegokot     | Nodeboxes for items.             |
128 | minerd247       | Textures.                        |
129 | Nore/Novatux    | Code.                            |
130 | RealBadAngel    | Fixes, improvements.             |
131 | sfan5           | Code, recipes, textures.         |
132 | suzenako        | Piston sounds.                   |
133 | Uberi/Temperest | Code, textures, documentation.   |
134 | VanessaE        | Code, recipes, textures, design. |
135 | Whiskers75      | Logic gates implementation.      |
136
137 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!
138
139 Alright, how can I use it?
140 --------------------------
141 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.
142
143 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.
144
145 No warranty is provided, express or implied, for any part of the project.
146
147 """
148
149         db.session.add(mod1)
150         db.session.add(mod2)
151
152
153         game1 = Package()
154         game1.approved = True
155         game1.name = "capturetheflag"
156         game1.title = "Capture The Flag"
157         game1.type = PackageType.GAME
158         game1.author = ruben
159         game1.repo = "https://github.com/rubenwardy/capturetheflag"
160         game1.issueTracker = "https://github.com/rubenwardy/capturetheflag/issues"
161         game1.forums = 12835
162         game1.shortDesc = "Two teams battle to snatch and return the enemy's flag, before the enemy takes their own!"
163         game1.desc = """
164 As seen on the Capture the Flag server (minetest.rubenwardy.com:30000)
165
166 Uses the CTF PvP Engine.
167 """
168
169         db.session.add(game1)
170
171
172
173         db.session.commit()
174 else:
175         print("Database already exists")