better capabilities management (class interfaces instead of constants)
This commit is contained in:
parent
283a5360ad
commit
f06ef5da34
7 changed files with 41 additions and 34 deletions
|
|
@ -20,4 +20,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
"""
|
||||
|
||||
class Backend:
|
||||
CAPS = 0
|
||||
def __init__(self, config):
|
||||
self.config = config
|
||||
|
||||
def hasCaps(self, caps):
|
||||
if not isinstance(caps, (list,tuple)):
|
||||
caps = (caps,)
|
||||
|
||||
for c in caps:
|
||||
if isinstance(self, c):
|
||||
return True
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue