コード例 #1
0
ファイル: jogger_pl.py プロジェクト: AdamPrzybyla/cjc
 def __init__(self,app,name):
     PluginBase.__init__(self,app,name)
     self.buffers={}
     self.last_thread=0
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     self.available_settings={
         "editor": ("Editor for message composition."
                 " Default: $EDITOR or 'vi'",str),
         "editor_encoding": ("Character encoding for edited messages."
                 " Default: locale specific",str),
         "jid": ("Where to send jogger messages. Default (and recommended):"
                 " autodetect",(pyxmpp.JID,None)),
         "dtd": ("HTML or XML DTD identifier for jogger entries."
                 " Should match your jogger template."
                 " If not set no validation is done (not recommended).",str),
         "subject_container": ("Container element for the entry subject."
                 " Should match your jogger template.",str),
         "body_container": ("Container element for the entry subject."
                 " Should match your jogger template.",str),
         }
     self.settings={
             "dtd": u' PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'
                     ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"',
             "subject_container": "div",
             "body_container": "div",
             }
     ui.activate_cmdtable("jogger_pl",self)
     libxml2.initializeCatalog()
コード例 #2
0
 def __init__(self, app, name):
     PluginBase.__init__(self, app, name)
     self.available_settings = {
         "show":
         ("Which items show - list of 'available','unavailable','chat',"
          "'online','away','xa' or 'all'", list, self.set_show),
         "buffer_preference":
         ("Preference of roster buffers when switching to the next active buffer. If 0 then the buffer is not even shown in active buffer list.",
          int),
         "cache_file": ("Location of roster cache files."
                        " /unset it not to keep local copy of the roster.",
                        (unicode, None))
     }
     self.settings = {
         "show": ["all"],
         "buffer_preference": 2,
         "cache_file": "%($HOME)s/.cjc/cache/%(jid)s.roster",
     }
     app.add_info_handler("rostername", self.info_rostername)
     app.add_info_handler("rostergroups", self.info_rostergroups)
     app.add_event_handler("roster updated", self.ev_roster_updated)
     app.add_event_handler("presence changed", self.ev_presence_changed)
     app.add_event_handler("layout changed", self.ev_layout_changed)
     app.add_event_handler("stream closed", self.ev_stream_closed)
     app.add_event_handler("config loaded", self.ev_config_loaded)
     cjc_globals.theme_manager.set_default_attrs(theme_attrs)
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     self.buffer = ListBuffer("Roster")
     self.buffer.preference = self.settings["buffer_preference"]
     self.extra_items = []
     ui.activate_cmdtable("roster", self)
コード例 #3
0
 def __init__(self, app, name):
     PluginBase.__init__(self, app, name)
     self.conversations = {}
     cjc_globals.theme_manager.set_default_attrs(theme_attrs)
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     self.available_settings = {
         "buffer": ("How received messages should be put in buffers"
                    " (single|separate|per-user|per-thread)",
                    ("single", "separate", "per-user", "per-thread")),
         "buffer_preference":
         ("Preference of message buffers when switching to the next active buffer. If 0 then the buffer is not even shown in active buffer list.",
          int),
         "auto_popup":
         ("When enabled each new message buffer is automatically made active.",
          bool),
         "editor":
         ("Editor for message composition. Default: global 'editor' option, $EDITOR or 'vi'",
          str),
         "editor_encoding":
         ("Character encoding for edited messages. Default: locale specific",
          str),
     }
     self.settings = {
         "buffer": "per-user",
         "buffer_preference": 50,
         "auto_popup": False,
     }
     app.add_event_handler("presence changed", self.ev_presence_changed)
     app.add_event_handler("day changed", self.ev_day_changed)
     ui.activate_cmdtable("message", self)
