Exemplo n.º 1
0
    def __init__(self, api, rules, loop, debug=False):
        # Ensure all initialization methods are run for parent classes
        WebSocketClientProtocol.__init__(self)

        # Log initial slack client instantiation
        log.info("New Client Instantiated")

        # API interface access
        self.api = api

        # Loop pointer
        self.loop = loop

        # Available Slack event listing containers
        self.available_events = []
        self.event_hooks = {}

        # Populate Slack event listing
        for member in inspect.getmembers(self):
            try:
                if member[1].slack_event:
                    event_type = member[0]
                    self.available_events.append(event_type)
                    self.event_hooks[event_type] = []
            except:
                pass

        # Load rules
        for rule in rules:
            self.load_rule(rule)

        # Instantiate queue to hold up to last 100 messages
        self.message_queue = deque(maxlen=100)

        # Client Details
        self.user = None
        self.current_channel = None
        self.direct_channels = {}

        # Team Details
        self.team_members = {}
        self.team_groups = {}
        self.team_channels = {}

        # Unique incremental identifier for messages
        self.message_identifier = 1

        # URL for reconnecting
        self.reconnect_location = None
Exemplo n.º 2
0
    def __init__(self):
        WebSocketClientProtocol.__init__(self)
        self.capture_thread = None
        self.isComplete = False
        self.isCapturing = True
        self.mode = "IDENT"
        self.cam1 = None
        self.cam2 = None

        self.cap = cv2.VideoCapture(1)
        self.window = tk.Tk()
        self.window.title("SliceNet Diagnostic v1.0")
        self.window.configure(bg="white")
        self.window.resizable(0, 0)
        self.window.protocol("WM_DELETE_WINDOW", self.close)
Exemplo n.º 3
0
 def __init__(self, *args):
     WebSocketClientProtocol.__init__(self, *args)
     self.opened = asyncio.Future()
Exemplo n.º 4
0
 def __init__(self):
     WebSocketClientProtocol.__init__(self)
Exemplo n.º 5
0
 def __init__(self):
     WebSocketClientProtocol.__init__(self)
     self.binaryHandler = None
     self.textHandler = None
     self.onCloseHandler = None
     self.connected = False
Exemplo n.º 6
0
 def __init__(self, *args):
     WebSocketClientProtocol.__init__(self, *args)
Exemplo n.º 7
0
	def __init__(self):
		WebSocketClientProtocol.__init__(self)
		self.binaryHandler = None
		self.textHandler = None
		self.onCloseHandler = None
		self.connected = False