Archived
1
0
Fork 0

fix MySQL

This commit is contained in:
Lukas Winkler 2017-06-09 08:26:03 +02:00
parent 4d65120d56
commit bec37e0d1a
4 changed files with 9 additions and 7 deletions

View file

@ -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:

View file

@ -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)

View file

@ -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:

View file

@ -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():