コード例 #4
0
ファイル: roster.py プロジェクト: AdamPrzybyla/cjc
 def __init__(self,app,name):
     PluginBase.__init__(self,app,name)
     self.available_settings={
         "show": ("Which items show - list of 'available','unavailable','chat',"
                 "'online','away','xa' or 'all'",list,self.set_show),
         "buffer_preference": ("Preference of roster buffers when switching to the next active buffer. If 0 then the buffer is not even shown in active buffer list.",int),
         "cache_file": ("Location of roster cache files."
             " /unset it not to keep local copy of the roster.",
                                     (unicode, None))
         }
     self.settings={
             "show": ["all"],
             "buffer_preference": 2,
             "cache_file": "%($HOME)s/.cjc/cache/%(jid)s.roster",
             }
     app.add_info_handler("rostername",self.info_rostername)
     app.add_info_handler("rostergroups",self.info_rostergroups)
     app.add_event_handler("roster updated",self.ev_roster_updated)
     app.add_event_handler("presence changed",self.ev_presence_changed)
     app.add_event_handler("layout changed",self.ev_layout_changed)
     app.add_event_handler("stream closed", self.ev_stream_closed)
     app.add_event_handler("config loaded", self.ev_config_loaded)
     cjc_globals.theme_manager.set_default_attrs(theme_attrs)
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     self.buffer=ListBuffer("Roster")
     self.buffer.preference=self.settings["buffer_preference"]
     self.extra_items=[]
     ui.activate_cmdtable("roster",self)
コード例 #5
0
 def __init__(self, app, name):
     PluginBase.__init__(self, app, name)
     self.buffers = {}
     self.last_thread = 0
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     self.available_settings = {
         "editor": ("Editor for message composition."
                    " Default: $EDITOR or 'vi'", str),
         "editor_encoding": ("Character encoding for edited messages."
                             " Default: locale specific", str),
         "jid": ("Where to send jogger messages. Default (and recommended):"
                 " autodetect", (pyxmpp.JID, None)),
         "dtd":
         ("HTML or XML DTD identifier for jogger entries."
          " Should match your jogger template."
          " If not set no validation is done (not recommended).", str),
         "subject_container": ("Container element for the entry subject."
                               " Should match your jogger template.", str),
         "body_container": ("Container element for the entry subject."
                            " Should match your jogger template.", str),
     }
     self.settings = {
         "dtd": u' PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'
         ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"',
         "subject_container": "div",
         "body_container": "div",
     }
     ui.activate_cmdtable("jogger_pl", self)
     libxml2.initializeCatalog()
コード例 #6
0
 def __init__(self, app, name):
     PluginBase.__init__(self, app, name)
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     self.available_settings = {
         "priority": ("Priority of current resource", int),
         "chat_priority": ("Priority of current resource in ready-for-chat"
                           " mode", (int, None)),
         "dnd_priority":
         ("Priority of current resource in dnd mode", (int, None)),
         "away_priority": ("Priority of current resource in away mode",
                           (int, None)),
         "xa_priority": ("Priority of current resource in xa mode", (int,
                                                                     None)),
         "auto_away": ("Time in minutes after set presence should be set"
                       " to 'away' (unset or 0 to disable)", (int, None)),
         "auto_xa": ("Time in minutes after set presence should be set"
                     " to 'xa' (unset or 0 to disable)", (int, None)),
         "auto_away_msg":
         ("Auto-away status description (if empty and"
          " presence.keep_description is set then status description"
          " is not changed", (unicode, None)),
         "auto_xa_msg":
         ("Auto-away status description (if empty and "
          "presence.keep_description is set then status description"
          " is not changed)", (unicode, None)),
         "show_changes": ("Auto-away status description", (int, None)),
         "show_errors": ("Auto-away status description", (int, None)),
         "buffer_preference":
         ("Preference of presence subscription buffers"
          " when switching to the next active buffer. If 0 then"
          " the buffer is not even shown in active buffer list.", int),
         "auto_popup": ("When enabled each new presence subscription buffer"
                        " is automatically made active.", bool),
         "keep_description": ("When changing status (online,away,etc.) keep"
                              " status description (reason).", bool),
         "no_auto_away_when": ("Modes in which now auto-away or auto-xa"
                               " should happen.", list),
     }
     self.settings = {
         "priority": 1,
         "auto_away": 5,
         "auto_xa": 15,
         "auto_away_msg":
         u"Automatically away after %i minutes of inactivity",
         "auto_xa_msg": u"Automatically xa after %i minutes of inactivity",
         "show_changes": 1,
         "show_errors": 1,
         "buffer_preference": 50,
         "auto_popup": False,
         "keep_description": False,
         "no_auto_away_when": ["away", "xa", "dnd"]
     }
     app.add_info_handler("resources", self.info_resources)
     app.add_info_handler("presence", self.info_presence)
     app.add_info_handler("weight", self.info_weight)
     app.add_event_handler("disconnect request", self.ev_disconnect_request)
     app.add_event_handler("idle", self.ev_idle)
     ui.activate_cmdtable("presence", self)
     self.away_saved_presence = None
