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