Skip to content

Commit

Permalink
modified clockify addon to use AYON settings
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Feb 14, 2024
1 parent 4d947d7 commit fa55d15
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions client/ayon_core/modules/clockify/clockify_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@
import threading
import time

from ayon_core.modules import OpenPypeModule, ITrayModule, IPluginPaths
from ayon_core.modules import AYONAddon, ITrayModule, IPluginPaths
from ayon_core.client import get_asset_by_name

from .constants import CLOCKIFY_FTRACK_USER_PATH, CLOCKIFY_FTRACK_SERVER_PATH


class ClockifyModule(OpenPypeModule, ITrayModule, IPluginPaths):
class ClockifyModule(AYONAddon, ITrayModule, IPluginPaths):
name = "clockify"

def initialize(self, modules_settings):
clockify_settings = modules_settings[self.name]
self.enabled = clockify_settings["enabled"]
self.workspace_name = clockify_settings["workspace_name"]

if self.enabled and not self.workspace_name:
raise Exception("Clockify Workspace is not set in settings.")
def initialize(self, studio_settings):
enabled = self.name in studio_settings
workspace_name = None
if enabled:
clockify_settings = studio_settings[self.name]
workspace_name = clockify_settings["workspace_name"]

if enabled and workspace_name:
self.log.warning("Clockify Workspace is not set in settings.")
enabled = False
self.enabled = enabled
self.workspace_name = workspace_name

self.timer_manager = None
self.MessageWidgetClass = None
Expand Down

0 comments on commit fa55d15

Please sign in to comment.