(self)
| 50 | return False |
| 51 | |
| 52 | def check_token(self): |
| 53 | if self.token and self.url: |
| 54 | if self.token_is_available(): |
| 55 | return True |
| 56 | |
| 57 | while True: |
| 58 | logger.info("Users in mainland China should use https://api.zoomeye.org, " |
| 59 | "while other users should use https://api.zoomeye.ai.") |
| 60 | self.url = input("ZoomEye Url:").rstrip('/') |
| 61 | self.token = getpass.getpass("ZoomEye API token: (input will hidden)") |
| 62 | if self.token_is_available(): |
| 63 | self.write_conf() |
| 64 | return True |
| 65 | else: |
| 66 | logger.error("The ZoomEye api token is incorrect, Please enter the correct api token.") |
| 67 | |
| 68 | def write_conf(self): |
| 69 | if not self.parser.has_section("ZoomEye"): |
no test coverage detected