def transfer_names_to_address(self, quantity, address): if self.nameDictDict == None: print "get_own_names first" return print "About to transfer", quantity, self.get_template(), "to:", address print "proceed? (y/n)" read = raw_input() if read != "y": print "transfer stopped by user" return c = 1 for i in range(params.PIECES - 1, -1, -1): name = self.get_name(i) if name in self.nameDictDict: r = pnc.name_update(name, transferTarget=address) print "transfer(" + str(c) + "/" + str(quantity) + "):", name, "done:\n ", r self.nameDictDict.pop(name) if c == quantity: break c += 1 print "transfer: done"
nameDictList = nameDictListSoon updateCost = len(nameDictList) * 0.005 print "Updating will cost at most %.6f namecoins" % updateCost if info["balance"] < updateCost: print "Balance too low to update all domains. Quitting." raise Exception("Balance too low.") print "random delay between updates: %d seconds" % randomDelayMax print "press enter to proceed; ctrl-c to stop" try: raw_input() except KeyboardInterrupt: raise SystemExit("manual interruption") print "updating..." for nd in nameDictList: print nd["name"], pnc.escape(nd["value"]) try: r = pnc.name_update(nd["name"], pnc.quote(pnc.escape(nd["value"]))) except pynamecoin.BitcoinError as e: message = e.args[0] if "pending operations" in message: print "Pending operations on %s - skipping." % nd["name"] pass raise print r print time.sleep(random.randint(0, randomDelayMax)) print "done. remember it will take 1 block until the update will be reflected."