kibot.ircDB
index
/home/groups/kibot/web/contents/kibot/ircDB.py

 
Modules
            
kibot
os
pickle
re
sha
socket
string
time
 
Classes
            
kibot.BaseModule.BaseModule
ircDB
Channel
CurrentUser
exceptions.Exception
UserError
KnownUser
GodUser
__builtin__.dict(__builtin__.object)
IRCdict
 
class Channel
       
   Methods defined here:
__init__(self)
add_user(self, nick)
change_nick(self, before, after)
clear_mode(self, mode, value=None)
Clear mode on the channel.
 
Arguments:
 
    mode -- The mode (a single-character string).
 
    value -- Value
has_key(self)
has_limit(self)
has_message_from_outside_protection(self)
has_mode(self, mode)
has_topic_lock(self)
has_user(self, nick)
Check whether the channel has a user.
is_invite_only(self)
is_moderated(self)
is_oper(self, nick)
Check whether a user has operator status in the channel.
is_protected(self)
is_secret(self)
is_voiced(self, nick)
Check whether a user has voice mode set in the channel.
key(self)
limit(self)
opers(self)
Returns an unsorted list of the channel's operators.
remove_user(self, nick)
set_mode(self, mode, value=None)
Set mode on the channel.
 
Arguments:
 
    mode -- The mode (a single-character string).
 
    value -- Value
topic(self, newtopic=None)
topic_setter(self, newsetter=None)
topic_time(self, newtime=None)
users(self)
Returns an unsorted list of the channel's users.
voiced(self)
Returns an unsorted list of the persons that have voice
mode set in the channel.

Data and non-method functions defined here:
__doc__ = None
__module__ = 'kibot.ircDB'
 
class CurrentUser
       
   Methods defined here:
__init__(self, nickmask, userid=None, channels=[])
add_channel(self, channel)
remove_channel(self, channel)
rename(self, before, after)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'kibot.ircDB'
 
class GodUser(KnownUser)
       
   Methods defined here:
__init__(self)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'kibot.ircDB'

Methods inherited from KnownUser:
__getstate__(self)
__repr__(self)
_check_password_sha(self, clear)
_set_password_sha(self, clear)
########################################################
# raw password functions.  Create a pair for each password type
add_mask(self, mask)
add_perm(self, perm)
#########################################################
# perm functions
check_password(self, clear)
get_masks(self)
get_perms(self)
get_raw_perms(self)
mask_matches(self, nickmask)
#########################################################
# mask functions
remove_mask(self, mask)
remove_perm(self, perm)
set_password(self, clear, ptype='sha')
set the user's password
clear can be either the new password, None/'' to unset the password,
or a password tuple (ptype, crypted_password)
 
class IRCdict(__builtin__.dict)
       
  
Method resolution order:
IRCdict
__builtin__.dict
__builtin__.object

Methods defined here:
__delitem__(self, key)
__getitem__(self, key)
__init__(self)
__setitem__(self, key, value)
clear(self)
has_key(self, key)

Data and non-method functions defined here:
__dict__ = <dict-proxy object>
__doc__ = None
__module__ = 'kibot.ircDB'
__weakref__ = <member '__weakref__' of 'IRCdict' objects>

Methods inherited from __builtin__.dict:
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__contains__(...)
x.__contains__(y) <==> y in x
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)
copy(...)
D.copy() -> a shallow copy of D
get(...)
D.get(k[,d]) -> D[k] if D.has_key(k), else d.  d defaults to None.
items(...)
D.items() -> list of D's (key, value) pairs, as 2-tuples
iteritems(...)
D.iteritems() -> an iterator over the (key, value) items of D
iterkeys(...)
D.iterkeys() -> an iterator over the keys of D
itervalues(...)
D.itervalues() -> an iterator over the values of D
keys(...)
D.keys() -> list of D's keys
popitem(...)
D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty
setdefault(...)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if not D.has_key(k)
update(...)
D.update(E) -> None.  Update D from E: for k in E.keys(): D[k] = E[k]
values(...)
D.values() -> list of D's values

Data and non-method functions inherited from __builtin__.dict:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from __builtin__.object:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__reduce__(...)
helper for pickle
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__str__(...)
x.__str__() <==> str(x)

Data and non-method functions inherited from __builtin__.object:
__class__ = <type 'type'>
 
class KnownUser
       
   Methods defined here:
__getstate__(self)
__init__(self, userid, perms=[], masks=[], password=None)
__repr__(self)
_check_password_sha(self, clear)
_set_password_sha(self, clear)
########################################################
# raw password functions.  Create a pair for each password type
add_mask(self, mask)
add_perm(self, perm)
#########################################################
# perm functions
check_password(self, clear)
get_masks(self)
get_perms(self)
get_raw_perms(self)
mask_matches(self, nickmask)
#########################################################
# mask functions
remove_mask(self, mask)
remove_perm(self, perm)
set_password(self, clear, ptype='sha')
set the user's password
clear can be either the new password, None/'' to unset the password,
or a password tuple (ptype, crypted_password)

