Skip to content

Commit

Permalink
Use defaultweakobjectmap defined in python-application
Browse files Browse the repository at this point in the history
  • Loading branch information
danpascu committed Dec 31, 2015
1 parent 8f5e854 commit 779b1f8
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions sipsimple/addressbook.py
Expand Up @@ -19,7 +19,7 @@
from application.python import Null
from application.python.decorator import execute_once
from application.python.types import Singleton, MarkerType
from application.python.weakref import weakobjectmap
from application.python.weakref import defaultweakobjectmap

from sipsimple.account import xcap, AccountManager
from sipsimple.configuration import ConfigurationManager, ObjectNotFoundError, DuplicateIDError, PersistentKey, ModifiedValue, ModifiedList
Expand Down Expand Up @@ -50,14 +50,6 @@ def __repr__(self):
return "%s(%r, %r)" % (self.__class__.__name__, self.account, self.xcap_object)


class defaultweakobjectmap(weakobjectmap):
def __init__(self, factory, *args, **kw):
self.default_factory = factory
super(defaultweakobjectmap, self).__init__(*args, **kw)
def __missing__(self, key):
return self.setdefault(key.object, self.default_factory())


class Setting(AbstractSetting):
"""
Descriptor represeting a setting in an addressbook object.
Expand Down

0 comments on commit 779b1f8

Please sign in to comment.