jp: all commands now use the new start method and set need_loop in __init__ when needed

This commit is contained in:
Goffi 2016-02-29 16:52:51 +01:00
commit 169bc43793

View file

@ -30,6 +30,7 @@ __commands__ = ["Blog"]
class Import(base.CommandAnswering):
def __init__(self, host):
super(Import, self).__init__(host, 'import', use_progress=True, help=_(u'import an external blog'))
self.need_loop=True
def add_parser_options(self):
self.parser.add_argument("importer", type=base.unicode_decoder, nargs='?', help=_(u"importer name, nothing to display importers list"))
@ -67,11 +68,7 @@ class Import(base.CommandAnswering):
self.disp(_("Error while trying to upload a blog: {reason}").format(reason=failure), error=True)
self.host.quit(1)
def connected(self):
"""Send files to jabber contact"""
self.need_loop=True
super(Import, self).connected()
def start(self):
if self.args.location is None:
for name in ('option', 'service', 'no_images_upload'):
if getattr(self.args, name):
@ -108,7 +105,7 @@ class Import(base.CommandAnswering):
class Blog(base.CommandBase):
subcommands = (Import,)
subcommands = (Edit, Import)
def __init__(self, host):
super(Blog, self).__init__(host, 'blog', use_profile=False, help=_('blog/microblog management'))