Remove extra prints from workers. Fixes: #15
This commit is contained in:
10
workers.py
10
workers.py
@@ -80,7 +80,6 @@ def update_proceedings(
|
|||||||
if not query.exec():
|
if not query.exec():
|
||||||
query_error(query)
|
query_error(query)
|
||||||
assert isinstance(text, str)
|
assert isinstance(text, str)
|
||||||
print(f"text: {text.lower()}")
|
|
||||||
#
|
#
|
||||||
# If cert is denied, a petion for rehearing can be requested.
|
# If cert is denied, a petion for rehearing can be requested.
|
||||||
# The petitioner has 40 days to file for a rehearing.
|
# The petitioner has 40 days to file for a rehearing.
|
||||||
@@ -156,9 +155,7 @@ def update_db(case_id: str, db: QSqlDatabase) -> int:
|
|||||||
assert isinstance(tmp, str)
|
assert isinstance(tmp, str)
|
||||||
matches = re.match(r"(No.)?\s*(\d+[-A]\d+).*$", tmp)
|
matches = re.match(r"(No.)?\s*(\d+[-A]\d+).*$", tmp)
|
||||||
assert matches is not None
|
assert matches is not None
|
||||||
print(matches, matches.groups())
|
|
||||||
docket_id = matches.group(2)
|
docket_id = matches.group(2)
|
||||||
print(f"Found {docket_id}")
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Title is second row, first column
|
# Title is second row, first column
|
||||||
@@ -288,7 +285,6 @@ class updateThread(QThread):
|
|||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super(updateThread, self).__init__()
|
super(updateThread, self).__init__()
|
||||||
print("updateThread: __init__(docket_id)")
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def setDocketId(self, docket_id: str) -> None:
|
def setDocketId(self, docket_id: str) -> None:
|
||||||
@@ -296,7 +292,6 @@ class updateThread(QThread):
|
|||||||
return
|
return
|
||||||
|
|
||||||
def run(self) -> None:
|
def run(self) -> None:
|
||||||
print(f"updateThread: running on {self.currentThread()}")
|
|
||||||
db = QSqlDatabase.cloneDatabase("qt_sql_default_connection", "update")
|
db = QSqlDatabase.cloneDatabase("qt_sql_default_connection", "update")
|
||||||
if not db.open():
|
if not db.open():
|
||||||
print(db.lastError())
|
print(db.lastError())
|
||||||
@@ -306,7 +301,6 @@ class updateThread(QThread):
|
|||||||
db.close()
|
db.close()
|
||||||
del db
|
del db
|
||||||
QSqlDatabase.removeDatabase("update")
|
QSqlDatabase.removeDatabase("update")
|
||||||
print(f"updateThread: run() returns {case_id}")
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
@@ -322,7 +316,6 @@ class loadCases(QThread):
|
|||||||
|
|
||||||
query = QSqlQuery(db)
|
query = QSqlQuery(db)
|
||||||
query.prepare("SELECT * FROM history WHERE year = :year")
|
query.prepare("SELECT * FROM history WHERE year = :year")
|
||||||
print(f"year = {self.year}")
|
|
||||||
query.bindValue(":year", self.year)
|
query.bindValue(":year", self.year)
|
||||||
if not query.exec():
|
if not query.exec():
|
||||||
query_error(query)
|
query_error(query)
|
||||||
@@ -356,11 +349,9 @@ class loadCases(QThread):
|
|||||||
query_error(query)
|
query_error(query)
|
||||||
if query.next():
|
if query.next():
|
||||||
if query.value("active") == 0:
|
if query.value("active") == 0:
|
||||||
print("Already exists and is inactive")
|
|
||||||
self.number += 1
|
self.number += 1
|
||||||
continue
|
continue
|
||||||
result = update_db(docket_id, db)
|
result = update_db(docket_id, db)
|
||||||
print(f"result: {result}")
|
|
||||||
if result < 0:
|
if result < 0:
|
||||||
self.year = f"{int(self.year) - 1:02d}"
|
self.year = f"{int(self.year) - 1:02d}"
|
||||||
if self.number > 1:
|
if self.number > 1:
|
||||||
@@ -373,7 +364,6 @@ class loadCases(QThread):
|
|||||||
query_error(query)
|
query_error(query)
|
||||||
|
|
||||||
query.prepare("SELECT * FROM history WHERE year = :year")
|
query.prepare("SELECT * FROM history WHERE year = :year")
|
||||||
print(f"year = {self.year}")
|
|
||||||
query.bindValue(":year", self.year)
|
query.bindValue(":year", self.year)
|
||||||
if not query.exec():
|
if not query.exec():
|
||||||
query_error(query)
|
query_error(query)
|
||||||
|
|||||||
Reference in New Issue
Block a user