ruff removed unused imports

This commit is contained in:
2023-01-19 21:34:09 +00:00
parent 89b0c0862e
commit 1be3a3892c
12 changed files with 64 additions and 117 deletions

View File

@@ -1,17 +1,14 @@
import csv
import os
import re
import time
from datetime import date, datetime
from pathlib import Path
from random import randint
from django.conf import settings
from django.template.defaultfilters import slugify
from django.utils.timezone import get_current_timezone, make_aware
from parsers.people import GetPersonExpeditionNameLookup
from troggle.core.models.caves import Cave, GetCaveLookup, LogbookEntry, PersonTrip
from troggle.core.models.caves import GetCaveLookup, LogbookEntry, PersonTrip
from troggle.core.models.troggle import DataIssue, Expedition
from troggle.core.utils import TROG, save_carefully
@@ -254,7 +251,7 @@ def EnterLogIntoDbase(date, place, title, text, trippeople, expedition, logtime_
text = text.replace("\n\n\n", "\n\n")
# Check for an existing copy of the current entry, and save
expeditionday = expedition.get_expedition_day(date)
expedition.get_expedition_day(date)
lookupAttribs = {"date": date, "title": title}
# 'cave' is converted to a string doing this, which renders as the cave slug.
# but it is a db query which we should try to avoid - rewrite this
@@ -574,7 +571,6 @@ def parser_blog(year, expedition, txt, sq=""):
"""
global logentries
global logdataissues
errorcount = 0
tripheads = re.findall(
r"<article class=\"message message--post js-post js-inlineModContainer\s*\"\s*([\s\S]*?)(?=</article)", txt
@@ -791,9 +787,9 @@ def LoadLogbooks():
DataIssue.objects.filter(parser="logbooks").delete()
expos = Expedition.objects.all()
if len(expos) <= 1:
message = f" ! - No expeditions found. Load 'people' first"
message = " ! - No expeditions found. Load 'people' first"
DataIssue.objects.create(parser="logbooks", message=message)
logdataissues[f"sqlfail 0000"] = message
logdataissues["sqlfail 0000"] = message
print(message)
return
@@ -807,7 +803,6 @@ def LoadLogbooks():
nologbook = noexpo + lostlogbook + sqlfail
nlbe = {}
expd = {}
loglist = []
bloglist = []