def __init__(self, servername): viewHandler.__init__(self) serverDispatcher.__init__(self) self.model = model.ircModel() # local, view related state self.channels = casedict() self.queries = casedict() # # Add ourself to the model as a server self.serverState = model.server() # save serverid in case we ever need to refer to it self.serverid = self.model.addServer(self.serverState) self.view = ircView.getIrcView() self.viewtext = self.view.new_view(servername) self.viewtext.setname(servername) self.cfg = getCfg() self.logger = Log(servername) self.notify = self.cfg('servers.notify', []) for i in self.notify: self.viewtext.notify_offline(i) self.notify_delayer = delay.Delayed() self.notify_delayer.ticktime = 10 # 1 tick = 10 sec self.notify_delayer.loop(self.send_notify, 2) main.addDelayed(self.notify_delayer)
def __init__(self): modesupport.__init__(self) self.nick = "<UNKNOWN>" self.name = "" self.channels = casedict() self.notifies = notify() # # the users dict. can be used to store/track user related info self.users = casedict() self.state = server.STATE_NOTCONNECTED
def __init__(self, name=None): Thread.__init__(self) self.handler = None self.name = None self.channels = casedict() self.queries = casedict() self.online = casedict() self.offline = casedict() self.msgwin = msgView() if name: self.setname(name)
def __init__(self, name): modesupport.__init__(self) self.name = name self.users = casedict() self.topic = "" self.bans = casedict() # because equal bans can differ in case :( self.invite = casedict() # I modes self.excempt = casedict() # e modes # you can set a limit to any number (positive or negative) but not 0 self.limit = 0 # no limit self.key = "" # no key self.state = channel.STATE_INACTIVE
def reset(self, propagate=1, level=0): """ reset the channel structure """ modesupport.reset(self, propagate, level) self.users = casedict() self.topic = "" self.bans = casedict() self.invite = casedict() self.excempt = casedict() self.limit = 0 # no limit self.key = "" # no key if level > 0: self.state = channel.STATE_INACTIVE
def __init__(self, name): genericView.__init__(self, "channel") self.name = name self.setname(name) self.users = casedict() # to store list items self.closeonleave = 0 self.active = 1 # by default
def __init__(self, name=None): """ passing name will cause a crash """ genericView.__init__(self, "detach_container") container = self.get_widget("detach_container") container.show() nestable.__init__(self, container, state=nestable.STATE_TAB) self.text = self.get_widget("text") self.entry = HistoryEntry(self.get_widget("entry")) self.text.set_word_wrap(1) bindings = { 'input_activate':self.input_activate, 'on_nickentry_activate':self.on_nickentry_activate, 'detach_toggled':self.handle_detach_toggle} # window handling stuff self.bindings(bindings) self.nickentry = self.get_widget("nickentry") font = self.nickentry.get_style().font width = font.width('MMMMMMMMMM') self.nickentry.set_usize(width, -1) self.handler = None self.name = None self.channels = casedict() self.queries = casedict() self.online = casedict() self.offline = casedict() self.tree = None self.channel_tree = None self.query_tree = None self.notify_tree = None self.online_tree = None self.offline_tree = None self.msgwin = None self.modelabel = self.get_widget("modelabel") self.modestr = [] if name: self.setname(name)
def __init__(self): genericView.__init__(self, "msgwindow") self.text = self.get_widget("text") self.entry = HistoryEntry(self.get_widget("entry")) self.text.set_word_wrap(1) self.list = self.get_widget("list") self.targetlabel = self.get_widget("targetlabel") container = self.get_widget("detach_container") self.window = self.get_widget("msgwindow") bindings = { 'input_activate':self.input_activate, 'window_close':self.window_close, 'detach_toggled':self.handle_detach_toggle } self.bindings(bindings) self.users = casedict() self.lastclicked = 0 self.name = None self.handler = None detachSupport.__init__(self, container, self.window)
def __init__(self, name, container, state): genericView.__init__(self, "channel_detach_container") nestable.__init__(self, self.window, container, state) nestingArrowSupport.__init__(self) # # Does this belong here? container.add(self.window) self.name = name self.entry = HistoryEntry(self.get_widget("entry")) self.list = UserList(self.get_widget("list")) self.topicentry = self.get_widget("topicentry") self.limitentry = self.get_widget("limitentry") self.keyentry = self.get_widget("keyentry") self.modelabel = self.get_widget("modelabel") font = self.limitentry.get_style().font width = font.width('555555') self.limitentry.set_usize(width, -1) font = self.keyentry.get_style().font width = font.width('MMMMMMMMMM') self.keyentry.set_usize(width, -1) self.setname(name) self.modestr = [] self.closeonleave = 0 self.active = 1 # by default self.tree = None self.treeitems = casedict() # XXX TODO: merge with self.list/self.users # # Perform bindings bindings = { 'input_activate':self.input_activate, 'window_close':self.window_close, 'detach_toggled':self.handle_detach_toggle, 'on_topicentry_activate':self.on_topicentry_activate, 'on_keyentry_activate':self.on_keyentry_activate, 'on_limitentry_activate':self.on_limitentry_activate } self.bindings(bindings) self.text = self.get_widget("text") self.text.set_word_wrap(1)
def __init__(self): self.handles = casedict() self.handler = None