示例#1
0
 def __init__(self, module, *args, **kwargs):
     super(IdleManagerThread, self).__init__(*args, **kwargs)
     self.log = PypeLogger.get_logger(self.__class__.__name__)
     self.module = module
     self.threads = []
     self.is_running = False
     self.idle_time = 0
示例#2
0
import threading
import asyncio

from aiohttp import web

from pype.lib import PypeLogger

log = PypeLogger.get_logger("WebServer")


class WebServerManager:
    """Manger that care about web server thread."""
    def __init__(self, module):
        self.module = module

        self.client = None
        self.handlers = {}
        self.on_stop_callbacks = []

        self.app = web.Application()

        # add route with multiple methods for single "external app"

        self.webserver_thread = WebServerThread(self)

    @property
    def port(self):
        return self.module.port

    def add_route(self, *args, **kwargs):
        self.app.router.add_route(*args, **kwargs)
示例#3
0
import os
import types
import logging
import traceback

import ftrack_api

from pype.lib import (PypeLogger, modules_from_path)

log = PypeLogger.get_logger(__name__)
"""
# Required - Needed for connection to Ftrack
FTRACK_SERVER # Ftrack server e.g. "https://myFtrack.ftrackapp.com"
FTRACK_API_KEY # Ftrack user's API key "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
FTRACK_API_USER # Ftrack username e.g. "user.name"

# Required - Paths to folder with actions
FTRACK_ACTIONS_PATH # Paths to folders where are located actions
    - EXAMPLE: "M:/FtrackApi/../actions/"
FTRACK_EVENTS_PATH # Paths to folders where are located actions
    - EXAMPLE: "M:/FtrackApi/../events/"

# Required - Needed for import included modules
PYTHONPATH # Path to ftrack_api and paths to all modules used in actions
    - path to ftrack_action_handler, etc.
"""


class FtrackServer:
    def __init__(self, handler_paths=None):
        """
示例#4
0
 def log(self):
     """Auto created logger for debugging or warnings."""
     if self._log is None:
         self._log = PypeLogger.get_logger(self.__class__.__name__)
     return self._log