mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 12:42:34 +01:00
Added __getstate__ and __setstate__ to IrcState
This commit is contained in:
parent
d37e229027
commit
896ce38514
@ -163,6 +163,15 @@ class IrcState(object):
|
||||
self.nicksToHostmasks = {}
|
||||
self.channels = {}
|
||||
|
||||
def __getstate__(self):
|
||||
d = {}
|
||||
for s in self.__slots__:
|
||||
d[s] = getattr(self, s)
|
||||
|
||||
def __setstate__(self, d):
|
||||
for (name, value) in d.iteritems():
|
||||
setattr(self, name, value)
|
||||
|
||||
def copy(self):
|
||||
ret = self.__class__()
|
||||
ret.history = copy.copy(self.history)
|
||||
|
Loading…
Reference in New Issue
Block a user