Setup minimal flask environment.

This commit is contained in:
dongar committed 2023-03-31 14:32:59 -05:00
1 parent 27259bf53a
commit f7dd7c40f8
10 files changed
+128

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
*.pyc
.venv
__pycache__
+25
View File
@@ -0,0 +1,25 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "app.py",
"FLASK_DEBUG": "1"
},
"args": [
"run",
"--no-debugger",
"--no-reload"
],
"jinja": true,
"justMyCode": true
}
]
}
+12
View File
@@ -7,3 +7,15 @@ The internal dictionary is derived from the kind folks at:
This disctionary does NOT match the official worldle dictionary, so it certainly contains This disctionary does NOT match the official worldle dictionary, so it certainly contains
words not accepted by the official wordle app, and is probably missing words available words not accepted by the official wordle app, and is probably missing words available
to the offical game. to the offical game.
Setup virtual environment:
py -m vent .venv
.\.venv\Scripts\activate
pip install -r requirements.txt
Run flask web server:
py -m flask run
Notes:
To enable python virtual environments, you first need to do:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/python
from flask import Flask
from flask import render_template
app = Flask(__name__)
@app.route("/")
def solver():
return render_template("solver.html")
@app.route("/dictionary")
def dictionary():
return render_template("dictionary.html")
BIN
View File
Binary file not shown.
+27
View File
@@ -0,0 +1,27 @@
.navbar {
background-color: lightslategray;
font-size: 1em;
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
color: white;
padding: 8px 5px 8px 5px;
}
.navbar a {
text-decoration: none;
color: inherit;
}
.navbar-brand {
font-size: 1.2em;
font-weight: 600;
}
.navbar-item {
font-variant: small-caps;
margin-left: 30px;
}
.body-content {
padding: 5px;
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
+9
View File
@@ -0,0 +1,9 @@
{% extends "layout.html" %}
{% block title %}
Dictionary
{% endblock %}
{% block content %}
Words go here.
{% endblock %}
+26
View File
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='site.css')}}" />
</head>
<body>
<div class="navbar">
<a href="{{ url_for('solver') }}" class="navbar-item">Home</a>
<a href="{{ url_for('dictionary') }}" class="navbar-item">Dictionary</a>
</div>
<div class="body-content">
{% block content %}
{% endblock %}
<hr />
<footer>
I did this!
</footer>
</div>
</body>
</html>
+9
View File
@@ -0,0 +1,9 @@
{% extends "layout.html" %}
{% block title %}
Solver!
{% endblock %}
{% block content %}
Welcome to solver!
{% endblock %}
+1
View File
@@ -29,6 +29,7 @@ _invalid_words = set(['staia', 'erept', 'boily', 'bolty', 'pindy', 'hyrse', 'hir
'skeel', 'telae', 'genae', 'beata', 'beala', 'macco', 'beele', 'divet', 'vedet', 'skeel', 'telae', 'genae', 'beata', 'beala', 'macco', 'beele', 'divet', 'vedet',
'stail', 'roter', 'fikie', 'muang', 'nurry']) 'stail', 'roter', 'fikie', 'muang', 'nurry'])
def dictionary(): def dictionary():
if not _wordle_dictionary: if not _wordle_dictionary:
with open('words_alpha.txt') as word_file: with open('words_alpha.txt') as word_file: