Skip to content

Commit

Permalink
chore: update labels to sentence casing (#323)
Browse files Browse the repository at this point in the history
Signed-off-by: Morgan Epp <[email protected]>
  • Loading branch information
epmog authored Apr 30, 2024
1 parent 72d6c26 commit 23fcbdf
Show file tree
Hide file tree
Showing 19 changed files with 162 additions and 156 deletions.
6 changes: 3 additions & 3 deletions src/deadline/client/api/_loginout.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _login_deadline_cloud_monitor(
# Deadline Cloud monitor is a GUI app that will keep on running
# So we sit here and test that profile for validity until it works
if check_authentication_status(config) == AwsAuthenticationStatus.AUTHENTICATED:
return f"Deadline Cloud monitor Profile: {profile_name}"
return f"Deadline Cloud monitor profile: {profile_name}"
if on_cancellation_check:
# Check if the UI has signaled a cancel
if on_cancellation_check():
Expand All @@ -81,10 +81,10 @@ def _login_deadline_cloud_monitor(
# but let's be specific about Deadline Cloud monitor failing incase the error is non-obvious
# and let's tack on stdout incase it helps
err_prefix = (
f"Deadline Cloud monitor was not able to log into the {profile_name} profile: "
f"Deadline Cloud monitor was not able to log into the {profile_name} profile:"
)
out = p.stdout.read().decode("utf-8") if p.stdout else ""
raise DeadlineOperationError(f"{err_prefix}:\n{out}")
raise DeadlineOperationError(f"{err_prefix}\n{out}")

time.sleep(0.5)

Expand Down
4 changes: 2 additions & 2 deletions src/deadline/client/ui/dataclasses/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class JobBundleSettings: # pylint: disable=too-many-instance-attributes
submitter_name: str = field(default="JobBundle")

# Shared settings
name: str = field(default="Job Bundle")
name: str = field(default="Job bundle")
description: str = field(default="")

# Job Bundle settings
Expand All @@ -42,7 +42,7 @@ class CliJobSettings: # pylint: disable=too-many-instance-attributes
submitter_name: str = field(default="CLI")

# Shared settings
name: str = field(default="CLI Job")
name: str = field(default="CLI job")
description: str = field(default="")

# CLI job settings
Expand Down
12 changes: 6 additions & 6 deletions src/deadline/client/ui/dev_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ def __init__(self, parent=None):
)

def setup_ui(self):
submit = self.menuBar().addMenu("&Submit Job")
submit.addAction("Submit Job Bundle...", self.submit_job_bundle)
submit.addAction("Submit CLI Job...", self.submit_cli_job)
submit = self.menuBar().addMenu("&Submit job")
submit.addAction("Submit job bundle...", self.submit_job_bundle)
submit.addAction("Submit CLI job...", self.submit_cli_job)
account = self.menuBar().addMenu("&Account")
account.addAction("AWS Deadline Cloud Workstation Configuration...", self.configure)
account.addAction("AWS Deadline Cloud workstation configuration...", self.configure)
account.addAction("Log in to AWS Deadline Cloud...", self.login)
account.addAction("Log out of AWS Deadline Cloud...", self.logout)

Expand All @@ -59,7 +59,7 @@ def submit_job_bundle(self):
os.path.join(__file__, "../resources/cli_job_bundle")
)
input_job_bundle_dir = QFileDialog.getExistingDirectory(
self, "Choose Job Bundle Directory", input_job_bundle_dir
self, "Choose job bundle directory", input_job_bundle_dir
)
if input_job_bundle_dir:
show_job_bundle_submitter(
Expand Down Expand Up @@ -95,7 +95,7 @@ def app() -> None:
app.setStyle(QStyleFactory.create("fusion"))

# Set the application info.
app.setApplicationName("AWS Deadline Cloud Client Test GUI")
app.setApplicationName("AWS Deadline Cloud client test GUI")
app.setOrganizationName("AWS")
app.setOrganizationDomain("https://aws.amazon.com/")
icon = QIcon(str(Path(__file__).parent / "resources" / "deadline_logo.svg"))
Expand Down
42 changes: 22 additions & 20 deletions src/deadline/client/ui/dialogs/deadline_config_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, parent=None) -> None:
parent=parent, f=Qt.WindowSystemMenuHint | Qt.WindowTitleHint | Qt.WindowCloseButtonHint
)

self.setWindowTitle("AWS Deadline Cloud Workstation Configuration")
self.setWindowTitle("AWS Deadline Cloud workstation configuration")
self.deadline_authentication_status = DeadlineAuthenticationStatus.getInstance()
self._build_ui()

