new parameter -t to 'post' command
This commit is contained in:
parent
144bb8a7e4
commit
2a964247e6
1 changed files with 38 additions and 32 deletions
|
|
@ -126,14 +126,15 @@ class MessagesListFormatter(IFormatter):
|
|||
message.title,
|
||||
backend)
|
||||
else:
|
||||
result = u'%s%s* (%s@%s)%s %s <%s> %s\n' % (depth * ' ',
|
||||
ReplApplication.BOLD,
|
||||
message.id,
|
||||
backend,
|
||||
flags,
|
||||
ReplApplication.NC,
|
||||
message.sender,
|
||||
message.title)
|
||||
result = u'%s%s* (%s.%s@%s)%s %s <%s> %s\n' % (depth * ' ',
|
||||
ReplApplication.BOLD,
|
||||
message.thread.id,
|
||||
message.id,
|
||||
backend,
|
||||
flags,
|
||||
ReplApplication.NC,
|
||||
message.sender,
|
||||
message.title)
|
||||
if message.children:
|
||||
if depth >= 0:
|
||||
depth += 1
|
||||
|
|
@ -164,6 +165,9 @@ class Boobmsg(ReplApplication):
|
|||
group.add_option('--to_file', action='store',
|
||||
help='File to export result', type="string",
|
||||
dest="filename")
|
||||
group.add_option('-t', '--title', action='store',
|
||||
help='For the "post" command, set a title to message',
|
||||
type='string', dest='title')
|
||||
|
||||
def load_default_backends(self):
|
||||
self.load_backends(ICapMessages, storage=self.create_storage())
|
||||
|
|
@ -229,15 +233,17 @@ class Boobmsg(ReplApplication):
|
|||
|
||||
if '.' in receiver:
|
||||
# It's a reply
|
||||
thread_id, parent_id = receiver.split('.', 1)
|
||||
thread_id, parent_id = receiver.rsplit('.', 1)
|
||||
else:
|
||||
# It's an original message
|
||||
thread_id = receiver
|
||||
parent_id = None
|
||||
|
||||
|
||||
thread = Thread(thread_id)
|
||||
message = Message(thread,
|
||||
0,
|
||||
title=self.options.title,
|
||||
parent=Message(thread, parent_id) if parent_id else None,
|
||||
content=text)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue