use consistent quotes

i2p
lza_menace 4 years ago
parent 4ef8a9ede8
commit 1e65e52e27

@ -11,11 +11,12 @@ from urllib.parse import urlparse
from xmrnodes.helpers import determine_crypto
from xmrnodes.forms import SubmitNode
from xmrnodes.models import Node
from xmrnodes import config
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
format="%(asctime)s - %(levelname)s - %(message)s"
)
app = Flask(__name__)
@ -61,16 +62,16 @@ def add():
if request.method == "POST":
url = request.form.get("node_url")
regex = re.compile(
r'^(?:http)s?://' # http:// or https://
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' #domain...
r'localhost|' #localhost...
r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
r'(?::\d+)?' # optional port
r'(?:/?|[/?]\S+)$', re.IGNORECASE
r"^(?:http)s?://" # http:// or https://
r"(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|" #domain...
r"localhost|" #localhost...
r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" # ...or ip
r"(?::\d+)?" # optional port
r"(?:/?|[/?]\S+)$", re.IGNORECASE
)
re_match = re.match(regex, url)
if re_match is None:
flash("This doesn't look like a valid URL")
flash("This doesn\"t look like a valid URL")
else:
_url = urlparse(url)
url = f"{_url.scheme}://{_url.netloc}"
@ -152,9 +153,9 @@ def validate():
logging.info("failed for reasons unknown")
node.delete_instance()
@app.template_filter('humanize')
@app.template_filter("humanize")
def humanize(d):
t = arrow.get(d, 'UTC')
t = arrow.get(d, "UTC")
return t.humanize()
if __name__ == "__main__":

@ -1 +1,4 @@
SECRET_KEY = 'xxxx'
import os
SECRET_KEY = os.environ('SECRET_KEY', 'xxxx')
DATA_DIR = os.environ('DATA_DIR', './data')

@ -3,7 +3,7 @@ from datetime import datetime
from xmrnodes import config
data_dir = getattr(config, 'DATA_FOLDER', './data')
data_dir = getattr(config, 'DATA_DIR', './data')
db = SqliteDatabase(f"{data_dir}/sqlite.db")
class Node(Model):

Loading…
Cancel
Save