Expand Down Expand Up @@ -191,25 +191,25 @@ def _build_ui(self):
self._refresh_callbacks: List[Callable] = []

# Global settings
self.global_settings_group = QGroupBox(parent=self, title="Global Settings")
self.global_settings_group = QGroupBox(parent=self, title="Global settings")
self.layout.addWidget(self.global_settings_group)
global_settings_layout = QFormLayout(self.global_settings_group)
self._build_global_settings_ui(self.global_settings_group, global_settings_layout)

# AWS Profile-specific settings
self.profile_settings_group = QGroupBox(parent=self, title="Profile Settings")
self.profile_settings_group = QGroupBox(parent=self, title="Profile settings")
self.layout.addWidget(self.profile_settings_group)
profile_settings_layout = QFormLayout(self.profile_settings_group)
self._build_profile_settings_ui(self.profile_settings_group, profile_settings_layout)

# Farm-specific settings
self.farm_settings_group = QGroupBox(parent=self, title="Farm Settings")
self.farm_settings_group = QGroupBox(parent=self, title="Farm settings")
self.layout.addWidget(self.farm_settings_group)
farm_settings_layout = QFormLayout(self.farm_settings_group)
self._build_farm_settings_ui(self.farm_settings_group, farm_settings_layout)

# General settings
self.general_settings_group = QGroupBox(parent=self, title="General Settings")
self.general_settings_group = QGroupBox(parent=self, title="General settings")
self.layout.addWidget(self.general_settings_group)
general_settings_layout = QFormLayout(self.general_settings_group)
self._build_general_settings_ui(self.general_settings_group, general_settings_layout)
Expand All @@ -218,37 +218,39 @@ def _build_ui(self):

def _build_global_settings_ui(self, group, layout):
self.aws_profiles_box = QComboBox(parent=group)
aws_profile_label = self.labels["defaults.aws_profile_name"] = QLabel("AWS Profile")
aws_profile_label = self.labels["defaults.aws_profile_name"] = QLabel("AWS profile")
layout.addRow(aws_profile_label, self.aws_profiles_box)
self.aws_profiles_box.currentTextChanged.connect(self.aws_profile_changed)

def _build_profile_settings_ui(self, group, layout):
self.job_history_dir_edit = DirectoryPickerWidget(
initial_directory="",
directory_label="Job History Dir",
directory_label="Job history directory",
parent=group,
collapse_user_dir=True,
)
job_history_dir_label = self.labels["settings.job_history_dir"] = QLabel("Job History Dir")
job_history_dir_label = self.labels["settings.job_history_dir"] = QLabel(
"Job history directory"
)
layout.addRow(job_history_dir_label, self.job_history_dir_edit)
self.job_history_dir_edit.path_changed.connect(self.job_history_dir_changed)

self.default_farm_box = DeadlineFarmListComboBox(parent=group)
default_farm_box_label = self.labels["defaults.farm_id"] = QLabel("Default Farm")
default_farm_box_label = self.labels["defaults.farm_id"] = QLabel("Default farm")
self.default_farm_box.box.currentIndexChanged.connect(self.default_farm_changed)
self.default_farm_box.background_exception.connect(self.handle_background_exception)
layout.addRow(default_farm_box_label, self.default_farm_box)

def _build_farm_settings_ui(self, group, layout):
self.default_queue_box = DeadlineQueueListComboBox(parent=group)
default_queue_box_label = self.labels["defaults.queue_id"] = QLabel("Default Queue")
default_queue_box_label = self.labels["defaults.queue_id"] = QLabel("Default queue")
self.default_queue_box.box.currentIndexChanged.connect(self.default_queue_changed)
self.default_queue_box.background_exception.connect(self.handle_background_exception)
layout.addRow(default_queue_box_label, self.default_queue_box)

self.default_storage_profile_box = DeadlineStorageProfileNameListComboBox(parent=group)
default_storage_profile_box_label = self.labels["settings.storage_profile_id"] = QLabel(
"Default Storage Profile"
"Default storage profile"
)
self.default_storage_profile_box.box.currentIndexChanged.connect(
self.default_storage_profile_name_changed
Expand All @@ -273,25 +275,25 @@ def _build_farm_settings_ui(self, group, layout):
group=group,
layout=layout,
setting_name="defaults.job_attachments_file_system",
label_text="Job Attachments FileSystem Options",
label_text="Job attachments filesystem options",
label_tooltip=job_attachments_file_system_tooltip,
values_with_tooltips=values_with_tooltips,
)

