Mercurial > libervia-backend
comparison frontends/src/jp/cmd_blog.py @ 2370:2c2b826b0bb3
plugin import: node can now be specified + added a "session" dict to keep import session data:
import session data are data that can be used by importer to store anything which can be useful to keep between import methods.
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 06 Oct 2017 08:52:51 +0200 |
parents | 01877048c94a |
children | 8b37a62336c3 |
comparison
equal
deleted
inserted
replaced
2369:cdaa58e14553 | 2370:2c2b826b0bb3 |
---|---|
581 self.parser.add_argument("--ignore-tls-errors", action="store_true", help=_("ignore invalide TLS certificate for uploads")) | 581 self.parser.add_argument("--ignore-tls-errors", action="store_true", help=_("ignore invalide TLS certificate for uploads")) |
582 self.parser.add_argument('-o', '--option', action='append', nargs=2, default=[], metavar=(u'NAME', u'VALUE'), | 582 self.parser.add_argument('-o', '--option', action='append', nargs=2, default=[], metavar=(u'NAME', u'VALUE'), |
583 help=_(u"importer specific options (see importer description)")) | 583 help=_(u"importer specific options (see importer description)")) |
584 self.parser.add_argument('--service', type=base.unicode_decoder, default=u'', metavar=u'PUBSUB_SERVICE', | 584 self.parser.add_argument('--service', type=base.unicode_decoder, default=u'', metavar=u'PUBSUB_SERVICE', |
585 help=_(u"PubSub service where the items must be uploaded (default: server)")) | 585 help=_(u"PubSub service where the items must be uploaded (default: server)")) |
586 self.parser.add_argument('-n', '--node', type=base.unicode_decoder, default=u'', metavar=u'PUBSUB_NODE', | |
587 help=_(u"PubSub node where the items must be uploaded (default: tickets' defaults)")) | |
586 self.parser.add_argument("location", type=base.unicode_decoder, nargs='?', | 588 self.parser.add_argument("location", type=base.unicode_decoder, nargs='?', |
587 help=_(u"importer data location (see importer description), nothing to show importer description")) | 589 help=_(u"importer data location (see importer description), nothing to show importer description")) |
588 | 590 |
589 def onProgressStarted(self, metadata): | 591 def onProgressStarted(self, metadata): |
590 self.disp(_(u'Blog upload started'),2) | 592 self.disp(_(u'Blog upload started'),2) |
639 self.parser.error(u"upload-ignore-host option can't be used when no-images-upload is set") | 641 self.parser.error(u"upload-ignore-host option can't be used when no-images-upload is set") |
640 elif self.args.upload_ignore_host: | 642 elif self.args.upload_ignore_host: |
641 options['upload_ignore_host'] = self.args.upload_ignore_host | 643 options['upload_ignore_host'] = self.args.upload_ignore_host |
642 def gotId(id_): | 644 def gotId(id_): |
643 self.progress_id = id_ | 645 self.progress_id = id_ |
644 self.host.bridge.blogImport(self.args.importer, self.args.location, options, self.args.service, self.profile, | 646 self.host.bridge.blogImport(self.args.importer, self.args.location, options, self.args.service, self.args.node, self.profile, |
645 callback=gotId, errback=self.error) | 647 callback=gotId, errback=self.error) |
646 | 648 |
647 | 649 |
648 class Blog(base.CommandBase): | 650 class Blog(base.CommandBase): |
649 subcommands = (Get, Edit, Preview, Import) | 651 subcommands = (Get, Edit, Preview, Import) |