Add explicit backend between standalone and pyside

This commit is contained in:
Fabien Castan 2017-10-11 18:13:49 +02:00
parent aacdf32915
commit 931ad23f50
3 changed files with 20 additions and 2 deletions

View file

@ -0,0 +1,12 @@
from enum import Enum # available by default in python3. For python2: "pip install enum34"
class Backend(Enum):
STANDALONE = 1
PYSIDE = 2
backend = Backend.STANDALONE
def useUI():
global backend
backend = Backend.PYSIDE

View file

@ -1,13 +1,15 @@
import meshroom
Model = None
Slot = None
Signal = None
Property = None
BaseObject = None
if 1: # TODO: switch types according to something
if meshroom.backend == meshroom.Backend.PYSIDE:
# PySide types
from .qt import Model, Slot, Signal, Property, BaseObject
else:
elif meshroom.backend == meshroom.Backend.STANDALONE:
# Core types
from .core import Model, Slot, Signal, Property, BaseObject

View file

@ -0,0 +1,4 @@
import meshroom
meshroom.useUI()
__version__ = '0.1.0'