From 9f87ab4bbab048b527585929135cab80fafd9ef9 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Tue, 30 Jun 2020 13:28:18 +0200 Subject: Address a number of pylint issues --- web-server/opendc/util/database.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'web-server/opendc/util/database.py') diff --git a/web-server/opendc/util/database.py b/web-server/opendc/util/database.py index 50bc93a8..09d241b5 100644 --- a/web-server/opendc/util/database.py +++ b/web-server/opendc/util/database.py @@ -10,10 +10,13 @@ CONNECTION_POOL = None class Database: + """Object holding functionality for database access.""" def __init__(self): self.opendc_db = None def init_database(self, user, password, database, host): + """Initializes the database connection.""" + user = urllib.parse.quote_plus(user) # TODO: replace this with environment variable password = urllib.parse.quote_plus(password) # TODO: same as above database = urllib.parse.quote_plus(database) -- cgit v1.2.3 From e1b29eafbd0b6285b7bea2e24709c7622d41173d Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Tue, 30 Jun 2020 14:04:11 +0200 Subject: Fix all violations --- web-server/opendc/util/database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web-server/opendc/util/database.py') diff --git a/web-server/opendc/util/database.py b/web-server/opendc/util/database.py index 09d241b5..12d6afc9 100644 --- a/web-server/opendc/util/database.py +++ b/web-server/opendc/util/database.py @@ -17,8 +17,8 @@ class Database: def init_database(self, user, password, database, host): """Initializes the database connection.""" - user = urllib.parse.quote_plus(user) # TODO: replace this with environment variable - password = urllib.parse.quote_plus(password) # TODO: same as above + user = urllib.parse.quote_plus(user) + password = urllib.parse.quote_plus(password) database = urllib.parse.quote_plus(database) host = urllib.parse.quote_plus(host) -- cgit v1.2.3