コード例 #7
0
ファイル: disco.py プロジェクト: AdamPrzybyla/cjc
 def __init__(self,app,name):
     PluginBase.__init__(self,app,name)
     ui.activate_cmdtable("disco",self)
     cjc_globals.theme_manager.set_default_attrs(theme_attrs)
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     self.available_settings={
         "buffer_preference": ("Preference of disco buffers when switching to the next active buffer. If 0 then the buffer is not even shown in active buffer list.",int),
         }
     self.settings={"buffer_preference":2}
コード例 #8
0
ファイル: presence.py プロジェクト: AdamPrzybyla/cjc
 def __init__(self,app,name):
     PluginBase.__init__(self,app,name)
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     self.available_settings={
         "priority": ("Priority of current resource",int),
         "chat_priority": ("Priority of current resource in ready-for-chat"
                 " mode",(int,None)),
         "dnd_priority": ("Priority of current resource in dnd mode",
                 (int,None)),
         "away_priority": ("Priority of current resource in away mode",
                 (int,None)),
         "xa_priority": ("Priority of current resource in xa mode",
                 (int,None)),
         "auto_away": ("Time in minutes after set presence should be set"
                 " to 'away' (unset or 0 to disable)",(int,None)),
         "auto_xa": ("Time in minutes after set presence should be set"
                 " to 'xa' (unset or 0 to disable)",(int,None)),
         "auto_away_msg": ("Auto-away status description (if empty and"
                 " presence.keep_description is set then status description"
                 " is not changed",(unicode,None)),
         "auto_xa_msg": ("Auto-away status description (if empty and "
                 "presence.keep_description is set then status description"
                 " is not changed)",(unicode,None)),
         "show_changes": ("Auto-away status description",(int,None)),
         "show_errors": ("Auto-away status description",(int,None)),
         "buffer_preference": ("Preference of presence subscription buffers"
                 " when switching to the next active buffer. If 0 then"
                 " the buffer is not even shown in active buffer list.",int),
         "auto_popup": ("When enabled each new presence subscription buffer"
                 " is automatically made active.",bool),
         "keep_description": ("When changing status (online,away,etc.) keep"
                 " status description (reason).",bool),
         "no_auto_away_when": ("Modes in which now auto-away or auto-xa"
                 " should happen.",list),
         }
     self.settings={
         "priority": 1,
         "auto_away": 5,
         "auto_xa": 15,
         "auto_away_msg": u"Automatically away after %i minutes of inactivity",
         "auto_xa_msg": u"Automatically xa after %i minutes of inactivity",
         "show_changes": 1,
         "show_errors": 1,
         "buffer_preference": 50,
         "auto_popup": False,
         "keep_description": False,
         "no_auto_away_when": ["away","xa","dnd"]
         }
     app.add_info_handler("resources",self.info_resources)
     app.add_info_handler("presence",self.info_presence)
     app.add_info_handler("weight",self.info_weight)
     app.add_event_handler("disconnect request",self.ev_disconnect_request)
     app.add_event_handler("idle",self.ev_idle)
     ui.activate_cmdtable("presence",self)
     self.away_saved_presence=None
コード例 #9
0
 def __init__(self, app, name):
     PluginBase.__init__(self, app, name)
     ui.activate_cmdtable("disco", self)
     cjc_globals.theme_manager.set_default_attrs(theme_attrs)
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     self.available_settings = {
         "buffer_preference":
         ("Preference of disco buffers when switching to the next active buffer. If 0 then the buffer is not even shown in active buffer list.",
          int),
     }
     self.settings = {"buffer_preference": 2}
コード例 #10
0
 def __init__(self,app,name):
     PluginBase.__init__(self,app,name)
     self.available_settings={
         "name": ("Client name to return in reply to jabber:iq:version query",str),
         "version": ("Client version to return in reply to jabber:iq:version query",str),
         "os": ("OS name to return in reply to jabber:iq:version query",str),
         }
     sysname,nodename,release,version,machine=os.uname()
     self.defaults={
             "version": cjc.version.version,
             "name": "Console Jabber Client",
             "os": "%s %s %s"  % (sysname,release,machine),
         }
     ui.activate_cmdtable("version",self)
     self.cjc.register_feature(u"jabber:iq:version")
