Skip to content
Snippets Groups Projects
Commit 3c4042a4 authored by I. Nüske's avatar I. Nüske
Browse files

MNT: Fix assorted simple pylint errors

parent b236f79a
No related branches found
No related tags found
2 merge requests!128MNT: Added a warning when column metadata is not configured, and a better...,!126Fix pylint errors
...@@ -375,9 +375,7 @@ exclude is given preference over include. ...@@ -375,9 +375,7 @@ exclude is given preference over include.
logger.addHandler(logging.StreamHandler(stream=sys.stdout)) logger.addHandler(logging.StreamHandler(stream=sys.stdout))
logger.setLevel(logging.INFO) logger.setLevel(logging.INFO)
con = db.get_connection() db.configure_connection(timeout=float(args.timeout))
con.timeout = float(args.timeout)
con._login()
loadpath( loadpath(
path=args.path, path=args.path,
......
...@@ -107,12 +107,10 @@ it is not at the beginning, it must be preceded by a blank line. ...@@ -107,12 +107,10 @@ it is not at the beginning, it must be preceded by a blank line.
textlines = f.readlines() textlines = f.readlines()
state = 0 state = 0
found_0 = -1
found_1 = -1 found_1 = -1
found_2 = -1 found_2 = -1
for i, line in enumerate(textlines): for i, line in enumerate(textlines):
if len(line) == 1 and state in {-1, 0}: if len(line) == 1 and state in {-1, 0}:
found_0 = i
state = 0 state = 0
continue continue
if line.rstrip() == "---" and state == 0: if line.rstrip() == "---" and state == 0:
......
...@@ -28,6 +28,7 @@ class SuppressKnown(logging.Filter): ...@@ -28,6 +28,7 @@ class SuppressKnown(logging.Filter):
""" """
def __init__(self, db_file=None): def __init__(self, db_file=None):
super().__init__()
if db_file: if db_file:
self.db_file = db_file self.db_file = db_file
else: else:
......
...@@ -27,7 +27,7 @@ import logging ...@@ -27,7 +27,7 @@ import logging
import os import os
import linkahead as db import linkahead as db
from linkahead.exceptions import TransactionError from linkahead.exceptions import TransactionError, BadQueryError
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -232,7 +232,7 @@ def find_records_that_reference_ids(referenced_ids, rt="", step_size=50): ...@@ -232,7 +232,7 @@ def find_records_that_reference_ids(referenced_ids, rt="", step_size=50):
[str(el) for el in subset])) [str(el) for el in subset]))
exps = db.execute_query(q_string) exps = db.execute_query(q_string)
record_ids.update([exp.id for exp in exps]) record_ids.update([exp.id for exp in exps])
except Exception as e: except (TransactionError, BadQueryError) as e:
print(e) print(e)
index += step_size index += step_size
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment