added statics_icon function for easier getting icon path for actions

This commit is contained in:
iLLiCiTiT 2020-06-04 18:34:32 +02:00
parent f32fc2dfe2
commit 7a1b4ef358
2 changed files with 10 additions and 1 deletions

View file

@ -2,7 +2,7 @@ from . import avalon_sync
from . import credentials
from .ftrack_base_handler import BaseHandler
from .ftrack_event_handler import BaseEvent
from .ftrack_action_handler import BaseAction
from .ftrack_action_handler import BaseAction, statics_icon
from .ftrack_app_handler import AppAction
__all__ = [
@ -11,5 +11,6 @@ __all__ = [
"BaseHandler",
"BaseEvent",
"BaseAction",
"statics_icon",
"AppAction"
]

View file

@ -1,6 +1,14 @@
import os
from .ftrack_base_handler import BaseHandler
def statics_icon(*icon_statics_file_parts):
statics_server = os.environ.get("PYPE_STATICS_SERVER")
if not statics_server:
return None
return "/".join((statics_server, *icon_statics_file_parts))
class BaseAction(BaseHandler):
'''Custom Action base class