diff options
| author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2024-06-14 15:43:04 +0200 |
|---|---|---|
| committer | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2024-06-17 08:12:30 +0000 |
| commit | 68a9eb0842d4147c8914da78e7d4e5eb3f760e0e (patch) | |
| tree | fd69d8b7baed086d3c3965f63c615585358d6de8 /sources/pyside-tools/deploy_lib/config.py | |
| parent | 7093016a138b79c335272d40ee7487bf19282541 (diff) | |
Desktop Deployment: Fix error
In the scenario where 'pyside6-deploy --init' is used on the first run
and for the consequent invocations, only running just 'pyside6-deploy'
without any additional options, the deployment should have worked.
This currently had a bug where it overrides the main Python entrypoint
file with the default option of 'main.py'. This issue is caused due to
the order of 'if' loop in the changed function.
Pick-to: 6.7
Task-number: PYSIDE-1612
Change-Id: I605c4b9ff2035e85c0b5f73049a3ecc84d0fd80c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside-tools/deploy_lib/config.py')
| -rw-r--r-- | sources/pyside-tools/deploy_lib/config.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sources/pyside-tools/deploy_lib/config.py b/sources/pyside-tools/deploy_lib/config.py index 5d5070bef..a26f1a2cf 100644 --- a/sources/pyside-tools/deploy_lib/config.py +++ b/sources/pyside-tools/deploy_lib/config.py @@ -142,19 +142,20 @@ class Config(BaseConfig): def set_or_fetch(self, config_property_val, config_property_key, config_property_group="app"): """ - Write to config_file if 'config_property_key' is known without config_file - Fetch and return from config_file if 'config_property_key' is unknown, but - config_file exists + If the value corresponding to the key exists in the config file, then return it. + Otherwise, set the value to the config file and return it. Otherwise, raise an exception """ - if config_property_val: + existing_value = self.get_value(config_property_group, config_property_key) + if existing_value: + return existing_value + elif config_property_val: self.set_value(config_property_group, config_property_key, str(config_property_val)) return config_property_val - elif self.get_value(config_property_group, config_property_key): - return self.get_value(config_property_group, config_property_key) else: raise RuntimeError( - f"[DEPLOY] No {config_property_key} specified in config file or as cli option" + f"[DEPLOY] No value for {config_property_key} specified in config file or as cli" + " option" ) @property |
