mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-18 03:26:30 +02:00
[core] add low-level retro-compatibility for attribute changes
First version of retrocompatibility, allowing to load files referencing removed or type-incompatible attributes. * add node_factory to centralize node instantiation * discard invalid attributes (i.e. not part of the node description anymore or with incompatible value type) when loading a file * raise on unknown nodes * add 'core.exception' module to declare Meshroom's exception types
This commit is contained in:
parent
f401ca7c8b
commit
0adc4d8cc6
3 changed files with 77 additions and 7 deletions
22
meshroom/core/exception.py
Normal file
22
meshroom/core/exception.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env python
|
||||
# coding:utf-8
|
||||
|
||||
|
||||
class MeshroomException(Exception):
|
||||
""" Base class for Meshroom exceptions """
|
||||
pass
|
||||
|
||||
|
||||
class GraphException(MeshroomException):
|
||||
""" Base class for Graph exceptions """
|
||||
pass
|
||||
|
||||
|
||||
class UnknownNodeTypeError(GraphException):
|
||||
"""
|
||||
Raised when asked to create a unknown node type.
|
||||
"""
|
||||
def __init__(self, nodeType):
|
||||
msg = "Unknown Node Type: " + nodeType
|
||||
super(UnknownNodeTypeError, self).__init__(msg)
|
||||
self.nodeType = nodeType
|
Loading…
Add table
Add a link
Reference in a new issue