aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts/pyolian/eolian.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts/pyolian/eolian.py')
-rw-r--r--src/scripts/pyolian/eolian.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py
index 56b79134c1..580cc1f951 100644
--- a/src/scripts/pyolian/eolian.py
+++ b/src/scripts/pyolian/eolian.py
@@ -312,6 +312,8 @@ class EolianBaseObject(object):
### Main Eolian Unit ########################################################
class Eolian_Unit(EolianBaseObject):
+ def __repr__(self):
+ return "<eolian.Eolian_Unit '{0.file}'>".format(self)
@property
def children(self):
@@ -404,6 +406,9 @@ class Eolian_State(Eolian_Unit):
if not _already_halted: # do not free after eolian_shutdown
lib.eolian_state_free(self._obj)
+ def __repr__(self):
+ return "<eolian.Eolian_State, %d units loaded>" % len(list(self.units))
+
def file_parse(self, filepath):
c_unit = lib.eolian_state_file_parse(self._obj, _str_to_bytes(filepath))
return Eolian_Unit(c_unit) if c_unit else None
@@ -573,6 +578,11 @@ class Object(EolianBaseObject):
return "<eolian.Object '{0.name}', {0.type!s}>".format(self)
@cached_property
+ def unit(self):
+ c_unit = lib.eolian_object_unit_get(self._obj)
+ return Eolian_Unit(c_unit) if c_unit else None
+
+ @cached_property
def name(self):
return _str_to_py(lib.eolian_object_name_get(self._obj))