コード例 #11
0
ファイル: xmlconsole.py プロジェクト: Jajcus/cjc
 def __init__(self, app, name):
     PluginBase.__init__(self, app, name)
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     cjc_globals.theme_manager.set_default_attrs(theme_attrs)
     self.available_settings = {
         "pretty_print": ("Reformat (pretty-print) sent and received XML (doesn't work well)", int),
         "check": ("Check if the raw-XML element is valid before sending", int),
     }
     self.settings = {"pretty_print": 0, "check": 1}
     app.add_event_handler("day changed", self.ev_day_changed)
     ui.activate_cmdtable("xmlconsole", self)
     self.away_saved_presence = None
     self.buffer = None
     self.data_in_handler = DataInHandler(self)
     self.data_out_handler = DataOutHandler(self)
     logging.getLogger("pyxmpp.Stream.in").addHandler(self.data_in_handler)
     logging.getLogger("pyxmpp.Stream.out").addHandler(self.data_out_handler)
コード例 #12
0
 def __init__(self,app,name):
     PluginBase.__init__(self,app,name)
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     self.available_settings={
         "event_handlers": ("Event handlers (managed with /event_add and"
                 " /event_remove commands)",list),
         }
     self.settings={
             "event_handlers": [
                     "chat message received:beep *.*",
                     "message received:beep *.*.*",
                     "groupchat message to me received:beep *.*",
                     "groupchat message received:beep *",
                     ],
             }
     app.add_event_handler("*",self.handle_event)
     ui.activate_cmdtable("events",self)
コード例 #13
0
ファイル: chat.py プロジェクト: AdamPrzybyla/cjc
 def __init__(self,app,name):
     PluginBase.__init__(self,app,name)
     self.conversations={}
     cjc_globals.theme_manager.set_default_attrs(theme_attrs)
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     self.available_settings={
         "buffer_preference": ("Preference of chat buffers when switching to the next active buffer. If 0 then the buffer is not even shown in active buffer list.",int),
         "auto_popup": ("When enabled each new chat buffer is automatically made active.",bool),
         "merge_threads": ("Use single chat buffer for a single peer.",bool),
         }
     self.settings={
             "buffer_preference": 100,
             "auto_popup": False,
             "merge_threads": False,
             }
     app.add_event_handler("presence changed",self.ev_presence_changed)
     app.add_event_handler("day changed",self.ev_day_changed)
     ui.activate_cmdtable("chat",self)
コード例 #14
0
ファイル: muc.py プロジェクト: AdamPrzybyla/cjc
 def __init__(self,app,name):
     PluginBase.__init__(self,app,name)
     cjc_globals.theme_manager.set_default_attrs(theme_attrs)
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     self.available_settings={
         "default_nick": ("Default nickname. If not give then node part of JID will be used",(unicode,None)),
         "buffer_preference": ("Preference of groupchat buffers when switching to the next active buffer. If 0 then the buffer is not even shown in active buffer list.",int),
         "autojoin": ("List of rooms to join after connecting.",list),
         }
     self.settings={
             "buffer_preference": 10,
             "default_nick": None,
             "autojoin": None,
             }
     app.add_event_handler("day changed",self.ev_day_changed)
     app.add_event_handler("roster updated",self.autojoin)
     ui.activate_cmdtable("muc",self)
     self.room_manager=None
     MucNickCompletion(app).register("muc_nick")
コード例 #15
0
ファイル: message.py プロジェクト: AdamPrzybyla/cjc
 def __init__(self,app,name):
     PluginBase.__init__(self,app,name)
     self.conversations={}
     cjc_globals.theme_manager.set_default_attrs(theme_attrs)
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     self.available_settings={
         "buffer": ("How received messages should be put in buffers"
                 " (single|separate|per-user|per-thread)",
                 ("single","separate","per-user","per-thread")),
         "buffer_preference": ("Preference of message buffers when switching to the next active buffer. If 0 then the buffer is not even shown in active buffer list.",int),
         "auto_popup": ("When enabled each new message buffer is automatically made active.",bool),
         "editor": ("Editor for message composition. Default: global 'editor' option, $EDITOR or 'vi'",str),
         "editor_encoding": ("Character encoding for edited messages. Default: locale specific",str),
         }
     self.settings={
             "buffer":"per-user",
             "buffer_preference": 50,
             "auto_popup": False,
             }
     app.add_event_handler("presence changed",self.ev_presence_changed)
     app.add_event_handler("day changed",self.ev_day_changed)
     ui.activate_cmdtable("message",self)
