Changeset c5a7b8d for python


Ignore:
Timestamp:
2015-04-12T13:46:45Z (10 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Children:
f15553d
Parents:
f3af614
Message:

Away states/messages, account flags, error reporting, some comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/implugin.py

    rf3af614 rc5a7b8d  
    3535
    3636class BitlBeeIMPlugin(BaseHandler):
     37        # Protocol name to be used in the BitlBee CLI, etc.
    3738        NAME = "rpc-test"
     39
     40        # See account.h (TODO: Add constants.)
     41        ACCOUNT_FLAGS = 3
     42       
     43        # Supported away states. If your protocol supports a specific set of
     44        # away states, put them in a list in this variable.
     45        AWAY_STATES = ["Away", "Busy"] #None
    3846       
    3947        # Filled in during initialisation:
     
    4351        # Full version string
    4452        bitlbee_version_str = None
     53        # Will become an RpcForwarder object to call into BitlBee
     54        bee = None
    4555       
    4656        @classmethod
     
    6272                        "name": self.NAME,
    6373                        "method_list": list(set(dir(self)) & set(SUPPORTED_FUNCTIONS)),
     74                        "account_flags": self.ACCOUNT_FLAGS,
     75                        "away_state_list": self.AWAY_STATES,
    6476                        "settings": {
    6577                                "oauth": {
     
    89101                print self.bee.set_setstr("test", handle)
    90102                print self.bee.set_reset("test")
     103       
     104        def set_away(self, state, message):
     105                print "You're a slacker: %s (%r)" % (state, message)
    91106
    92107def RunPlugin(plugin, debug=True):
Note: See TracChangeset for help on using the changeset viewer.