| 576 | main() |
| 577 | |
| 578 | def genMilAddr(): #Generate address |
| 579 | global usrPrompt |
| 580 | maxn = 0 |
| 581 | try: |
| 582 | response = api.listAddresses2() |
| 583 | if "API Error 0020" in response: return |
| 584 | addresses = json.loads(response) |
| 585 | for entry in addresses['addresses']: |
| 586 | if entry['label'].decode('base64')[:6] == "random": |
| 587 | newn = int(entry['label'].decode('base64')[6:]) |
| 588 | if maxn < newn: |
| 589 | maxn = newn |
| 590 | except: |
| 591 | print "\n Some error\n" |
| 592 | print "\n Starting at " + str(maxn) + "\n" |
| 593 | for i in range(maxn, 10000): |
| 594 | lbl = "random" + str(i) |
| 595 | addressLabel = lbl.encode('base64') |
| 596 | try: |
| 597 | api.createRandomAddress(addressLabel) # generatedAddress = |
| 598 | except: |
| 599 | print '\n Connection Error\n' |
| 600 | usrPrompt = 0 |
| 601 | main() |
| 602 | |
| 603 | def saveFile(fileName, fileData): #Allows attachments and messages/broadcats to be saved |
| 604 | |