aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorWolfgang Müller2023-03-30 21:06:25 +0200
committerWolfgang Müller2023-03-30 21:06:25 +0200
commitbca0806c06baccd6775ea0e10a26f490602e9520 (patch)
treed012405be4e897cfda6f2b9f24d69589a762712f
parentdf585f56fb0bac5fc77fbbfc44276fe8c1f85f83 (diff)
downloadquarg-bca0806c06baccd6775ea0e10a26f490602e9520.tar.gz
Perform initial linting with ruff
Diffstat (limited to '')
-rw-r--r--quarg/database/filters.py4
-rw-r--r--quarg/database/tables.py12
-rw-r--r--quarg/quassel/formatter.py3
-rw-r--r--quarg/quassel/types.py1
-rw-r--r--quarg/utils.py4
5 files changed, 19 insertions, 5 deletions
diff --git a/quarg/database/filters.py b/quarg/database/filters.py
index a78b117..75142ac 100644
--- a/quarg/database/filters.py
+++ b/quarg/database/filters.py
@@ -1,6 +1,8 @@
-from sqlalchemy.sql.expression import or_, between
+from sqlalchemy.sql.expression import between, or_
+
from quarg.database.tables import Backlog, Buffer, Network, QuasselUser, Sender
+
def msg_like(query):
return Backlog.message.like(query, escape='\\')
diff --git a/quarg/database/tables.py b/quarg/database/tables.py
index 9b819d9..0b14eca 100644
--- a/quarg/database/tables.py
+++ b/quarg/database/tables.py
@@ -1,9 +1,17 @@
import datetime
-from sqlalchemy.schema import Column, ForeignKey
-from sqlalchemy.types import BigInteger, Boolean, DateTime, Integer, Text, TypeDecorator, TypeEngine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
+from sqlalchemy.schema import Column, ForeignKey
+from sqlalchemy.types import (
+ BigInteger,
+ Boolean,
+ DateTime,
+ Integer,
+ Text,
+ TypeDecorator,
+ TypeEngine,
+)
# Timestamps are saved in the database in UTC without timezone info, so attach
diff --git a/quarg/quassel/formatter.py b/quarg/quassel/formatter.py
index 6a78d7a..888d145 100644
--- a/quarg/quassel/formatter.py
+++ b/quarg/quassel/formatter.py
@@ -1,9 +1,10 @@
import datetime
-
from functools import partial
from typing import NamedTuple
+
from quarg.quassel.types import MessageType
+
class User(NamedTuple):
nick: str
host: str
diff --git a/quarg/quassel/types.py b/quarg/quassel/types.py
index 0ba5a11..2632151 100644
--- a/quarg/quassel/types.py
+++ b/quarg/quassel/types.py
@@ -1,5 +1,6 @@
from enum import Enum
+
class BufferType(Enum):
# INVALID = 0x0
STATUS = 0x1
diff --git a/quarg/utils.py b/quarg/utils.py
index 903c057..33b9198 100644
--- a/quarg/utils.py
+++ b/quarg/utils.py
@@ -1,6 +1,8 @@
import sys
+
import dateutil.parser
+
def errx(msg):
sys.exit(f'quarg: {msg}')
@@ -9,7 +11,7 @@ def parse_isodate(date):
parsed = dateutil.parser.isoparse(date)
except ValueError as err:
errx(f'isoparse: invalid date format \'{date}\', {err}')
- except OverflowError as err:
+ except OverflowError:
errx(f'isoparse: date overflows: \'{date}\'')
# If no offset is given, assume local time