()
| 59 | |
| 60 | # def main(): header is required |
| 61 | def main(): |
| 62 | valid_site = False |
| 63 | valid_ip = False |
| 64 | valid_response = False |
| 65 | input_counter = 0 |
| 66 | |
| 67 | ################# |
| 68 | # get User Input |
| 69 | ################# |
| 70 | # ipaddr=input(setprompt(["9", "2"], "IP address to connect back on")) |
| 71 | while valid_ip != True and input_counter < 3: |
| 72 | ipaddr = input(core.setprompt(["9", "2"], "Enter the IP address to connect back on")) |
| 73 | valid_ip = core.validate_ip(ipaddr) |
| 74 | if not valid_ip: |
| 75 | if input_counter == 2: |
| 76 | core.print_error("\nMaybe you have the address written down wrong?") |
| 77 | sleep(4) |
| 78 | return |
| 79 | else: |
| 80 | input_counter += 1 |
| 81 | |
| 82 | # try: |
| 83 | # ratteport=int(input(setprompt(["9", "2"], "Port RATTE Server should listen on"))) |
| 84 | # while ratteport==0 or ratteport > 65535: |
| 85 | # print_warning('Port must not be equal to javaport!') |
| 86 | # ratteport=int(input(setprompt(["9", "2"], "Enter port RATTE Server should listen on"))) |
| 87 | # except ValueError: |
| 88 | # ratteport=8080 |
| 89 | |
| 90 | try: |
| 91 | ratteport = int(input(core.setprompt(["9", "2"], "Port RATTE Server should listen on [8080]"))) |
| 92 | while ratteport == 0 or ratteport > 65535: |
| 93 | if ratteport == 0: |
| 94 | core.print_warning(text.PORT_NOT_ZERO) |
| 95 | if ratteport > 65535: |
| 96 | core.print_warning(text.PORT_TOO_HIGH) |
| 97 | ratteport = int(input(core.setprompt(["9", "2"], "Enter port RATTE Server should listen on [8080]"))) |
| 98 | except ValueError: |
| 99 | # core.print_info("Port set to default of 8080") |
| 100 | ratteport = 8080 |
| 101 | |
| 102 | # persistent=input(setprompt(["9", "2"], "Should RATTE be persistent [no|yes]?")) |
| 103 | # if persistent == 'no' or persistent == '' or persistent == 'n': |
| 104 | # persistent='NO' |
| 105 | # else: |
| 106 | # persistent='YES' |
| 107 | |
| 108 | while not valid_response: |
| 109 | persistent = input(core.setprompt(["9", "2"], "Should RATTE be persistent [no|yes]?")) |
| 110 | persistent = str.lower(persistent) |
| 111 | if persistent == "no" or persistent == "n": |
| 112 | persistent = "NO" |
| 113 | valid_response = True |
| 114 | elif persistent == "yes" or persistent == "y": |
| 115 | persistent = "YES" |
| 116 | valid_response = True |
| 117 | else: |
| 118 | core.print_warning(text.YES_NO_RESPONSES) |
nothing calls this directly
no test coverage detected