Compare commits

...

2 commits

Author SHA1 Message Date
49c58c94da Fix bug 2025-04-09 09:30:59 -04:00
70f8fc9726 Fix linter issues 2025-04-09 09:30:52 -04:00
2 changed files with 5 additions and 14 deletions

View file

@ -1,6 +1,5 @@
#! /usr/bin/env python3
import os
import argparse
from xenu_nntp.config import Config

View file

@ -16,7 +16,7 @@ from xenu_nntp.response import Response, ResponseCode
from xenu_nntp.newsgroup import Newsgroup
from xenu_nntp.user import User, UserPermission
from xenu_nntp.message import (
Message, MessageRange, MessagePart, each_line
Message, MessageRange, MessagePart
)
class SessionMode(enum.Enum):
@ -339,7 +339,7 @@ class Session(Connection):
for newsgroup in self.each_newsgroup():
self.print("%s %d %s" % (
name,
newsgroup.name,
newsgroup.created_on.timestamp(),
newsgroup.created_by
))
@ -439,12 +439,8 @@ class Session(Connection):
return datetime.datetime(yyyy, mm, dd, hh, MM, ss)
def _cmd_newnews(self, wildmat, datestr, timestr, *args):
gmt = False
if len(args) == 1:
if args[0] == "GMT":
gmt = True
else:
if args[0] != "GMT":
return self.send_response(ResponseCode.NNTP_SYNTAX_ERROR, "Only optional 'GMT' allowed")
elif len(args) > 1:
return self.send_response(ResponseCode.NNTP_SYNTAX_ERROR, "Too many arguments")
@ -483,12 +479,8 @@ class Session(Connection):
return self.end()
def _cmd_newgroups(self, datestr, timestr, *args):
gmt = False
if len(args) == 1:
if args[0] == "GMT":
gmt = True
else:
if args[0] != "GMT":
return self.respond(ResponseCode.NNTP_SYNTAX_ERROR, "Only optional 'GMT' allowed")
elif len(args) > 1:
return self.respond(ResponseCode.NNTP_SYNTAX_ERROR, "Too many arguments")
@ -723,7 +715,7 @@ class Session(Connection):
) values (%s, %s)
"""
cr = self.db.execute(sql, (newsgroup.id, message.id))
self.db.execute(sql, (newsgroup.id, message.id))
self.db.commit()