mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 14:59:34 +01:00
c803e5e9d8
consistent between developers. Jeremy should be adding the equivalent settings for emacs soon.
36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
#!/usr/bin/env python
|
|
|
|
from fix import *
|
|
|
|
import xml.sax.handler
|
|
|
|
import ircdb
|
|
|
|
class UsersHandler(xml.sax.handler.ContentHandler):
|
|
def startElement(self, name, attrs):
|
|
if name == 'user':
|
|
self.u = ircdb.IrcUser(ignore=attrs.getValue('ignore'),
|
|
password=attrs.getValue('password'),
|
|
auth=(float(attrs.getValue('authtime')),
|
|
attrs.getValue('authmask')))
|
|
self.name = attrs.getValue('name')
|
|
self.startTag = name
|
|
|
|
def characters(self, content):
|
|
self.chars += content
|
|
|
|
def endElement(self, name):
|
|
assert name == self.startTag
|
|
self.startTag = ''
|
|
if name == 'capability':
|
|
self.u.addCapability(self.chars.strip())
|
|
elif name == 'hostmask':
|
|
self.u.addHostmask(self.chars.strip())
|
|
elif name == 'user':
|
|
#ircdb.users.setUser(self.name, self.u)
|
|
self.users[self.name] = self.u
|
|
self.name = ''
|
|
self.u = None
|
|
self.chars = ''
|
|
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|