comparison sat_frontends/jp/cmd_message.py @ 2824:0ae25883e223

jp (message/mam): --start doesn't defaut anymore to "1 day ago", it is now unset by default
author Goffi <goffi@goffi.org>
date Fri, 01 Mar 2019 14:45:50 +0100
parents fd45089b3a92
children ab2696e34d29
comparison
equal deleted inserted replaced
2823:11afbbce40d1 2824:0ae25883e223
212 self.parser.add_argument( 212 self.parser.add_argument(
213 "-s", "--service", type=base.unicode_decoder, default=u"", 213 "-s", "--service", type=base.unicode_decoder, default=u"",
214 help=_(u"jid of the service (default: profile's server")) 214 help=_(u"jid of the service (default: profile's server"))
215 self.parser.add_argument( 215 self.parser.add_argument(
216 "-S", "--start", dest="mam_start", type=base.date_decoder, 216 "-S", "--start", dest="mam_start", type=base.date_decoder,
217 help=_(u"start fetching archive from this date (default: 1 day ago)")) 217 help=_(
218 u"start fetching archive from this date (default: from the beginning)"))
218 self.parser.add_argument( 219 self.parser.add_argument(
219 "-E", "--end", dest="mam_end", type=base.date_decoder, 220 "-E", "--end", dest="mam_end", type=base.date_decoder,
220 help=_(u"end fetching archive after this date (default: no limit)")) 221 help=_(u"end fetching archive after this date (default: no limit)"))
221 self.parser.add_argument( 222 self.parser.add_argument(
222 "-W", "--with", dest="mam_with", type=base.unicode_decoder, 223 "-W", "--with", dest="mam_with", type=base.unicode_decoder,
255 self.host.bridge.sessionInfosGet(self.profile, 256 self.host.bridge.sessionInfosGet(self.profile,
256 callback=partial(self._sessionInfosGetCb, data=data, metadata=metadata), 257 callback=partial(self._sessionInfosGetCb, data=data, metadata=metadata),
257 errback=self.errback) 258 errback=self.errback)
258 259
259 def start(self): 260 def start(self):
260 if self.args.mam_start is None: 261 extra = {}
261 self.args.mam_start = base.date_decoder(u"-1 day") 262 if self.args.mam_start is not None:
262 extra = { 263 extra[u"mam_start"] = float(self.args.mam_start)
263 u"mam_start": float(self.args.mam_start),
264 }
265 if self.args.mam_end is not None: 264 if self.args.mam_end is not None:
266 extra[u"mam_end"] = float(self.args.mam_end) 265 extra[u"mam_end"] = float(self.args.mam_end)
267 if self.args.mam_with is not None: 266 if self.args.mam_with is not None:
268 extra[u"mam_with"] = self.args.mam_with 267 extra[u"mam_with"] = self.args.mam_with
269 for suff in ('max', 'after', 'before', 'index'): 268 for suff in ('max', 'after', 'before', 'index'):