rename "types" to "common" to avoid name conflict

types is already a standard python package
This commit is contained in:
Yann Lanthony 2017-09-25 20:04:41 +02:00
parent 51a9b0e316
commit 547e6c93b6
5 changed files with 3 additions and 3 deletions

View file

@ -0,0 +1,47 @@
Model = None
Slot = None
Signal = None
Property = None
BaseObject = None
if 1: # TODO: switch types according to something
# PySide types
from .qt import Model, Slot, Signal, Property, BaseObject
else:
# Core types
from .core import Model, Slot, Signal, Property, BaseObject
class _BaseModel:
""" Common API for model implementation """
def __init__(self, keyAttrName="name", **kwargs):
"""
:param keyAttrName: name of the attribute containing the unique key for an object
"""
pass
@property
def objects(self):
""" Return a dictionary with {unique_key: object} mapping"""
return None
def get(self, key):
""" Get the object with the unique key 'key' """
pass
def add(self, obj):
""" Add given object using its 'keyAttrName' as unique key """
pass
def pop(self, key):
""" Remove 'item' with unique key 'key' from the model """
pass
def remove(self, obj):
""" Remove 'obj' from the model """
pass
def clear(self):
""" Remove all internal objects """
pass