Skip to content

Commit

Permalink
Merge branch 'main' into DatastorageTestAndErrorHandling
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarno458 authored Oct 2, 2023
2 parents bc654ea + e377068 commit 9ce1de1
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ setups
build
bundle/components.wxs
dist
/prof/
README.html
.vs/
EnemizerCLI/
/Players/
/SNI/
/sni-*/
/appimagetool*
/host.yaml
/options.yaml
/config.yaml
Expand Down Expand Up @@ -140,6 +143,7 @@ ipython_config.py
.venv*
env/
venv/
/venv*/
ENV/
env.bak/
venv.bak/
Expand Down
12 changes: 11 additions & 1 deletion WebHostLib/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,34 @@ def page_not_found(err):

# Start Playing Page
@app.route('/start-playing')
@cache.cached()
def start_playing():
return render_template(f"startPlaying.html")


@app.route('/weighted-settings')
@cache.cached()
def weighted_settings():
return render_template(f"weighted-settings.html")


# Player settings pages
@app.route('/games/<string:game>/player-settings')
@cache.cached()
def player_settings(game):
return render_template(f"player-settings.html", game=game, theme=get_world_theme(game))


# Game Info Pages
@app.route('/games/<string:game>/info/<string:lang>')
@cache.cached()
def game_info(game, lang):
return render_template('gameInfo.html', game=game, lang=lang, theme=get_world_theme(game))


# List of supported games
@app.route('/games')
@cache.cached()
def games():
worlds = {}
for game, world in AutoWorldRegister.world_types.items():
Expand All @@ -64,21 +69,25 @@ def games():


@app.route('/tutorial/<string:game>/<string:file>/<string:lang>')
@cache.cached()
def tutorial(game, file, lang):
return render_template("tutorial.html", game=game, file=file, lang=lang, theme=get_world_theme(game))


@app.route('/tutorial/')
@cache.cached()
def tutorial_landing():
return render_template("tutorialLanding.html")


@app.route('/faq/<string:lang>/')
@cache.cached()
def faq(lang):
return render_template("faq.html", lang=lang)


@app.route('/glossary/<string:lang>/')
@cache.cached()
def terms(lang):
return render_template("glossary.html", lang=lang)

Expand Down Expand Up @@ -147,7 +156,7 @@ def host_room(room: UUID):

@app.route('/favicon.ico')
def favicon():
return send_from_directory(os.path.join(app.root_path, 'static/static'),
return send_from_directory(os.path.join(app.root_path, "static", "static"),
'favicon.ico', mimetype='image/vnd.microsoft.icon')


Expand All @@ -167,6 +176,7 @@ def get_datapackage():

@app.route('/index')
@app.route('/sitemap')
@cache.cached()
def get_sitemap():
available_games: List[Dict[str, Union[str, bool]]] = []
for game, world in AutoWorldRegister.world_types.items():
Expand Down
3 changes: 1 addition & 2 deletions WebHostLib/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
flask>=2.2.3
pony>=0.7.16; python_version <= '3.10'
pony @ https://github.com/Berserker66/pony/releases/download/v0.7.16/pony-0.7.16-py3-none-any.whl#0.7.16 ; python_version >= '3.11'
pony>=0.7.17
waitress>=2.1.2
Flask-Caching>=2.0.2
Flask-Compress>=1.14
Expand Down
2 changes: 1 addition & 1 deletion WebHostLib/templates/viewSeed.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h1>Seed Info</h1>
{% endif %}
<tr>
<td>Rooms:&nbsp;</td>
<td>
<td>
{% call macros.list_rooms(seed.rooms | selectattr("owner", "eq", session["_id"])) %}
<li>
<a href="{{ url_for("new_room", seed=seed.id) }}">Create New Room</a>
Expand Down
5 changes: 4 additions & 1 deletion kvui.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
import ctypes
# kivy 2.2.0 introduced DPI awareness on Windows, but it makes the UI enter an infinitely recursive re-layout
# by setting the application to not DPI Aware, Windows handles scaling the entire window on its own, ignoring kivy's
ctypes.windll.shcore.SetProcessDpiAwareness(0)
try:
ctypes.windll.shcore.SetProcessDpiAwareness(0)
except FileNotFoundError: # shcore may not be found on <= Windows 7
pass # TODO: remove silent except when Python 3.8 is phased out.

os.environ["KIVY_NO_CONSOLELOG"] = "1"
os.environ["KIVY_NO_FILELOG"] = "1"
Expand Down

0 comments on commit 9ce1de1

Please sign in to comment.