kibot.ircDB
index
/usr/src/rpm/BUILD/kibot-0.0.12/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.

 
class CurrentUser
     Methods defined here:
__init__(self, nickmask, userid=None, channels=[])
add_channel(self, channel)
remove_channel(self, channel)
rename(self, before, after)

 
class GodUser(KnownUser)
     Methods defined here:
__init__(self)

Methods inherited from KnownUser:
__getstate__(self)
__repr__(self)
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 other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'IRCdict' objects>
list of weak references to the object (if defined)

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 k in D, 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
pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value
If key is not found, d is returned if given, otherwise KeyError is raised
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 k not in D
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 other attributes 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
fromkeys = <built-in method fromkeys of type object>
dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.

 
class KnownUser
     Methods defined here:
__getstate__(self)
__init__(self, userid, perms=[], masks=[], password=None)
__repr__(self)
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 UserError(exceptions.Exception)
     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)
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)