Skip to content

Commit

Permalink
Refactored getter names
Browse files Browse the repository at this point in the history
  • Loading branch information
kalisp committed Nov 7, 2024
1 parent 3cbecec commit 675a335
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions client/ayon_deadline/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def _get_deadline_info(

return response.json()

def pools_by_server_name(self, server_name: str) -> List[str]:
def get_pools_by_server_name(self, server_name: str) -> List[str]:
"""Returns dictionary of pools per DL server
Args:
Expand All @@ -221,7 +221,7 @@ def pools_by_server_name(self, server_name: str) -> List[str]:

return pools

def groups_by_server_name(self, server_name: str) -> List[str]:
def get_groups_by_server_name(self, server_name: str) -> List[str]:
"""Returns dictionary of groups per DL server
Args:
Expand All @@ -245,7 +245,7 @@ def groups_by_server_name(self, server_name: str) -> List[str]:

return groups

def limit_groups_by_server_name(self, server_name: str) -> List[str]:
def get_limit_groups_by_server_name(self, server_name: str) -> List[str]:
"""Returns dictionary of limit groups per DL server
Args:
Expand All @@ -269,7 +269,7 @@ def limit_groups_by_server_name(self, server_name: str) -> List[str]:

return limit_groups

def machines_by_server_nameserver(self, server_name: str) -> List[str]:
def get_machines_by_server_nameserver(self, server_name: str) -> List[str]:
"""Returns dictionary of machines/workers per DL server
Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,24 +90,24 @@ def apply_settings(cls, project_settings):
addons_manager = AddonsManager()
deadline_addon = addons_manager["deadline"]
deadline_server_name = settings["deadline_server"]
pools = deadline_addon.pools_by_server_name(deadline_server_name)
pools = deadline_addon.get_pools_by_server_name(deadline_server_name)
for pool in pools:
cls.pool_enum_values.append({"value": pool, "label": pool})

groups = deadline_addon.groups_by_server_name(deadline_server_name)
groups = deadline_addon.get_groups_by_server_name(deadline_server_name)
for group in groups:
cls.group_enum_values.append({"value": group, "label": group})

limit_groups = (
deadline_addon.limit_groups_by_server_name(deadline_server_name))
deadline_addon.get_limit_groups_by_server_name(deadline_server_name))
if not limit_groups:
limit_groups.append("none") # enum cannot be empty
for limit_group in limit_groups:
cls.limit_group_enum_values.append(
{"value": limit_group, "label": limit_group})

machines = (
deadline_addon.machines_by_server_nameserver(deadline_server_name))
deadline_addon.get_machines_by_server_nameserver(deadline_server_name))
for machine in machines:
cls.machines_enum_values.append(
{"value": machine, "label": machine})
Expand Down

0 comments on commit 675a335

Please sign in to comment.