Compare commits
2 commits
973f0d9768
...
49c58c94da
Author | SHA1 | Date | |
---|---|---|---|
49c58c94da | |||
70f8fc9726 |
2 changed files with 5 additions and 14 deletions
|
@ -1,6 +1,5 @@
|
|||
#! /usr/bin/env python3
|
||||
|
||||
import os
|
||||
import argparse
|
||||
|
||||
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.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()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue