Show prices through a minimal webapp
This commit is contained in:
15
fioul.py
15
fioul.py
@@ -1,14 +1,13 @@
|
||||
#! /usr/bin/env python3
|
||||
|
||||
# from bottle import hook, request, route, run, static_file, view
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from config import conf
|
||||
from datetime import date
|
||||
from models import Price, IntegrityError
|
||||
|
||||
|
||||
import requests
|
||||
import json
|
||||
import webapp
|
||||
|
||||
query = """query {
|
||||
getProductGroups(category: 1, zipcode: 1184) {
|
||||
@@ -74,6 +73,16 @@ def show(args):
|
||||
print(get_price())
|
||||
|
||||
|
||||
@subcommand()
|
||||
def serve(args):
|
||||
webapp.run(
|
||||
host=conf["server"].get("host", "localhost"),
|
||||
port=conf["server"].getint("port", 9980),
|
||||
debug=conf["server"].getboolean("debug", False),
|
||||
reloader=conf["server"].getboolean("reloader", False),
|
||||
)
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Main
|
||||
|
||||
|
||||
Reference in New Issue
Block a user