(define)
| 67 | json_flags['lock-on-first-connection'] = True |
| 68 | |
| 69 | def process_build_flag(define): |
| 70 | if define.startswith("-D") or define.startswith("!-D"): |
| 71 | if "MY_BINDING_PHRASE" in define: |
| 72 | bindingPhraseHash = hashlib.md5(define.encode()).digest() |
| 73 | UIDbytes = ",".join(list(map(str, bindingPhraseHash))[0:6]) |
| 74 | define = "-DMY_UID=" + UIDbytes |
| 75 | sys.stdout.write("\u001b[32mUID bytes: " + UIDbytes + "\n") |
| 76 | sys.stdout.flush() |
| 77 | if "HOME_WIFI_SSID=" in define: |
| 78 | parts = re.search(r"(.*)=\w*\"(.*)\"$", define) |
| 79 | if parts and parts.group(2): |
| 80 | define = "-DHOME_WIFI_SSID=" + string_to_ascii(parts.group(2)) |
| 81 | if "HOME_WIFI_PASSWORD=" in define: |
| 82 | parts = re.search(r"(.*)=\w*\"(.*)\"$", define) |
| 83 | if parts and parts.group(2): |
| 84 | define = "-DHOME_WIFI_PASSWORD=" + string_to_ascii(parts.group(2)) |
| 85 | if "DEVICE_NAME=" in define: |
| 86 | parts = re.search(r"(.*)=\w*'?\"(.*)\"'?$", define) |
| 87 | if parts and parts.group(2): |
| 88 | env['DEVICE_NAME'] = parts.group(2) |
| 89 | if not define in build_flags: |
| 90 | build_flags.append(define) |
| 91 | |
| 92 | def parse_flags(path): |
| 93 | global build_flags |
no test coverage detected