diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-02-12 16:33:55 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-02-15 13:45:25 +0100 |
commit | 2fe6f551d955029638369e0801569441961ca04b (patch) | |
tree | ac47dc7e71c86b1739bb77b2590c78a283370ee5 /util/cmake | |
parent | 18bf641777d1f4baf5eb63f552b63685958f02f4 (diff) |
Do some miscellaneous tidy-up in util/cmake/
A typo-fix, a simplification and a trivial restructuring.
Change-Id: I434457c4eb83eebfb9b472c6914659199fe5be71
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'util/cmake')
-rw-r--r-- | util/cmake/README.md | 2 | ||||
-rwxr-xr-x | util/cmake/configurejson2cmake.py | 13 |
2 files changed, 5 insertions, 10 deletions
diff --git a/util/cmake/README.md b/util/cmake/README.md index 256e481680..f8a6e9f540 100644 --- a/util/cmake/README.md +++ b/util/cmake/README.md @@ -36,7 +36,7 @@ python3.7 -m pip install -r requirements.txt # Contributing to the scripts -You can verify if the styling of a script complaint with PEP8, with a couple of exceptions: +You can verify if the styling of a script is compliant with PEP8, with a couple of exceptions: Install [flake8](http://flake8.pycqa.org/en/latest/) (`pip install flake8`) and run it on the script you want to test: diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index a5d44b4195..b5e148f63c 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -1520,11 +1520,9 @@ class special_cased_file: def __exit__(self, type, value, trace_back): self.file.close() - if self.preserve_special_cases and self.sc_handler.handle_special_cases(): - os.replace(self.gen_file_path, self.file_path) - else: - os.replace(self.gen_file_path, self.file_path) - + if self.preserve_special_cases: + self.sc_handler.handle_special_cases() + os.replace(self.gen_file_path, self.file_path) def processJson(path, ctx, data, skip_special_case_preservation=False): ctx["project_dir"] = path @@ -1572,11 +1570,8 @@ def main(): print("This scripts needs one directory to process!") quit(1) - skip_special_case_preservation = False - if len(sys.argv) > 2 and sys.argv[2] == "-s": - skip_special_case_preservation = True - directory = sys.argv[1] + skip_special_case_preservation = '-s' in sys.argv[2:] print(f"Processing: {directory}.") |