コード例 #16
0
 def __init__(self, app, name):
     PluginBase.__init__(self, app, name)
     cjc_globals.theme_manager.set_default_attrs(theme_attrs)
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     self.available_settings = {
         "default_nick":
         ("Default nickname. If not give then node part of JID will be used",
          (unicode, None)),
         "buffer_preference":
         ("Preference of groupchat buffers when switching to the next active buffer. If 0 then the buffer is not even shown in active buffer list.",
          int),
         "autojoin": ("List of rooms to join after connecting.", list),
     }
     self.settings = {
         "buffer_preference": 10,
         "default_nick": None,
         "autojoin": None,
     }
     app.add_event_handler("day changed", self.ev_day_changed)
     app.add_event_handler("roster updated", self.autojoin)
     ui.activate_cmdtable("muc", self)
     self.room_manager = None
     MucNickCompletion(app).register("muc_nick")
コード例 #17
0
 def __init__(self, app, name):
     PluginBase.__init__(self, app, name)
     self.conversations = {}
     cjc_globals.theme_manager.set_default_attrs(theme_attrs)
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     self.available_settings = {
         "buffer_preference":
         ("Preference of chat buffers when switching to the next active buffer. If 0 then the buffer is not even shown in active buffer list.",
          int),
         "auto_popup":
         ("When enabled each new chat buffer is automatically made active.",
          bool),
         "merge_threads":
         ("Use single chat buffer for a single peer.", bool),
     }
     self.settings = {
         "buffer_preference": 100,
         "auto_popup": False,
         "merge_threads": False,
     }
     app.add_event_handler("presence changed", self.ev_presence_changed)
     app.add_event_handler("day changed", self.ev_day_changed)
     ui.activate_cmdtable("chat", self)
コード例 #18
0
 def __init__(self, app, name):
     PluginBase.__init__(self, app, name)
     cjc_globals.theme_manager.set_default_formats(theme_formats)
     cjc_globals.theme_manager.set_default_attrs(theme_attrs)
     self.available_settings = {
         "pretty_print":
         ("Reformat (pretty-print) sent and received XML (doesn't work well)",
          int),
         "check":
         ("Check if the raw-XML element is valid before sending", int),
     }
     self.settings = {
         "pretty_print": 0,
         "check": 1,
     }
     app.add_event_handler("day changed", self.ev_day_changed)
     ui.activate_cmdtable("xmlconsole", self)
     self.away_saved_presence = None
     self.buffer = None
     self.data_in_handler = DataInHandler(self)
     self.data_out_handler = DataOutHandler(self)
     logging.getLogger("pyxmpp.Stream.in").addHandler(self.data_in_handler)
     logging.getLogger("pyxmpp.Stream.out").addHandler(
         self.data_out_handler)
コード例 #19
0
 def __init__(self, app, name):
     PluginBase.__init__(self, app, name)
     ui.activate_cmdtable("roster_ei", self)
コード例 #20
0
ファイル: roster_ei.py プロジェクト: AdamPrzybyla/cjc
 def __init__(self, app, name):
     PluginBase.__init__(self, app, name)
     ui.activate_cmdtable("roster_ei", self)
コード例 #21
0
ファイル: python.py プロジェクト: AdamPrzybyla/cjc
 def __init__(self,app,name):
     PluginBase.__init__(self,app,name)
     ui.activate_cmdtable("python",self)
コード例 #22
0
 def __init__(self, app, name):
     PluginBase.__init__(self, app, name)
     ui.activate_cmdtable("multicast", self)
コード例 #23
0
ファイル: test.py プロジェクト: AdamPrzybyla/cjc
 def __init__(self,plugin,name):
     threading.Thread.__init__(self,name=name)
     self.plugin=plugin
     self.buffer=ui.TextBuffer(name)
     ui.activate_cmdtable("test buffer",self)
     self.stop_it=0
コード例 #24
0
 def __init__(self, plugin, name):
     threading.Thread.__init__(self, name=name)
     self.plugin = plugin
     self.buffer = ui.TextBuffer(name)
     ui.activate_cmdtable("test buffer", self)
     self.stop_it = 0
コード例 #25
0
ファイル: multicast.py プロジェクト: AdamPrzybyla/cjc
 def __init__(self, app, name):
     PluginBase.__init__(self, app, name)
     ui.activate_cmdtable("multicast", self)
コード例 #26
0
 def __init__(self, app, name):
     PluginBase.__init__(self, app, name)
     ui.activate_cmdtable("python", self)