Fix linter issues
This commit is contained in:
parent
973f0d9768
commit
70f8fc9726
2 changed files with 4 additions and 13 deletions
|
@ -1,6 +1,5 @@
|
||||||
#! /usr/bin/env python3
|
#! /usr/bin/env python3
|
||||||
|
|
||||||
import os
|
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
from xenu_nntp.config import Config
|
from xenu_nntp.config import Config
|
||||||
|
|
|
@ -16,7 +16,7 @@ from xenu_nntp.response import Response, ResponseCode
|
||||||
from xenu_nntp.newsgroup import Newsgroup
|
from xenu_nntp.newsgroup import Newsgroup
|
||||||
from xenu_nntp.user import User, UserPermission
|
from xenu_nntp.user import User, UserPermission
|
||||||
from xenu_nntp.message import (
|
from xenu_nntp.message import (
|
||||||
Message, MessageRange, MessagePart, each_line
|
Message, MessageRange, MessagePart
|
||||||
)
|
)
|
||||||
|
|
||||||
class SessionMode(enum.Enum):
|
class SessionMode(enum.Enum):
|
||||||
|
@ -439,12 +439,8 @@ class Session(Connection):
|
||||||
return datetime.datetime(yyyy, mm, dd, hh, MM, ss)
|
return datetime.datetime(yyyy, mm, dd, hh, MM, ss)
|
||||||
|
|
||||||
def _cmd_newnews(self, wildmat, datestr, timestr, *args):
|
def _cmd_newnews(self, wildmat, datestr, timestr, *args):
|
||||||
gmt = False
|
|
||||||
|
|
||||||
if len(args) == 1:
|
if len(args) == 1:
|
||||||
if args[0] == "GMT":
|
if args[0] != "GMT":
|
||||||
gmt = True
|
|
||||||
else:
|
|
||||||
return self.send_response(ResponseCode.NNTP_SYNTAX_ERROR, "Only optional 'GMT' allowed")
|
return self.send_response(ResponseCode.NNTP_SYNTAX_ERROR, "Only optional 'GMT' allowed")
|
||||||
elif len(args) > 1:
|
elif len(args) > 1:
|
||||||
return self.send_response(ResponseCode.NNTP_SYNTAX_ERROR, "Too many arguments")
|
return self.send_response(ResponseCode.NNTP_SYNTAX_ERROR, "Too many arguments")
|
||||||
|
@ -483,12 +479,8 @@ class Session(Connection):
|
||||||
return self.end()
|
return self.end()
|
||||||
|
|
||||||
def _cmd_newgroups(self, datestr, timestr, *args):
|
def _cmd_newgroups(self, datestr, timestr, *args):
|
||||||
gmt = False
|
|
||||||
|
|
||||||
if len(args) == 1:
|
if len(args) == 1:
|
||||||
if args[0] == "GMT":
|
if args[0] != "GMT":
|
||||||
gmt = True
|
|
||||||
else:
|
|
||||||
return self.respond(ResponseCode.NNTP_SYNTAX_ERROR, "Only optional 'GMT' allowed")
|
return self.respond(ResponseCode.NNTP_SYNTAX_ERROR, "Only optional 'GMT' allowed")
|
||||||
elif len(args) > 1:
|
elif len(args) > 1:
|
||||||
return self.respond(ResponseCode.NNTP_SYNTAX_ERROR, "Too many arguments")
|
return self.respond(ResponseCode.NNTP_SYNTAX_ERROR, "Too many arguments")
|
||||||
|
@ -723,7 +715,7 @@ class Session(Connection):
|
||||||
) values (%s, %s)
|
) values (%s, %s)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
cr = self.db.execute(sql, (newsgroup.id, message.id))
|
self.db.execute(sql, (newsgroup.id, message.id))
|
||||||
|
|
||||||
self.db.commit()
|
self.db.commit()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue