Skip to content

Commit

Permalink
Clean up based on pylint output
Browse files Browse the repository at this point in the history
  • Loading branch information
wagnerpeer committed Jun 19, 2019
1 parent 027003f commit 9e40c29
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
18 changes: 9 additions & 9 deletions park_vorhersage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
Define basic logging format and the sqlalchemy session to be used throughout
the package.
"""
__all__ = []

import logging
import logging.config

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from . import controler
from .controler import *
from . import storage
from .storage import *

__all__ += controler.__all__
__all__ += storage.__all__

__all__ = ["Session"]

LOGGING_CONFIGURATION = {
"version": 1,
Expand All @@ -36,9 +42,3 @@
}

logging.config.dictConfig(LOGGING_CONFIGURATION)

_engine = create_engine("sqlite:///opg.db", echo=True)

Session = sessionmaker(bind=_engine)

from .controler import *
5 changes: 1 addition & 4 deletions park_vorhersage/controler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
"""
__all__ = ["init", "scrape_and_store"]


from . import Session

from .storage import Base, Capacity, ParkingRamp, store
from .storage import Base, Session, store
from .scraper import scrape


Expand Down
9 changes: 8 additions & 1 deletion park_vorhersage/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@
Module is used to define a database schema to hold general parking ramp
information and details about their capacity using sqlalchemy.
"""
__all__ = ["Capacity", "ParkingRamp", "Session"]

from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.orm import relationship

from . import Session
_ENGINE = create_engine("sqlite:///opg.db", echo=True)

Session = sessionmaker(bind=_ENGINE)

Base = declarative_base()

Expand Down

0 comments on commit 9e40c29

Please sign in to comment.