1
0
mirror of https://github.com/ilri/dspace-statistics-api.git synced 2025-05-08 06:06:01 +02:00

Correct issues highlighted by Flake8

Flake8 validates code style against PEP 8 in order to encourage the
writing of idiomatic Python. For reference, I am currently ignoring
errors about line length (E501) because I feel it makes code harder
to read.

This is the invocation I am using:

    $ flake8 --ignore E501 dspace_statistics_api
This commit is contained in:
2018-11-03 23:55:23 +02:00
parent 70dfcb93c5
commit cc5ce3ab98
4 changed files with 52 additions and 42 deletions

View File

@ -3,7 +3,9 @@ from .config import DATABASE_USER
from .config import DATABASE_PASS
from .config import DATABASE_HOST
from .config import DATABASE_PORT
import psycopg2, psycopg2.extras
import psycopg2
import psycopg2.extras
def database_connection():
connection = psycopg2.connect("dbname={} user={} password={} host={} port={}".format(DATABASE_NAME, DATABASE_USER, DATABASE_PASS, DATABASE_HOST, DATABASE_PORT), cursor_factory=psycopg2.extras.DictCursor)