def __init__(self, notification_type, session_id, handler): self.notification_type = notification_type self.session_id = session_id self.handler = handler self.key = (session_id, notification_type) global _subscriptions if self.key not in _subscriptions: _subscriptions[self.key] = [] _subscriptions[self.key].append(self) self.future = get_socket().request_subscribe(True, notification_type, session_id)
def unsubscribe(self): _subscriptions[self.key].remove(self) get_socket().request_subscribe(False, self.notification_type, self.session_id)
def create_tab(self, profile=None, command=None, index=None): return tab.FutureTab(get_socket().request_create_tab( profile=profile, window=self.window_id, index=index, command=command))
def create_inner(response): return get_socket().request_create_tab( profile=profile, window=self.get_window_id(), index=index, command=command)
def split_pane(self, vertical=False, before=False, profile=None): return FutureSession(get_socket().request_split_pane( session=self.session_id, vertical=vertical, before=before, profile=profile))
def send_text(self, text): return TextSender(get_socket().request_send_text(self.session_id, text))
def create_inner(response): return get_socket().request_split_pane( session=self.get_session_id(), vertical=vertical, before=before, profile=profile)
def create_inner(response): return get_socket().request_send_text(self.get_session_id(), text)
def create_window(self, profile=None, command=None): return window.FutureWindow(get_socket().request_create_tab( profile=profile, window=None, index=None, command=command))
def _refresh(self): logging.debug("Refreshing hierarchy") self.future = get_socket().request_hierarchy()
def create_inner(response): return get_socket().request_create_tab(profile=profile, window=self.get_window_id(), index=index, command=command)