show metadata found in blockchain in console

This commit is contained in:
Jimmy Kiselak 2015-09-22 12:21:16 -04:00
parent dfca7bc2c4
commit 8f6e886821

View file

@ -381,7 +381,7 @@ class AddStream(ControlHandler):
self.options_left = self.metadata.options.get_downloader_options(self.metadata.validator,
self.payment_rate_manager)
prompt = "Stream info:\n"
for info_line in self.metadata.validator.info_to_show():
for info_line in self._get_info_to_show():
prompt += info_line[0] + ": " + info_line[1] + "\n"
prompt += "\nOptions:\n"
for option in self.options_left:
@ -389,6 +389,9 @@ class AddStream(ControlHandler):
prompt += "\nModify options? (y/n)"
return str(prompt)
def _get_info_to_show(self):
return self.metadata.validator.info_to_show()
def _get_list_of_option_types(self):
options_string = ""
for i, option_type in enumerate(self.current_option.option_types):
@ -509,7 +512,7 @@ class AddStreamFromLBRYcrdName(AddStreamFromHash):
def __init__(self, sd_identifier, session, wallet):
AddStreamFromHash.__init__(self, sd_identifier, session)
self.wallet = wallet
self.resolved_nome = None
self.resolved_name = None
self.description = None
self.key_fee = None
self.key_fee_address = None
@ -559,6 +562,17 @@ class AddStreamFromLBRYcrdName(AddStreamFromHash):
return self.wallet.send_points_to_address(reserved_points, self.key_fee)
return defer.succeed(True)
def _get_info_to_show(self):
i = AddStream._get_info_to_show(self)
if self.description is not None:
i.append(("description", self.description))
if self.key_fee is None or self.key_fee_address is None:
i.append(("decryption key fee", "Free"))
else:
i.append(("decription key fee", str(self.key_fee)))
i.append(("address to pay key fee", str(self.key_fee_address)))
return i
class AddStreamFromLBRYcrdNameFactory(ControlHandlerFactory):
control_handler_class = AddStreamFromLBRYcrdName