summaryrefslogtreecommitdiff
path: root/ausbutler
diff options
context:
space:
mode:
Diffstat (limited to 'ausbutler')
-rw-r--r--ausbutler/config.py4
-rw-r--r--ausbutler/db.py1
-rw-r--r--ausbutler/goniec.py4
-rw-r--r--ausbutler/interface.py7
-rw-r--r--ausbutler/model.py2
-rw-r--r--ausbutler/tour_config.py2
6 files changed, 13 insertions, 7 deletions
diff --git a/ausbutler/config.py b/ausbutler/config.py
index 7a0f57d..fc676e9 100644
--- a/ausbutler/config.py
+++ b/ausbutler/config.py
@@ -1,7 +1,9 @@
-from os import path
import json
+from os import path
+
import __main__
+
def load_config(filename):
return json.load(
open(path.join(path.dirname(__main__.__file__),
diff --git a/ausbutler/db.py b/ausbutler/db.py
index 15f3518..df8711d 100644
--- a/ausbutler/db.py
+++ b/ausbutler/db.py
@@ -3,6 +3,7 @@ from sqlalchemy.orm import sessionmaker
from .config import load_config
+
def get_session():
session = sessionmaker(bind=create_engine(
"mysql://{0[user]}:{0[pass]}@{0[host]}/{0[db]}?charset=utf8".format(
diff --git a/ausbutler/goniec.py b/ausbutler/goniec.py
index ed2dd3f..1261819 100644
--- a/ausbutler/goniec.py
+++ b/ausbutler/goniec.py
@@ -1,6 +1,8 @@
-from .tour_config import Constants
import socket
+from .tour_config import Constants
+
+
class Goniec(object):
def __init__(self, config):
self.config = config
diff --git a/ausbutler/interface.py b/ausbutler/interface.py
index bc3549c..9998424 100644
--- a/ausbutler/interface.py
+++ b/ausbutler/interface.py
@@ -1,13 +1,14 @@
import re
+from copy import copy
from datetime import datetime
from os import path
-from copy import copy
+
from jinja2 import Environment, FileSystemLoader
-from .butler import cutoff, get_opponents, get_room, normalize, get_line
+from .butler import cutoff, get_line, get_opponents, get_room, normalize
from .db import get_session
from .model import AusButler, Butler
-from .tour_config import Translations, Constants
+from .tour_config import Constants, Translations
class Interface(object):
diff --git a/ausbutler/model.py b/ausbutler/model.py
index 356ef9b..1dce4b2 100644
--- a/ausbutler/model.py
+++ b/ausbutler/model.py
@@ -1,5 +1,5 @@
from cached_property import cached_property
-from sqlalchemy import Column, MetaData, Table, ForeignKey, func, join, literal
+from sqlalchemy import Column, ForeignKey, MetaData, Table, func, join, literal
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy.types import Float, Integer, String
diff --git a/ausbutler/tour_config.py b/ausbutler/tour_config.py
index bf6451d..a651be4 100644
--- a/ausbutler/tour_config.py
+++ b/ausbutler/tour_config.py
@@ -1,6 +1,6 @@
from .config import load_config
from .db import get_session
-from .model import Translation, Parameters
+from .model import Parameters, Translation
session = get_session()