Skip to content

Commit

Permalink
Changes from merge conflicts..
Browse files Browse the repository at this point in the history
Signed-off-by: Julie Langmann <[email protected]>
  • Loading branch information
mrloop committed Sep 18, 2023
1 parent bc712ae commit 62c0089
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 23 deletions.
16 changes: 8 additions & 8 deletions src/deadline/client/ui/dialogs/submit_job_to_deadline_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/deadline/client/ui/widgets/job_bundle_settings_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 0 additions & 13 deletions src/deadline/client/ui/widgets/shared_job_settings_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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]):
"""
Expand Down Expand Up @@ -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"""
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 62c0089

Please sign in to comment.