From 62c00892dd24c627933bb204dc439b8dab04e4bb Mon Sep 17 00:00:00 2001 From: Julie Langmann <12345+jlangm@users.noreply.github.com> Date: Mon, 18 Sep 2023 19:07:25 +0000 Subject: [PATCH] Changes from merge conflicts.. Signed-off-by: Julie Langmann <12345+jlangm@users.noreply.github.com> --- .../ui/dialogs/submit_job_to_deadline_dialog.py | 16 ++++++++-------- .../client/ui/widgets/job_bundle_settings_tab.py | 2 -- .../client/ui/widgets/shared_job_settings_tab.py | 13 ------------- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/deadline/client/ui/dialogs/submit_job_to_deadline_dialog.py b/src/deadline/client/ui/dialogs/submit_job_to_deadline_dialog.py index 50525b5f1..0fc336cd3 100644 --- a/src/deadline/client/ui/dialogs/submit_job_to_deadline_dialog.py +++ b/src/deadline/client/ui/dialogs/submit_job_to_deadline_dialog.py @@ -37,8 +37,9 @@ from ..widgets.job_attachments_tab import JobAttachmentsWidget from ..widgets.shared_job_settings_tab import SharedJobSettingsWidget from . import DeadlineConfigDialog, DeadlineLoginDialog -from ...job_bundle.submission import AssetReferences, FlatAssetReferences +from ...job_bundle.submission import AssetReferences from ...job_bundle.loader import read_yaml_or_json_object +from ...job_bundle.parameters import read_job_bundle_parameters from ..dataclasses import JobBundleSettings logger = logging.getLogger(__name__) @@ -104,8 +105,8 @@ def refresh( self, *, job_settings: Optional[Any] = None, - auto_detected_attachments: Optional[FlatAssetReferences] = None, - attachments: Optional[FlatAssetReferences] = None, + auto_detected_attachments: Optional[AssetReferences] = None, + attachments: Optional[AssetReferences] = None, ): # Refresh the UI components self.refresh_deadline_settings() @@ -307,17 +308,16 @@ def on_browse_bundle(self): read_yaml_or_json_object(input_job_bundle_dir, "asset_references", False) or {} ) - asset_references = FlatAssetReferences.from_dict(asset_references_obj) + asset_references = AssetReferences.from_dict(asset_references_obj) # Load the template to get the bundle name template = read_yaml_or_json_object(input_job_bundle_dir, "template", True) name = ( template.get("name", "Job Bundle Submission") if template else "Job Bundle Submission" ) - job_settings = JobBundleSettings( - input_job_bundle_dir=input_job_bundle_dir, - name=name, - ) + + job_settings = JobBundleSettings(input_job_bundle_dir=input_job_bundle_dir, name=name) + job_settings.parameters = read_job_bundle_parameters(input_job_bundle_dir) self.refresh( job_settings=job_settings, auto_detected_attachments=asset_references, attachments=None diff --git a/src/deadline/client/ui/widgets/job_bundle_settings_tab.py b/src/deadline/client/ui/widgets/job_bundle_settings_tab.py index 34afef47a..c424a40f8 100644 --- a/src/deadline/client/ui/widgets/job_bundle_settings_tab.py +++ b/src/deadline/client/ui/widgets/job_bundle_settings_tab.py @@ -36,8 +36,6 @@ def __init__(self, initial_settings: JobBundleSettings, parent=None): self._build_ui(initial_settings) def refresh_ui(self, settings: JobBundleSettings): - self._build_ui(settings) - # Clear the layout for i in reversed(range(self.layout.count())): item = self.layout.takeAt(i) diff --git a/src/deadline/client/ui/widgets/shared_job_settings_tab.py b/src/deadline/client/ui/widgets/shared_job_settings_tab.py index 059e5b70f..d2040d465 100644 --- a/src/deadline/client/ui/widgets/shared_job_settings_tab.py +++ b/src/deadline/client/ui/widgets/shared_job_settings_tab.py @@ -100,8 +100,6 @@ def __init__( def refresh_ui(self, job_settings: Any): # Refresh the job settings in the UI self.shared_job_properties_box.refresh_ui(job_settings) - self.deadline_cloud_settings_box.refresh_ui(job_settings) - self.queue_parameters_box.refresh_ui(job_settings) self.refresh_queue_parameters() def refresh_queue_parameters(self): @@ -210,10 +208,6 @@ def _build_ui(self): def refresh_ui(self, settings: Any): self.sub_name_edit.setText(settings.name) self.desc_edit.setText(settings.description) - self.initial_status_box.setCurrentText("READY") - self.max_failed_tasks_count_box.setValue(20) - self.max_retries_per_task_box.setValue(5) - self.priority_box.setValue(50) def set_parameter_value(self, parameter: dict[str, Any]): """ @@ -295,7 +289,6 @@ def __init__(self, *, parent: Optional[QWidget] = None): self.layout.setFieldGrowthPolicy(QFormLayout.AllNonFixedFieldsGrow) self._build_ui() - self.refresh_ui(initial_settings) def _set_enabled_with_label(self, prop_name: str, enabled: bool): """Enable/disable a control w/ its label""" @@ -327,12 +320,6 @@ def refresh_setting_controls(self, deadline_authorized): self.farm_box.refresh(deadline_authorized) self.queue_box.refresh(deadline_authorized) - def refresh_ui(self, settings: Any): - self.initial_status_box.setCurrentText(settings.initial_status) - self.max_failed_tasks_count_box.setValue(settings.max_failed_tasks_count) - self.max_retries_per_task_box.setValue(settings.max_retries_per_task) - self.priority_box.setValue(settings.priority) - def update_settings(self, settings) -> None: """ Updates an Amazon Deadline Cloud settings object with the latest values.