diff --git a/bin/xenu-nntp-server b/bin/xenu-nntp-server index 9a07bac..a86857a 100755 --- a/bin/xenu-nntp-server +++ b/bin/xenu-nntp-server @@ -1,6 +1,5 @@ #! /usr/bin/env python3 -import os import argparse from xenu_nntp.config import Config diff --git a/lib/xenu_nntp/session.py b/lib/xenu_nntp/session.py index a3395ca..eb81229 100644 --- a/lib/xenu_nntp/session.py +++ b/lib/xenu_nntp/session.py @@ -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): @@ -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()