mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
fix imports and naming
This commit is contained in:
parent
d968c36c15
commit
5300ea1526
9 changed files with 36 additions and 33 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from .clockify_module import ClockifyModule
|
||||
from .addon import ClockifyAddon
|
||||
|
||||
__all__ = (
|
||||
"ClockifyModule",
|
||||
"ClockifyAddon",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@ import os
|
|||
import threading
|
||||
import time
|
||||
|
||||
from ayon_core.modules import AYONAddon, ITrayModule, IPluginPaths
|
||||
from ayon_core.addon import AYONAddon, ITrayAddon, IPluginPaths
|
||||
|
||||
from .constants import CLOCKIFY_FTRACK_USER_PATH, CLOCKIFY_FTRACK_SERVER_PATH
|
||||
|
||||
|
||||
class ClockifyModule(AYONAddon, ITrayModule, IPluginPaths):
|
||||
class ClockifyAddon(AYONAddon, ITrayAddon, IPluginPaths):
|
||||
name = "clockify"
|
||||
|
||||
def initialize(self, studio_settings):
|
||||
|
|
@ -31,7 +31,7 @@ class ClockifyModule(AYONAddon, ITrayModule, IPluginPaths):
|
|||
# TimersManager attributes
|
||||
# - set `timers_manager_connector` only in `tray_init`
|
||||
self.timers_manager_connector = None
|
||||
self._timers_manager_module = None
|
||||
self._timer_manager_addon = None
|
||||
|
||||
@property
|
||||
def clockify_api(self):
|
||||
|
|
@ -87,7 +87,7 @@ class ClockifyModule(AYONAddon, ITrayModule, IPluginPaths):
|
|||
return {"actions": [actions_path]}
|
||||
|
||||
def get_ftrack_event_handler_paths(self):
|
||||
"""Function for Ftrack module to add ftrack event handler paths."""
|
||||
"""Function for ftrack addon to add ftrack event handler paths."""
|
||||
return {
|
||||
"user": [CLOCKIFY_FTRACK_USER_PATH],
|
||||
"server": [CLOCKIFY_FTRACK_SERVER_PATH],
|
||||
|
|
@ -206,19 +206,19 @@ class ClockifyModule(AYONAddon, ITrayModule, IPluginPaths):
|
|||
self.action_stop_timer.setVisible(self.bool_timer_run)
|
||||
|
||||
# --- TimersManager connection methods ---
|
||||
def register_timers_manager(self, timer_manager_module):
|
||||
def register_timers_manager(self, timer_manager_addon):
|
||||
"""Store TimersManager for future use."""
|
||||
self._timers_manager_module = timer_manager_module
|
||||
self._timer_manager_addon = timer_manager_addon
|
||||
|
||||
def timer_started(self, data):
|
||||
"""Tell TimersManager that timer started."""
|
||||
if self._timers_manager_module is not None:
|
||||
self._timers_manager_module.timer_started(self.id, data)
|
||||
if self._timer_manager_addon is not None:
|
||||
self._timer_manager_addon.timer_started(self.id, data)
|
||||
|
||||
def timer_stopped(self):
|
||||
"""Tell TimersManager that timer stopped."""
|
||||
if self._timers_manager_module is not None:
|
||||
self._timers_manager_module.timer_stopped(self.id)
|
||||
if self._timer_manager_addon is not None:
|
||||
self._timer_manager_addon.timer_stopped(self.id)
|
||||
|
||||
def stop_timer(self):
|
||||
"""Called from TimersManager to stop timer."""
|
||||
|
|
@ -1,15 +1,17 @@
|
|||
import os
|
||||
import json
|
||||
import datetime
|
||||
|
||||
import requests
|
||||
|
||||
from ayon_core.lib.local_settings import AYONSecureRegistry
|
||||
from ayon_core.lib import Logger
|
||||
|
||||
from .constants import (
|
||||
CLOCKIFY_ENDPOINT,
|
||||
ADMIN_PERMISSION_NAMES,
|
||||
)
|
||||
|
||||
from ayon_core.lib.local_settings import AYONSecureRegistry
|
||||
from ayon_core.lib import Logger
|
||||
|
||||
|
||||
class ClockifyAPI:
|
||||
log = Logger.get_logger(__name__)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
import os
|
||||
import json
|
||||
from openpype_modules.ftrack.lib import ServerAction
|
||||
from openpype_modules.clockify.clockify_api import ClockifyAPI
|
||||
|
||||
from ayon_clockify.clockify_api import ClockifyAPI
|
||||
|
||||
from ayon_ftrack.lib import ServerAction
|
||||
|
||||
|
||||
class SyncClockifyServer(ServerAction):
|
||||
|
|
|
|||
|
|
@ -1,25 +1,20 @@
|
|||
import json
|
||||
from openpype_modules.ftrack.lib import BaseAction, statics_icon
|
||||
from openpype_modules.clockify.clockify_api import ClockifyAPI
|
||||
from ayon_clockify.clockify_api import ClockifyAPI
|
||||
from ayon_ftrack.lib import BaseAction, statics_icon
|
||||
|
||||
|
||||
class SyncClockifyLocal(BaseAction):
|
||||
'''Synchronise project names and task types.'''
|
||||
"""Synchronise project names and task types."""
|
||||
|
||||
#: Action identifier.
|
||||
identifier = 'clockify.sync.local'
|
||||
#: Action label.
|
||||
label = 'Sync To Clockify (local)'
|
||||
#: Action description.
|
||||
description = 'Synchronise data to Clockify workspace'
|
||||
#: roles that are allowed to register this action
|
||||
identifier = "clockify.sync.local"
|
||||
label = "Sync To Clockify"
|
||||
description = "Synchronise data to Clockify workspace"
|
||||
role_list = ["Administrator", "project Manager"]
|
||||
#: icon
|
||||
icon = statics_icon("app_icons", "clockify-white.png")
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(SyncClockifyLocal, self).__init__(*args, **kwargs)
|
||||
#: CLockifyApi
|
||||
|
||||
self.clockify_api = ClockifyAPI()
|
||||
|
||||
def discover(self, session, entities, event):
|
||||
|
|
@ -56,7 +51,7 @@ class SyncClockifyLocal(BaseAction):
|
|||
'user': user,
|
||||
'status': 'running',
|
||||
'data': json.dumps({
|
||||
'description': 'Sync Ftrack to Clockify'
|
||||
'description': 'Sync ftrack to Clockify'
|
||||
})
|
||||
})
|
||||
session.commit()
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import ayon_api
|
||||
|
||||
from ayon_clockify.clockify_api import ClockifyAPI
|
||||
|
||||
from ayon_core.pipeline import LauncherAction
|
||||
from openpype_modules.clockify.clockify_api import ClockifyAPI
|
||||
|
||||
|
||||
class ClockifyStart(LauncherAction):
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import ayon_api
|
||||
|
||||
from openpype_modules.clockify.clockify_api import ClockifyAPI
|
||||
from ayon_clockify.clockify_api import ClockifyAPI
|
||||
from ayon_core.pipeline import LauncherAction
|
||||
|
||||
|
||||
|
|
|
|||
3
server_addon/clockify/client/ayon_clockify/version.py
Normal file
3
server_addon/clockify/client/ayon_clockify/version.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Package declaring AYON addon 'clockify' version."""
|
||||
__version__ = "0.2.0"
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
name = "clockify"
|
||||
title = "Clockify"
|
||||
version = "0.1.1"
|
||||
version = "0.2.0"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue