fix MySQL
This commit is contained in:
parent
4d65120d56
commit
bec37e0d1a
4 changed files with 9 additions and 7 deletions
3
main.py
3
main.py
|
@ -9,7 +9,8 @@ connection = pymysql.connect(host=config.host,
|
|||
password=config.password,
|
||||
db=config.db,
|
||||
charset='utf8mb4',
|
||||
cursorclass=pymysql.cursors.DictCursor)
|
||||
cursorclass=pymysql.cursors.DictCursor,
|
||||
unix_socket='/var/run/mysqld/mysqld.sock')
|
||||
|
||||
try:
|
||||
with connection.cursor() as cursor:
|
||||
|
|
|
@ -4,7 +4,7 @@ from datetime import datetime
|
|||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
DEBUG = False
|
||||
import config
|
||||
|
||||
name = "Fladerei"
|
||||
|
||||
|
@ -12,7 +12,7 @@ fetch_url = "https://www.fladerei.com/dyn_inhalte/berggasse/tagesfladen_berggass
|
|||
|
||||
|
||||
def fetch_recourse():
|
||||
if DEBUG:
|
||||
if config.DEBUG:
|
||||
from website import fladerei_html as html
|
||||
else:
|
||||
r = requests.get(fetch_url)
|
||||
|
|
|
@ -5,7 +5,7 @@ from pprint import pprint
|
|||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
DEBUG = False
|
||||
import config
|
||||
|
||||
name = "Zuppa"
|
||||
|
||||
|
@ -15,7 +15,7 @@ dateregex = re.compile("(\d+\.\d+\.\d{4})")
|
|||
|
||||
|
||||
def fetch_recourse():
|
||||
if DEBUG:
|
||||
if config.DEGUB:
|
||||
from website import zuppa_html as html
|
||||
else:
|
||||
r = requests.get(fetch_url)
|
||||
|
@ -45,6 +45,7 @@ def get_menus():
|
|||
tagesmenus.append(tagesflade)
|
||||
return tagesmenus
|
||||
|
||||
|
||||
def get_hauptsachen(soup):
|
||||
divs = soup.findAll("div", {"class": "menue_box"})
|
||||
for div in divs:
|
||||
|
|
|
@ -14,8 +14,8 @@ connection = pymysql.connect(host=config.host,
|
|||
password=config.password,
|
||||
db=config.db,
|
||||
charset='utf8mb4',
|
||||
cursorclass=pymysql.cursors.DictCursor)
|
||||
|
||||
cursorclass=pymysql.cursors.DictCursor,
|
||||
unix_socket='/var/run/mysqld/mysqld.sock')
|
||||
|
||||
@app.route('/venue/')
|
||||
def get_venues():
|
||||
|
|
Reference in a new issue