root/trunk/RBJabber/RBJabber/JabberSubject.py

Revision 528, 2.1 kB (checked in by sholloway, 5 years ago)

Depreciating WeakBind?, LazyProperty?
General cleanup tasks
Demo cleanups

Line 
1 #!/usr/bin/env python
2 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 ##~ License
4 ##~
5 ##- The RuneBlade Foundation library is intended to ease some
6 ##- aspects of writing intricate Jabber, XML, and User Interface (wxPython, etc.)
7 ##- applications, while providing the flexibility to modularly change the
8 ##- architecture. Enjoy.
9 ##~
10 ##~ Copyright (C) 2002  TechGame Networks, LLC.
11 ##~
12 ##~ This library is free software; you can redistribute it and/or
13 ##~ modify it under the terms of the BSD style License as found in the
14 ##~ LICENSE file included with this distribution.
15 ##~
16 ##~ TechGame Networks, LLC can be reached at:
17 ##~ 3578 E. Hartsel Drive #211
18 ##~ Colorado Springs, Colorado, USA, 80920
19 ##~
20 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21
22 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 #~ Imports
24 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25
26 from SubjectObserver.CategorySubject import CategorySubjectBaseMixin
27 from SubjectObserver import ProxyBidableCategorySubjectMixin
28 from RBFoundation.BindCallable import BoundCallableBase
29 import JID
30
31 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 #~ Definitions
33 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34
35 class JabberSubjectBase(ProxyBidableCategorySubjectMixin, CategorySubjectBaseMixin):
36     pass
37
38 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39
40 class FromJIDSubjectMixin(JabberSubjectBase):
41     def AddObserver(self, category, *args, **kw):
42         self.__super.AddObserver(JID.JID(category), *args, **kw)
43
44     def RemoveObserver(self, category, observer):
45         self.__super.RemoveObserver(JID.JID(category), observer)
46
47     def _ProxyObserverList(self, category):
48         result = []
49         result.extend(self._ObserverList(category[1].from_.noresource()))
50         result.extend(self._ObserverList(category[1].from_))
51         result.extend(self.__super._ProxyObserverList(category))
52
53         return result
54
55 FromJIDSubjectMixin._FromJIDSubjectMixin__super = super(FromJIDSubjectMixin)
56
57 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58
59 class FromJIDSubject(BoundCallableBase, FromJIDSubjectMixin):
60     pass
61
Note: See TracBrowser for help on using the browser.