def _build_general_settings_ui(self, group, layout):
self.auto_accept = self._init_checkbox_setting(
group, layout, "settings.auto_accept", "Auto Accept Prompt Defaults"
group, layout, "settings.auto_accept", "Auto accept prompt defaults"
)
self.telemetry_opt_out = self._init_checkbox_setting(
group, layout, "telemetry.opt_out", "Telemetry Opt Out"
group, layout, "telemetry.opt_out", "Telemetry opt out"
)

self._conflict_resolution_options = [option.name for option in FileConflictResolution]
self.conflict_resolution_box = self._init_combobox_setting(
group,
layout,
"settings.conflict_resolution",
"Conflict Resolution Option",
"Conflict resolution option",
self._conflict_resolution_options,
)

Expand All @@ -300,7 +302,7 @@ def _build_general_settings_ui(self, group, layout):
group,
layout,
"settings.log_level",
"Current Logging Level",
"Current logging level",
self._log_levels,
)

Expand Down Expand Up @@ -554,7 +556,7 @@ def apply(self) -> bool:
if value.startswith(NOT_VALID_MARKER):
QMessageBox.warning(
self,
"Apply Changes",
"Apply changes",
f"Cannot apply changes, {value} is not valid for setting {setting_name}",
)
return False
Expand Down Expand Up @@ -695,7 +697,7 @@ def refresh_list(self):
self.__refresh_id += 1
self.__refresh_thread = threading.Thread(
target=self._refresh_thread_function,
name=f"AWS Deadline Cloud Refresh {self.resource_name} Thread",
name=f"AWS Deadline Cloud refresh {self.resource_name} thread",
args=(self.__refresh_id, config),
)
self.__refresh_thread.start()
Expand Down Expand Up @@ -738,7 +740,7 @@ def _refresh_thread_function(self, refresh_id: int, config: Optional[ConfigParse
self._list_update.emit(refresh_id, resources)
except BaseException as e:
if not self.canceled and refresh_id == self.__refresh_id:
self.background_exception.emit(f"Refresh {self.resource_name}s List", e)
self.background_exception.emit(f"Refresh {self.resource_name}s list", e)


class DeadlineFarmListComboBox(_DeadlineResourceListComboBox):
Expand Down Expand Up @@ -776,7 +778,7 @@ class DeadlineStorageProfileNameListComboBox(_DeadlineResourceListComboBox):

def __init__(self, parent=None):
super().__init__(
resource_name="Storage Profile",
resource_name="Storage profile",
setting_name="settings.storage_profile_id",
parent=parent,
)
Expand Down
6 changes: 3 additions & 3 deletions src/deadline/client/ui/dialogs/deadline_login_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
if DeadlineLoginDialog.login(parent=self):
print("Logged in successfully.")
else:
print("Failed to login.")
print("Failed to log in.")
"""

__all__ = ["DeadlineLoginDialog"]
Expand Down Expand Up @@ -37,7 +37,7 @@ class DeadlineLoginDialog(QMessageBox):
if DeadlineLoginDialog.login(parent=self):
print("Logged in successfully.")
else:
print("Failed to login.")
print("Failed to log in.")
"""

# This signal is sent when the background login thread raises an exception.
Expand Down Expand Up @@ -132,7 +132,7 @@ def _start_login(self) -> None:
"""

self.__login_thread = threading.Thread(
target=self._login_background_thread, name="AWS Deadline Cloud Login Thread"
target=self._login_background_thread, name="AWS Deadline Cloud login thread"
)
self.__login_thread.start()

Expand Down
30 changes: 15 additions & 15 deletions src/deadline/client/ui/dialogs/submit_job_progress_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ def _build_ui(self):
self.status_label = QLabel("Preparing files...")
self.status_label.setMargin(5)
self.hashing_progress = JobAttachmentsProgressWidget(
initial_message="Preparing for hashing...", title="Hashing Progress", parent=self
initial_message="Preparing for hashing...", title="Hashing progress", parent=self
)
self.upload_progress = JobAttachmentsProgressWidget(
initial_message="Preparing for upload...", title="Upload Progress", parent=self
initial_message="Preparing for upload...", title="Upload progress", parent=self
)
self.summary_edit = QTextEdit()
self.summary_edit.setVisible(False)
Expand All @@ -172,7 +172,7 @@ def _build_ui(self):
self.lyt.addWidget(self.summary_edit)
self.lyt.addWidget(self.button_box)

self.setWindowTitle("AWS Deadline Cloud Submission")
self.setWindowTitle("AWS Deadline Cloud submission")

self.hashing_thread_progress_report.connect(self.handle_hashing_thread_progress_report)
self.hashing_thread_succeeded.connect(self.handle_hashing_thread_succeeded)
Expand Down Expand Up @@ -411,7 +411,7 @@ def _create_job_background_thread(self) -> None:
def _continue_create_job_wait() -> bool:
return self._continue_submission

logger.info("Waiting for Job to be created...")
logger.info("Waiting for job to be created...")

success = False

Expand All @@ -434,7 +434,7 @@ def _continue_create_job_wait() -> bool:
)
message += f"\n{job_id}\n"
else:
message = "CreateJob response was empty, or did not contain a Job ID."
message = "CreateJob response was empty, or did not contain a job ID."
if success:
self.create_job_thread_succeeded.emit(success, message)
else:
Expand All @@ -461,7 +461,7 @@ def _start_hashing(
self.status_label.setText("Hashing job attachments...")
self.__hashing_thread = threading.Thread(
target=self._hashing_background_thread,
name="AWS Deadline Cloud Hashing Background Thread",
name="AWS Deadline Cloud hashing background thread",
args=(asset_groups, total_input_files, total_input_bytes),
)
self.__hashing_thread.start()
Expand All @@ -473,7 +473,7 @@ def _start_upload(self, asset_manifests: List[AssetRootManifest]) -> None:
self.status_label.setText("Uploading job attachments...")
self.__upload_thread = threading.Thread(
target=self._upload_background_thread,
name="AWS Deadline Cloud Upload Background Thread",
name="AWS Deadline Cloud upload background thread",
args=(asset_manifests,),
)
self.__upload_thread.start()
Expand All @@ -482,10 +482,10 @@ def _start_create_job(self) -> None:
"""
Starts the background thread to call CreateJob.
"""
self.status_label.setText("Waiting for Job to be created...")
self.status_label.setText("Waiting for job to be created...")
self.__create_job_thread = threading.Thread(
target=self._create_job_background_thread,
name="AWS Deadline Cloud CreateJob Background Thread",
name="AWS Deadline Cloud CreateJob background thread",
)
self.__create_job_thread.start()

Expand Down Expand Up @@ -524,7 +524,7 @@ def handle_hashing_thread_succeeded(
hashing_summary, from_gui=True
)
self.summary_edit.setText(
f"\nHashing Summary:\n{textwrap.indent(str(hashing_summary), ' ')}"
f"\nHashing summary:\n{textwrap.indent(str(hashing_summary), ' ')}"
)
self._start_upload(asset_manifests)

Expand All @@ -546,7 +546,7 @@ def handle_upload_thread_succeeded(
)
self.summary_edit.setText(
f"{self.summary_edit.toPlainText()}"
+ f"\nUpload Summary:\n{textwrap.indent(str(upload_summary), ' ')}"
+ f"\nUpload summary:\n{textwrap.indent(str(upload_summary), ' ')}"
)

self._start_create_job()
Expand All @@ -564,11 +564,11 @@ def handle_create_job_thread_succeeded(self, success: bool, status_message: str)

if success:
self._submission_complete = True
self.status_label.setText("Submission Complete")
self.status_label.setText("Submission complete")
self.button_box.setStandardButtons(QDialogButtonBox.Ok)
self.button_box.button(QDialogButtonBox.Ok).setDefault(True)
else:
self.status_label.setText("Submission Error")
self.status_label.setText("Submission error")
self.button_box.setStandardButtons(QDialogButtonBox.Close)
self.button_box.button(QDialogButtonBox.Close).setDefault(True)

Expand All @@ -585,7 +585,7 @@ def handle_thread_exception(self, e: BaseException) -> None:
self.upload_progress.setVisible(False)
self.status_label.setVisible(False)
self.button_box.setStandardButtons(QDialogButtonBox.Close)
self.summary_edit.setText(f"Error Occurred: {str(e)}")
self.summary_edit.setText(f"Error occurred: {str(e)}")
self.summary_edit.setVisible(True)
self.adjustSize()
logger.error(str(e))
Expand Down Expand Up @@ -653,7 +653,7 @@ def _confirm_asset_references_outside_storage_profile(
dont_ask_button.clicked.connect(lambda: set_setting("settings.auto_accept", "true"))
message_box.addButton(dont_ask_button, QMessageBox.ActionRole)

message_box.setWindowTitle("Job Attachments Valid Files Confirmation")
message_box.setWindowTitle("Job attachments valid files confirmation")
selection = message_box.exec()

return selection != QMessageBox.Cancel
Expand Down
Loading

0 comments on commit 23fcbdf

Please sign in to comment.