jp (pubsub, common): fixed last item edition (keep item id instead of creating a new one)
This commit is contained in:
parent
c2ae6579c3
commit
364130bcbe
1 changed files with 8 additions and 9 deletions
|
|
@ -331,12 +331,13 @@ class Edit(base.CommandBase, common.BaseEdit):
|
|||
item_raw = self.host.bridge.psItemsGet(service, node, 1, items, "", {}, self.profile)[0][0]
|
||||
parser = etree.XMLParser(remove_blank_text=True)
|
||||
item_elt = etree.fromstring(item_raw, parser)
|
||||
item_id = item_elt.get('id')
|
||||
try:
|
||||
payload = item_elt[0]
|
||||
except IndexError:
|
||||
self.disp(_(u'Item has not payload'), 1)
|
||||
return u''
|
||||
return etree.tostring(payload, encoding="unicode", pretty_print=True)
|
||||
return etree.tostring(payload, encoding="unicode", pretty_print=True), item_id
|
||||
|
||||
def start(self):
|
||||
self.pubsub_service, self.pubsub_node, self.pubsub_item, content_file_path, content_file_obj = self.getItemPath(self.args.item)
|
||||
|
|
|
|||
Loading…
Reference in a new issue