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>
This commit is contained in:
parent
18bf641777
commit
2fe6f551d9
@ -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:
|
||||
|
@ -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():
|
||||
if self.preserve_special_cases:
|
||||
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)
|
||||
|
||||
|
||||
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}.")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user