Package advene :: Package model :: Package cam :: Module element :: Class CamElementMixin
[hide private]
[frames] | no frames]

Class CamElementMixin

source code

                object --+        
                         |        
   core.meta.WithMetaMixin --+    
                             |    
                object --+   |    
                         |   |    
    events.WithEventsMixin --+    
                             |    
                object --+   |    
                         |   |    
tales.WithAbsoluteUrlMixin --+    
                             |    
                    object --+    
                             |    
   core.element.PackageElement --+
                                 |
                                CamElementMixin
Known Subclasses:

This mixin class implement the behaviour specific to the Cinelab Application Model. It must necessarily be mixed in a subclass of PackageElement. To ensure correct MRO, it explicitly inherit PackageElement, but it is indeed a mixin class (having no implication in instance creation).

Instance Methods [hide private]
 
set_meta(self, key, value, val_is_idref=False)
Set the metadata.
source code
 
_set_camsys_type(self, value, val_is_idref=False) source code
 
del_meta(self, key)
Delete the metadata.
source code
 
iter_my_tags(self, package=None, inherited=True)
This method is inherited from core.Package but is unsafe on cam.Package.
source code
 
_iter_my_tags_nowarn(self, package=None, inherited=True)
Allows to call iter_my_tags internally without raising a warning.
source code
 
iter_my_user_tags(self, package=None, inherited=True) source code
 
iter_my_tag_ids(self, package=None, inherited=True)
This method is inherited from core.Package but is unsafe on cam.Package.
source code
 
_iter_my_tag_ids_nowarn(self, package=None, inherited=True)
Allows to call iter_my_tag_ids internally without raising a warning.
source code
 
iter_my_user_tag_ids(self, package=None, inherited=True)
FIXME: missing docstring
source code
 
_tales_my_tags(self, context_package)
Iter over all the user-tags of this element in the context of the reference package.
source code

Inherited from object: __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __str__

    Inherited from core.element.PackageElement
 
__delattr__(self, name)
Make instance lighter when a custom attribute is deleted.
source code
 
__init__(self, owner, id)
Must not be used directly, nor overridden.
source code
 
__setattr__(self, name, value)
Make instance heavier when a new custom attribute is created.
source code
 
_compute_absolute_url(self, aliases) source code
 
_decrease_weight(self)
:see: _increase_weight
source code
 
_get_id(self)
The identifier of this element in the context of its owner package.
source code
 
_get_owner(self)
The package containing (or owner package) this element.
source code
 
_get_uriref(self)
The URI-ref identifying this element.
source code
 
_increase_weight(self)
Elements are created with weight 0.
source code
 
_iter_my_tags_or_tag_ids(self, package=None, inherited=True, _get=0)
Iter over the id-refs of the tags associated with this element in ``package``.
source code
 
_make_event_delegate(self)
Required by WithEventsMixin
source code
 
_self_connect(self, detailed_signal, handler, *args)
This alternative to `connect` can only be used by the element itself.
source code
 
_set_id(self, new_id)
Rename this element to `new_id`, if it is not already in use in the package, else raises an AssertionError.
source code
 
_tales_color(self, context)
Return the color of the element.
source code
 
_tales_representation(self, context)
Return a concise representation for the element.
source code
 
_update_caches(self, old_idref, new_idref, element, relation)
This cooperative method is used to update all caches when an element in the cache is renamed.
source code
 
connect(self, detailed_signal, handler, *args)
Connect a handler to a signal.
source code
 
delete(self)
Delete this element.
source code
 
disconnect(self, handler_id)
Disconnect a handler from a signal.
source code
 
emit(self, detailed_signal, *args)
Override WithEventsMixin.emit in order to automatically emit the package signal corresponding to each element signal.
source code
 
has_tag(self, tag, package=None, inherited=True)
Is this element associated to ``tag`` by ``package``.
source code
 
iter_references(self, package=None)
Iter over all references that are made to this element.
source code
 
iter_taggers(self, tag, package=None)
Iter over all the packages associating this element to ``tag``.
source code
 
make_id_in(self, pkg)
Compute an id-ref for this element in the context of the given package.
source code
    Inherited from core.meta.WithMetaMixin
 
_get_meta_id_or_ref(self, key, default=_RAISE, _return_id=True)
Return the metadata id (string or element) associated to the given key.
source code
 
_get_ns_dict(self) source code
 
_tales_meta(self, context=None) source code
 
get_meta(self, key, default=_RAISE)
Return the metadata (string or element) associated to the given key.
source code
 
get_meta_id(self, key, default=_RAISE, _return_id=True)
Return the metadata id (string or element) associated to the given key.
source code
 
iter_meta(self)
Iter over all the metadata of this object.
source code
 
iter_meta_ids(self)
Iter over all the metadata of this object.
source code
    Inherited from events.WithEventsMixin
 
block_handler(self, handler_id)
Prevent the handler identified by handler_id to be invoked until it is unblocked.
source code
 
emit_lazy(self, lazy_params)
Like emit, but lazy_params is assumed to be a function returning an iterable of the params to send to emit.
source code
 
enter_no_event_section(self)
Disable all event emission for this object, until `exit_no_event_section` is called.
source code
 
exit_no_event_section(self)
Re-enables all event emission for this object.
source code
 
handler_block(self, handler_id)
Prevent the handler identified by handler_id to be invoked until it is unblocked.
source code
 
handler_is_connected(self, handler_id)
Return True iff the given handler_id represents a connected handler.
source code
 
handler_unblock(self, handler_id)
Unblock the blocked handler identified by handler_id so it can be invoked again.
source code
 
has_handler(self, handler_id)
Return True iff the given handler_id represents a connected handler.
source code
 