Data and non-method functions defined here:
__doc__ = None
__module__ = 'kibot.ircDB'
 
class UserError(exceptions.Exception)
       
   Data and non-method functions defined here:
__doc__ = None
__module__ = 'kibot.ircDB'

Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)
 
class ircDB(kibot.BaseModule.BaseModule)
      manages the following information 'automatically':
 
list of channels
list of users/ops/voiced/modes on each channel
list of current users (on all channels)
list of "known users" and User objects
 
data structures:
  channel_dict = dict with channel names as keys, and channel objects
                 as values
  channel_obj  = object containing channel users/ops/voiced/modes
  current_users = dict mapping nicks to (channel list, nickmask, and
                  (if known) userid)
  known_users  = object mapping userids to user objects
 
   Methods defined here:
__init__(self, bot)
_default_mask_from_nickmask(self, nm)
_fetch_all(self, nick=None, nickmask=None, userid=None, user=None)
##################################################################
### Support (private) functions
_get_uniq_nick(self, ind, nicklist)
_is_god_user(self, nick=None, nickmask=None, userid=None, user=None)
_on_channelmodeis(self, c, e)
_on_disconnect(self, c, e)
[Internal]
_on_int_new_mask(self, c, e)
_on_join(self, c, e)
[Internal]
_on_kick(self, c, e)
[Internal]
_on_mode(self, c, e)
[Internal]
_on_namreply(self, c, e)
[Internal]
_on_nick(self, c, e)
[Internal]
_on_nicknameinuse(self, c, e)
_on_part(self, c, e)
[Internal]
_on_quit(self, c, e)
[Internal]
_on_topic(self, c, e)
_on_topicinfo(self, c, e)
_on_welcome(self, c, e)
_on_whoreply(self, c, e)
_reconnect_func(self)
_reload(self)
_rename_user(self, before, after)
_set_nick_return(self, tried_nick, result)
_unload(self)
add_user(self, nick, userid=None, mask=None)
create a new new user/userid for nick
del_user(self, *args, **kwargs)
get_nick(self, *args, **kwargs)
# all of the functions in the next block effectively have these args:
#   nick=None, nickmask=None, userid=None, user=None
get_nickmask(self, *args, **kwargs)
get_nickmasks(self, *args, **kwargs)
get_nicks(self, *args, **kwargs)
get_user(self, *args, **kwargs)
get_userid(self, *args, **kwargs)
rescan(self, nick=None, nickmask=None)
force rescan of nick/nickmask to see if we recognize them
This is useful after a mask has been added to a user, for example.
rescan_user(self, userid=None, user=None)
save(self)
set_nick(self, newnick, callback=None, cb_data=None)

Data and non-method functions defined here:
__doc__ = "manages the following information 'automatically...rs = object mapping userids to user objects\n "
__module__ = 'kibot.ircDB'
_tmp_key = 'ircdb.data'

Methods inherited from kibot.BaseModule.BaseModule:
_del_handlers(self, priority=0, prefix='_on_')
This "undoes" self._set_handlers
_get_handlers(self, prefix)
return a list of all event types for which it looks like
the module has handlers.  If the module has defined _on_join and
_on_kick, then this will return ['join', 'kick']
 
if the attribute self._handlers is defined, it will be returned
instead
_get_stasher(self, file=None, format=None, **kwargs)
#_stash_file = 'foo.pickle'    # will appear in the "data_dir"
_set_handlers(self, priority=0, prefix='_on_')
set handlers for all methods with prefix <prefix>
For example, if the method _on_join is defined, then that method
will be registered as handler for the "join" event.
 
If the attribute self._handlers is defined, it will be used instead.
each element of the self._handlers list should be the event type.
 
  def _handle_join(self, conn, event): pass
  def _handle_kick(self, conn, event): pass
  def _handle_part(self, conn, event): pass
  self._handlers = ['join', 'kick']
  _set_handlers(prefix='_handle_')
 
In this case, only the first two will be set.  If self._handlers
were not defined, then all three would be set.
_stash(self, default=<class kibot.BaseModule.NoDefault>)
Store the attributes listed in self._stash_attrs in a stasher.
One will be created if necessary.  If a value isn't set and
a default is provided, that value will be used.
_unstash(self, default=<class kibot.BaseModule.NoDefault>)
Reload the attributes listed in self._stash_attrs from the
stasher.  If the attribute was not in the stasher (or if the file
didn't exist) then the attribute will be set to 'default'.  If
default is not provided, then the attribute will not be set at all.

Data and non-method functions inherited from kibot.BaseModule.BaseModule:
_stash_attrs = []
_stash_format = 'pickle'
 
Data
             __file__ = '/home/groups/kibot/web/contents/kibot/ircDB.pyc'
__name__ = 'kibot.ircDB'