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