stop_emission(self, detailed_signal)
Stop the current emission of the signal specified by detailed_signal.
source code
 
unblock_handler(self, handler_id)
Unblock the blocked handler identified by handler_id so it can be invoked again.
source code
    Inherited from tales.WithAbsoluteUrlMixin
 
_absolute_url_fail(self, msg='') source code
 
_tales_absolute_url(self, context)
See class documentation.
source code
Class Methods [hide private]
 
instantiate(cls, *args)
Factory method to create an instance from backend data.
source code
    Inherited from core.element.PackageElement
 
create_new(cls, owner, id)
Factory method to create a new instance both in memory and backend.
source code
    Inherited from core.meta.WithMetaMixin
 
make_metadata_property(cls, key, alias=None, default=_RAISE, doc=None)
Attempts to create a python property in cls mapping to metadata key.
source code
Static Methods [hide private]
    Inherited from core.element.PackageElement
 
_check_reference(pkg, element, type=None, required=False)
Raise a ModelError if element is not referenceable by pkg, and (if provided) if it has not the given type.
source code
Class Variables [hide private]
    Inherited from core.element.PackageElement
  _id = None
  _owner = None
  _weight = 0
Properties [hide private]
  contributor
shortcut for metadata with key <http://purl.org/dc/elements/1.1/contributor>
  created
shortcut for metadata with key <http://purl.org/dc/elements/1.1/created>
  creator
shortcut for metadata with key <http://purl.org/dc/elements/1.1/creator>
  description
shortcut for metadata with key <http://purl.org/dc/elements/1.1/description>
  modified
shortcut for metadata with key <http://purl.org/dc/elements/1.1/modified>
  seeAlso
shortcut for metadata with key <http://www.w3.org/2000/01/rdf-schema#seeAlso>
  title
shortcut for metadata with key <http://purl.org/dc/elements/1.1/title>

Inherited from object: __class__

    Inherited from core.element.PackageElement
  id
The identifier of this element in the context of its owner package.
  owner
The package containing (or owner package) this element.
  uriref
The URI-ref identifying this element.
    Inherited from core.meta.WithMetaMixin
  meta
Method Details [hide private]

instantiate(cls, *args)
Class Method

source code 

Factory method to create an instance from backend data.

This method expect the exact data from the backend, so it does not need to be tolerant or to check consistency (the backend is assumed to be sane).

Overrides: core.element.PackageElement.instantiate
(inherited documentation)

set_meta(self, key, value, val_is_idref=False)

source code 

Set the metadata.

``val`` can either be a PackageElement or a string. If an element, it must be directly imported by the package of self, or a ModelError will be raised.

Use `val_is_idref` only if you know what you are doing: it forces `val` to be interpreted as an id-ref rather than a plain string; if the id-ref has an import-prefix, only the existence of the import is checked. This is mainly useful for parsers.

Overrides: core.meta.WithMetaMixin.set_meta
(inherited documentation)

del_meta(self, key)

source code 

Delete the metadata.

Note that if the given key is not in use, this will have no effect.

Overrides: core.meta.WithMetaMixin.del_meta
(inherited documentation)

iter_my_tags(self, package=None, inherited=True)

source code 

This method is inherited from core.Package but is unsafe on cam.Package. Use instead `iter_my_user_tags`.

Overrides: core.element.PackageElement.iter_my_tags

iter_my_tag_ids(self, package=None, inherited=True)

source code 

This method is inherited from core.Package but is unsafe on cam.Package. Use instead `iter_my_user_tag_ids`.

Overrides: core.element.PackageElement.iter_my_tag_ids

_tales_my_tags(self, context_package)

source code 

Iter over all the user-tags of this element in the context of the reference package.

NB: This TAL function is overridden with a quite different semantics from the inherited version (only user-tags are iterated, instead of all tags). Since TAL is mostly user-oriented, this semantic shift is not considered harmful.

Decorators:
  • @tales_property
  • @tales_use_as_context("package")
Overrides: core.element.PackageElement._tales_my_tags

Property Details [hide private]

contributor

shortcut for metadata with key <http://purl.org/dc/elements/1.1/contributor>

Get Method:
unreachable.getter(obj)
Set Method:
unreachable.setter(obj, val)
Delete Method:
unreachable.deller(obj)

created

shortcut for metadata with key <http://purl.org/dc/elements/1.1/created>

Get Method:
unreachable.getter(obj)
Set Method:
unreachable.setter(obj, val)
Delete Method:
unreachable.deller(obj)

creator

shortcut for metadata with key <http://purl.org/dc/elements/1.1/creator>

Get Method:
unreachable.getter(obj)
Set Method:
unreachable.setter(obj, val)
Delete Method:
unreachable.deller(obj)

description

shortcut for metadata with key <http://purl.org/dc/elements/1.1/description>

Get Method:
unreachable.getter(obj)
Set Method:
unreachable.setter(obj, val)
Delete Method:
unreachable.deller(obj)

modified

shortcut for metadata with key <http://purl.org/dc/elements/1.1/modified>

Get Method:
unreachable.getter(obj)
Set Method:
unreachable.setter(obj, val)
Delete Method:
unreachable.deller(obj)

seeAlso

shortcut for metadata with key <http://www.w3.org/2000/01/rdf-schema#seeAlso>

Get Method:
unreachable.getter(obj)
Set Method:
unreachable.setter(obj, val)
Delete Method:
unreachable.deller(obj)

title

shortcut for metadata with key <http://purl.org/dc/elements/1.1/title>

Get Method:
unreachable.getter(obj)
Set Method:
unreachable.setter(obj, val)
Delete Method:
unreachable.deller(obj)