mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-30 10:47:34 +02:00
[core] desc.Attribute: lambda are expressions
This commit is contained in:
parent
840ed3a8b8
commit
b76a3a3d25
1 changed files with 3 additions and 2 deletions
|
@ -6,6 +6,7 @@ from enum import Enum
|
||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
import psutil
|
import psutil
|
||||||
|
import types
|
||||||
import ast
|
import ast
|
||||||
import distutils.util
|
import distutils.util
|
||||||
import shlex
|
import shlex
|
||||||
|
@ -30,7 +31,7 @@ class Attribute(BaseObject):
|
||||||
self._validValue = validValue
|
self._validValue = validValue
|
||||||
self._errorMessage = errorMessage
|
self._errorMessage = errorMessage
|
||||||
self._visible = visible
|
self._visible = visible
|
||||||
self._isExpression = isinstance(self._value, str) and "{" in self._value
|
self._isExpression = (isinstance(self._value, str) and "{" in self._value) or isinstance(self._value, types.FunctionType)
|
||||||
|
|
||||||
name = Property(str, lambda self: self._name, constant=True)
|
name = Property(str, lambda self: self._name, constant=True)
|
||||||
label = Property(str, lambda self: self._label, constant=True)
|
label = Property(str, lambda self: self._label, constant=True)
|
||||||
|
|
Loading…
Add table
Reference in a new issue