summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2018-01-05 12:46:55 +0100
committerDave Andreoli <dave@gurumeditation.it>2018-01-05 12:48:28 +0100
commitf003c6702d19cee66c660424022595619780b99c (patch)
treecb659f6acda3ebf5df07ac0c65fa98f835310f0a
parent76b837002eaea56b5ecb174bffe284012084dc74 (diff)
Pyolian: cache classes and properties
This give an overrall speed up of aroud 50% in the full doc generation.
-rw-r--r--src/scripts/pyolian/eolian.py307
1 files changed, 171 insertions, 136 deletions
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py
index 70c0d37565..c15f167433 100644
--- a/src/scripts/pyolian/eolian.py
+++ b/src/scripts/pyolian/eolian.py
@@ -263,7 +263,42 @@ class Iterator(object):
263 lib.eina_iterator_free(self._iter) 263 lib.eina_iterator_free(self._iter)
264 264
265 265
266class cached_property(object):
267 """ Decorator to be used on properties that can be cached """
268 def __init__(self, fget, doc=None):
269 self.fget = fget
270 self.__doc__ = doc or fget.__doc__
271 self.__name__ = fget.__name__
272 self.__module__ = fget.__module__
273
274 def __get__(self, obj, cls):
275 obj.__dict__[self.__name__] = result = self.fget(obj)
276 return result
277
278
266class EolianBaseObject(object): 279class EolianBaseObject(object):
280 __instances_cache = {}
281 def __new__(cls, c_obj_pointer=None, *args, **kargs):
282 # cannot cache without a pointer
283 if c_obj_pointer is None:
284 return super().__new__(cls)
285
286 # cache based on the c pointer value (assume the eolian db is stabe)
287 if isinstance(c_obj_pointer, c_void_p):
288 key = c_obj_pointer.value
289 elif isinstance(c_obj_pointer, int):
290 key = c_obj_pointer
291 else:
292 raise TypeError('Wrong EolianBaseObject constructor pointer!!')
293
294 # get instance from cache or create a new one
295 if key in cls.__instances_cache:
296 inst = cls.__instances_cache[key]
297 else:
298 inst = cls.__instances_cache[key] = super().__new__(cls)
299
300 return inst
301
267 def __init__(self, c_obj_pointer): 302 def __init__(self, c_obj_pointer):
268 if isinstance(c_obj_pointer, c_void_p): 303 if isinstance(c_obj_pointer, c_void_p):
269 self._obj = c_void_p(c_obj_pointer.value) 304 self._obj = c_void_p(c_obj_pointer.value)
@@ -508,56 +543,56 @@ class Class(EolianBaseObject):
508 def __repr__(self): 543 def __repr__(self):
509 return "<eolian.Class '{0.full_name}', {0.type!s}>".format(self) 544 return "<eolian.Class '{0.full_name}', {0.type!s}>".format(self)
510 545
511 @property 546 @cached_property
512 def name(self): 547 def name(self):
513 return _str_to_py(lib.eolian_class_name_get(self._obj)) 548 return _str_to_py(lib.eolian_class_name_get(self._obj))
514 549
515 @property 550 @cached_property
516 def full_name(self): 551 def full_name(self):
517 return _str_to_py(lib.eolian_class_full_name_get(self._obj)) 552 return _str_to_py(lib.eolian_class_full_name_get(self._obj))
518 553
519 @property 554 @cached_property
520 def c_name(self): 555 def c_name(self):
521 s = lib.eolian_class_c_name_get(self._obj) 556 s = lib.eolian_class_c_name_get(self._obj)
522 ret = _str_to_py(s) 557 ret = _str_to_py(s)
523 lib.eina_stringshare_del(c_void_p(s)) 558 lib.eina_stringshare_del(c_void_p(s))
524 return ret 559 return ret
525 560
526 @property 561 @cached_property
527 def c_get_function_name(self): 562 def c_get_function_name(self):
528 s = lib.eolian_class_c_get_function_name_get(self._obj) 563 s = lib.eolian_class_c_get_function_name_get(self._obj)
529 ret = _str_to_py(s) 564 ret = _str_to_py(s)
530 lib.eina_stringshare_del(c_void_p(s)) 565 lib.eina_stringshare_del(c_void_p(s))
531 return ret 566 return ret
532 567
533 @property 568 @cached_property
534 def type(self): 569 def type(self):
535 return Eolian_Class_Type(lib.eolian_class_type_get(self._obj)) 570 return Eolian_Class_Type(lib.eolian_class_type_get(self._obj))
536 571
537 @property 572 @cached_property
538 def data_type(self): 573 def data_type(self):
539 return _str_to_py(lib.eolian_class_data_type_get(self._obj)) 574 return _str_to_py(lib.eolian_class_data_type_get(self._obj))
540 575
541 @property 576 @cached_property
542 def c_data_type(self): 577 def c_data_type(self):
543 s = lib.eolian_class_c_data_type_get(self._obj) 578 s = lib.eolian_class_c_data_type_get(self._obj)
544 ret = _str_to_py(s) 579 ret = _str_to_py(s)
545 lib.eina_stringshare_del(c_void_p(s)) 580 lib.eina_stringshare_del(c_void_p(s))
546 return ret 581 return ret
547 582
548 @property 583 @cached_property
549 def legacy_prefix(self): 584 def legacy_prefix(self):
550 return _str_to_py(lib.eolian_class_legacy_prefix_get(self._obj)) 585 return _str_to_py(lib.eolian_class_legacy_prefix_get(self._obj))
551 586
552 @property 587 @cached_property
553 def eo_prefix(self): 588 def eo_prefix(self):
554 return _str_to_py(lib.eolian_class_eo_prefix_get(self._obj)) 589 return _str_to_py(lib.eolian_class_eo_prefix_get(self._obj))
555 590
556 @property 591 @cached_property
557 def event_prefix(self): 592 def event_prefix(self):
558 return _str_to_py(lib.eolian_class_event_prefix_get(self._obj)) 593 return _str_to_py(lib.eolian_class_event_prefix_get(self._obj))
559 594
560 @property 595 @cached_property
561 def documentation(self): 596 def documentation(self):
562 c_doc = lib.eolian_class_documentation_get(self._obj) 597 c_doc = lib.eolian_class_documentation_get(self._obj)
563 return Documentation(c_doc) if c_doc else None 598 return Documentation(c_doc) if c_doc else None
@@ -579,7 +614,7 @@ class Class(EolianBaseObject):
579 def inherits(self): 614 def inherits(self):
580 return Iterator(Class, lib.eolian_class_inherits_get(self._obj)) 615 return Iterator(Class, lib.eolian_class_inherits_get(self._obj))
581 616
582 @property 617 @cached_property
583 def inherits_full(self): 618 def inherits_full(self):
584 L = [] 619 L = []
585 def do_class_recursive(cls): 620 def do_class_recursive(cls):
@@ -591,7 +626,7 @@ class Class(EolianBaseObject):
591 do_class_recursive(self) 626 do_class_recursive(self)
592 return L 627 return L
593 628
594 @property 629 @cached_property
595 def hierarchy(self): 630 def hierarchy(self):
596 L = [] 631 L = []
597 base = self.base_class 632 base = self.base_class
@@ -600,7 +635,7 @@ class Class(EolianBaseObject):
600 base = base.base_class 635 base = base.base_class
601 return L 636 return L
602 637
603 @property 638 @cached_property
604 def base_class(self): 639 def base_class(self):
605 inherits = list(self.inherits) 640 inherits = list(self.inherits)
606 if len(inherits) > 0: 641 if len(inherits) > 0:
@@ -610,19 +645,19 @@ class Class(EolianBaseObject):
610 def namespaces(self): 645 def namespaces(self):
611 return Iterator(_str_to_py, lib.eolian_class_namespaces_get(self._obj)) 646 return Iterator(_str_to_py, lib.eolian_class_namespaces_get(self._obj))
612 647
613 @property 648 @cached_property
614 def namespace(self): 649 def namespace(self):
615 return '.'.join(self.namespaces) 650 return '.'.join(self.namespaces)
616 651
617 @property 652 @cached_property
618 def file(self): 653 def file(self):
619 return _str_to_py(lib.eolian_class_file_get(self._obj)) 654 return _str_to_py(lib.eolian_class_file_get(self._obj))
620 655
621 @property 656 @cached_property
622 def ctor_enable(self): 657 def ctor_enable(self):
623 return bool(lib.eolian_class_ctor_enable_get(self._obj)) 658 return bool(lib.eolian_class_ctor_enable_get(self._obj))
624 659
625 @property 660 @cached_property
626 def dtor_enable(self): 661 def dtor_enable(self):
627 return bool(lib.eolian_class_dtor_enable_get(self._obj)) 662 return bool(lib.eolian_class_dtor_enable_get(self._obj))
628 663
@@ -657,15 +692,15 @@ class Part(EolianBaseObject):
657 def __repr__(self): 692 def __repr__(self):
658 return "<eolian.Part '{0.name}'>".format(self) 693 return "<eolian.Part '{0.name}'>".format(self)
659 694
660 @property 695 @cached_property
661 def name(self): 696 def name(self):
662 return _str_to_py(lib.eolian_part_name_get(self._obj)) 697 return _str_to_py(lib.eolian_part_name_get(self._obj))
663 698
664 @property 699 @cached_property
665 def class_(self): 700 def class_(self):
666 return Class(lib.eolian_part_class_get(self._obj)) 701 return Class(lib.eolian_part_class_get(self._obj))
667 702
668 @property 703 @cached_property
669 def documentation(self): 704 def documentation(self):
670 c_doc = lib.eolian_part_documentation_get(self._obj) 705 c_doc = lib.eolian_part_documentation_get(self._obj)
671 return Documentation(c_doc) if c_doc else None 706 return Documentation(c_doc) if c_doc else None
@@ -675,19 +710,19 @@ class Constructor(EolianBaseObject):
675 def __repr__(self): 710 def __repr__(self):
676 return "<eolian.Constructor '{0.full_name}', optional={0.is_optional}>".format(self) 711 return "<eolian.Constructor '{0.full_name}', optional={0.is_optional}>".format(self)
677 712
678 @property 713 @cached_property
679 def full_name(self): 714 def full_name(self):
680 return _str_to_py(lib.eolian_constructor_full_name_get(self._obj)) 715 return _str_to_py(lib.eolian_constructor_full_name_get(self._obj))
681 716
682 @property 717 @cached_property
683 def function(self): 718 def function(self):
684 return Function(lib.eolian_constructor_function_get(self._obj)) 719 return Function(lib.eolian_constructor_function_get(self._obj))
685 720
686 @property 721 @cached_property
687 def is_optional(self): 722 def is_optional(self):
688 return bool(lib.eolian_constructor_is_optional(self._obj)) 723 return bool(lib.eolian_constructor_is_optional(self._obj))
689 724
690 @property 725 @cached_property
691 def class_(self): 726 def class_(self):
692 return Class(lib.eolian_constructor_class_get(self._obj)) 727 return Class(lib.eolian_constructor_class_get(self._obj))
693 728
@@ -696,40 +731,40 @@ class Event(EolianBaseObject):
696 def __repr__(self): 731 def __repr__(self):
697 return "<eolian.Event '{0.name}', c_name='{0.c_name}'>".format(self) 732 return "<eolian.Event '{0.name}', c_name='{0.c_name}'>".format(self)
698 733
699 @property 734 @cached_property
700 def name(self): 735 def name(self):
701 return _str_to_py(lib.eolian_event_name_get(self._obj)) 736 return _str_to_py(lib.eolian_event_name_get(self._obj))
702 737
703 @property 738 @cached_property
704 def c_name(self): 739 def c_name(self):
705 s = lib.eolian_event_c_name_get(self._obj) 740 s = lib.eolian_event_c_name_get(self._obj)
706 ret = _str_to_py(s) 741 ret = _str_to_py(s)
707 lib.eina_stringshare_del(c_void_p(s)) 742 lib.eina_stringshare_del(c_void_p(s))
708 return ret 743 return ret
709 744
710 @property 745 @cached_property
711 def type(self): 746 def type(self):
712 c_type = lib.eolian_event_type_get(self._obj) 747 c_type = lib.eolian_event_type_get(self._obj)
713 return Type(c_type) if c_type else None 748 return Type(c_type) if c_type else None
714 749
715 @property 750 @cached_property
716 def documentation(self): 751 def documentation(self):
717 c_doc = lib.eolian_event_documentation_get(self._obj) 752 c_doc = lib.eolian_event_documentation_get(self._obj)
718 return Documentation(c_doc) if c_doc else None 753 return Documentation(c_doc) if c_doc else None
719 754
720 @property 755 @cached_property
721 def scope(self): 756 def scope(self):
722 return Eolian_Object_Scope(lib.eolian_event_scope_get(self._obj)) 757 return Eolian_Object_Scope(lib.eolian_event_scope_get(self._obj))
723 758
724 @property 759 @cached_property
725 def is_beta(self): 760 def is_beta(self):
726 return bool(lib.eolian_event_is_beta(self._obj)) 761 return bool(lib.eolian_event_is_beta(self._obj))
727 762
728 @property 763 @cached_property
729 def is_hot(self): 764 def is_hot(self):
730 return bool(lib.eolian_event_is_hot(self._obj)) 765 return bool(lib.eolian_event_is_hot(self._obj))
731 766
732 @property 767 @cached_property
733 def is_restart(self): 768 def is_restart(self):
734 return bool(lib.eolian_event_is_restart(self._obj)) 769 return bool(lib.eolian_event_is_restart(self._obj))
735 770
@@ -738,7 +773,7 @@ class Function(EolianBaseObject):
738 def __repr__(self): 773 def __repr__(self):
739 return "<eolian.Function '{0.name}'>".format(self) 774 return "<eolian.Function '{0.name}'>".format(self)
740 775
741 @property 776 @cached_property
742 def name(self): 777 def name(self):
743 return _str_to_py(lib.eolian_function_name_get(self._obj)) 778 return _str_to_py(lib.eolian_function_name_get(self._obj))
744 779
@@ -748,46 +783,46 @@ class Function(EolianBaseObject):
748 lib.eina_stringshare_del(c_void_p(s)) 783 lib.eina_stringshare_del(c_void_p(s))
749 return ret 784 return ret
750 785
751 @property 786 @cached_property
752 def full_c_method_name(self): 787 def full_c_method_name(self):
753 return self.full_c_name_get(Eolian_Function_Type.METHOD) 788 return self.full_c_name_get(Eolian_Function_Type.METHOD)
754 789
755 @property 790 @cached_property
756 def full_c_getter_name(self): 791 def full_c_getter_name(self):
757 return self.full_c_name_get(Eolian_Function_Type.PROP_GET) 792 return self.full_c_name_get(Eolian_Function_Type.PROP_GET)
758 793
759 @property 794 @cached_property
760 def full_c_setter_name(self): 795 def full_c_setter_name(self):
761 return self.full_c_name_get(Eolian_Function_Type.PROP_SET) 796 return self.full_c_name_get(Eolian_Function_Type.PROP_SET)
762 797
763 @property 798 @cached_property
764 def full_c_method_name_legacy(self): 799 def full_c_method_name_legacy(self):
765 return self.full_c_name_get(Eolian_Function_Type.METHOD, True) 800 return self.full_c_name_get(Eolian_Function_Type.METHOD, True)
766 801
767 @property 802 @cached_property
768 def full_c_getter_name_legacy(self): 803 def full_c_getter_name_legacy(self):
769 return self.full_c_name_get(Eolian_Function_Type.PROP_GET, True) 804 return self.full_c_name_get(Eolian_Function_Type.PROP_GET, True)
770 805
771 @property 806 @cached_property
772 def full_c_setter_name_legacy(self): 807 def full_c_setter_name_legacy(self):
773 return self.full_c_name_get(Eolian_Function_Type.PROP_SET, True) 808 return self.full_c_name_get(Eolian_Function_Type.PROP_SET, True)
774 809
775 @property 810 @cached_property
776 def type(self): 811 def type(self):
777 return Eolian_Function_Type(lib.eolian_function_type_get(self._obj)) 812 return Eolian_Function_Type(lib.eolian_function_type_get(self._obj))
778 813
779 def scope_get(self, ftype): 814 def scope_get(self, ftype):
780 return Eolian_Object_Scope(lib.eolian_function_scope_get(self._obj, ftype)) 815 return Eolian_Object_Scope(lib.eolian_function_scope_get(self._obj, ftype))
781 816
782 @property 817 @cached_property
783 def method_scope(self): 818 def method_scope(self):
784 return self.scope_get(Eolian_Function_Type.METHOD) 819 return self.scope_get(Eolian_Function_Type.METHOD)
785 820
786 @property 821 @cached_property
787 def getter_scope(self): 822 def getter_scope(self):
788 return self.scope_get(Eolian_Function_Type.PROP_GET) 823 return self.scope_get(Eolian_Function_Type.PROP_GET)
789 824
790 @property 825 @cached_property
791 def setter_scope(self): 826 def setter_scope(self):
792 return self.scope_get(Eolian_Function_Type.PROP_SET) 827 return self.scope_get(Eolian_Function_Type.PROP_SET)
793 828
@@ -797,19 +832,19 @@ class Function(EolianBaseObject):
797 def is_legacy_only(self, ftype): 832 def is_legacy_only(self, ftype):
798 return bool(lib.eolian_function_is_legacy_only(self._obj, ftype)) 833 return bool(lib.eolian_function_is_legacy_only(self._obj, ftype))
799 834
800 @property 835 @cached_property
801 def is_class(self): 836 def is_class(self):
802 return bool(lib.eolian_function_is_class(self._obj)) 837 return bool(lib.eolian_function_is_class(self._obj))
803 838
804 @property 839 @cached_property
805 def is_beta(self): 840 def is_beta(self):
806 return bool(lib.eolian_function_is_beta(self._obj)) 841 return bool(lib.eolian_function_is_beta(self._obj))
807 842
808 @property 843 @cached_property
809 def object_is_const(self): 844 def object_is_const(self):
810 return bool(lib.eolian_function_object_is_const(self._obj)) 845 return bool(lib.eolian_function_object_is_const(self._obj))
811 846
812 @property 847 @cached_property
813 def class_(self): 848 def class_(self):
814 c_cls = lib.eolian_function_class_get(self._obj) 849 c_cls = lib.eolian_function_class_get(self._obj)
815 return Class(c_cls) if c_cls else None 850 return Class(c_cls) if c_cls else None
@@ -817,7 +852,7 @@ class Function(EolianBaseObject):
817 def is_constructor(self, klass): 852 def is_constructor(self, klass):
818 return bool(lib.eolian_function_is_constructor(self._obj, klass._obj)) 853 return bool(lib.eolian_function_is_constructor(self._obj, klass._obj))
819 854
820 # @property 855 # @cached_property
821 # def is_function_pointer(self): 856 # def is_function_pointer(self):
822 # return bool(lib.eolian_function_is_function_pointer(self._obj)) 857 # return bool(lib.eolian_function_is_function_pointer(self._obj))
823 858
@@ -865,33 +900,33 @@ class Function(EolianBaseObject):
865 def return_is_warn_unused(self, ftype): 900 def return_is_warn_unused(self, ftype):
866 return bool(lib.eolian_function_return_is_warn_unused(self._obj, ftype)) 901 return bool(lib.eolian_function_return_is_warn_unused(self._obj, ftype))
867 902
868 @property 903 @cached_property
869 def method_return_type(self): 904 def method_return_type(self):
870 return self.return_type_get(Eolian_Function_Type.METHOD) 905 return self.return_type_get(Eolian_Function_Type.METHOD)
871 906
872 @property 907 @cached_property
873 def getter_return_type(self): 908 def getter_return_type(self):
874 return self.return_type_get(Eolian_Function_Type.PROP_GET) 909 return self.return_type_get(Eolian_Function_Type.PROP_GET)
875 910
876 @property 911 @cached_property
877 def setter_return_type(self): 912 def setter_return_type(self):
878 return self.return_type_get(Eolian_Function_Type.PROP_SET) 913 return self.return_type_get(Eolian_Function_Type.PROP_SET)
879 914
880 @property 915 @cached_property
881 def prop_readable(self): 916 def prop_readable(self):
882 # TODO: maybe there is a better way to do this... 917 # TODO: maybe there is a better way to do this...
883 ftype = Eolian_Function_Type.PROP_GET 918 ftype = Eolian_Function_Type.PROP_GET
884 scope = lib.eolian_function_scope_get(self._obj, ftype) 919 scope = lib.eolian_function_scope_get(self._obj, ftype)
885 return True if scope != Eolian_Object_Scope.UNKNOWN else False 920 return True if scope != Eolian_Object_Scope.UNKNOWN else False
886 921
887 @property 922 @cached_property
888 def prop_writable(self): 923 def prop_writable(self):
889 # TODO: maybe there is a better way to do this... 924 # TODO: maybe there is a better way to do this...
890 ftype = Eolian_Function_Type.PROP_SET 925 ftype = Eolian_Function_Type.PROP_SET
891 scope = lib.eolian_function_scope_get(self._obj, ftype) 926 scope = lib.eolian_function_scope_get(self._obj, ftype)
892 return True if scope != Eolian_Object_Scope.UNKNOWN else False 927 return True if scope != Eolian_Object_Scope.UNKNOWN else False
893 928
894 @property 929 @cached_property
895 def implement(self): 930 def implement(self):
896 c_impl = lib.eolian_function_implement_get(self._obj) 931 c_impl = lib.eolian_function_implement_get(self._obj)
897 return Implement(c_impl) if c_impl else None 932 return Implement(c_impl) if c_impl else None
@@ -902,37 +937,37 @@ class Function_Parameter(EolianBaseObject):
902 return "<eolian.Function_Parameter '{0.name}', type={0.type}," \ 937 return "<eolian.Function_Parameter '{0.name}', type={0.type}," \
903 " optional={0.is_optional}, nullable={0.is_nullable}>".format(self) 938 " optional={0.is_optional}, nullable={0.is_nullable}>".format(self)
904 939
905 @property 940 @cached_property
906 def name(self): 941 def name(self):
907 return _str_to_py(lib.eolian_parameter_name_get(self._obj)) 942 return _str_to_py(lib.eolian_parameter_name_get(self._obj))
908 943
909 @property 944 @cached_property
910 def direction(self): 945 def direction(self):
911 return Eolian_Parameter_Dir(lib.eolian_parameter_direction_get(self._obj)) 946 return Eolian_Parameter_Dir(lib.eolian_parameter_direction_get(self._obj))
912 947
913 @property 948 @cached_property
914 def documentation(self): 949 def documentation(self):
915 c_doc = lib.eolian_parameter_documentation_get(self._obj) 950 c_doc = lib.eolian_parameter_documentation_get(self._obj)
916 return Documentation(c_doc) if c_doc else None 951 return Documentation(c_doc) if c_doc else None
917 952
918 @property 953 @cached_property
919 def is_nonull(self): 954 def is_nonull(self):
920 return bool(lib.eolian_parameter_is_nonull(self._obj)) 955 return bool(lib.eolian_parameter_is_nonull(self._obj))
921 956
922 @property 957 @cached_property
923 def is_nullable(self): 958 def is_nullable(self):
924 return bool(lib.eolian_parameter_is_nullable(self._obj)) 959 return bool(lib.eolian_parameter_is_nullable(self._obj))
925 960
926 @property 961 @cached_property
927 def is_optional(self): 962 def is_optional(self):
928 return bool(lib.eolian_parameter_is_optional(self._obj)) 963 return bool(lib.eolian_parameter_is_optional(self._obj))
929 964
930 @property 965 @cached_property
931 def type(self): 966 def type(self):
932 c_type = lib.eolian_parameter_type_get(self._obj) 967 c_type = lib.eolian_parameter_type_get(self._obj)
933 return Type(c_type) if c_type else None 968 return Type(c_type) if c_type else None
934 969
935 @property 970 @cached_property
936 def default_value(self): 971 def default_value(self):
937 c_expr = lib.eolian_parameter_default_value_get(self._obj) 972 c_expr = lib.eolian_parameter_default_value_get(self._obj)
938 return Expression(c_expr) if c_expr else None 973 return Expression(c_expr) if c_expr else None
@@ -942,21 +977,22 @@ class Implement(EolianBaseObject):
942 def __repr__(self): 977 def __repr__(self):
943 return "<eolian.Implement '{0.full_name}'>".format(self) 978 return "<eolian.Implement '{0.full_name}'>".format(self)
944 979
945 @property 980 @cached_property
946 def full_name(self): 981 def full_name(self):
947 return _str_to_py(lib.eolian_implement_full_name_get(self._obj)) 982 return _str_to_py(lib.eolian_implement_full_name_get(self._obj))
948 983
949 @property 984 @cached_property
950 def class_(self): 985 def class_(self):
951 c_cls = lib.eolian_implement_class_get(self._obj) 986 c_cls = lib.eolian_implement_class_get(self._obj)
952 return Class(c_cls) if c_cls else None 987 return Class(c_cls) if c_cls else None
953 988
954 @property 989 @cached_property
955 def function(self): 990 def function(self):
956 c_func = lib.eolian_implement_function_get(self._obj, None) 991 c_func = lib.eolian_implement_function_get(self._obj, None)
957 return Function(c_func) if c_func else None 992 return Function(c_func) if c_func else None
958 993
959 def documentation_get(self, ftype=Eolian_Function_Type.METHOD): 994 def documentation_get(self, ftype=Eolian_Function_Type.METHOD):
995 # something strange in this eolian api :/ (see 'documentation' property
960 c_doc = lib.eolian_implement_documentation_get(self._obj, ftype) 996 c_doc = lib.eolian_implement_documentation_get(self._obj, ftype)
961 return Documentation(c_doc) if c_doc else None 997 return Documentation(c_doc) if c_doc else None
962 # TODO implement util properties for documentation_get 998 # TODO implement util properties for documentation_get
@@ -973,11 +1009,11 @@ class Implement(EolianBaseObject):
973 return bool(lib.eolian_implement_is_pure_virtual(self._obj, ftype)) 1009 return bool(lib.eolian_implement_is_pure_virtual(self._obj, ftype))
974 # TODO implement util properties for is_pure_virtual 1010 # TODO implement util properties for is_pure_virtual
975 1011
976 @property 1012 @cached_property
977 def is_prop_set(self): 1013 def is_prop_set(self):
978 return bool(lib.eolian_implement_is_prop_set(self._obj)) 1014 return bool(lib.eolian_implement_is_prop_set(self._obj))
979 1015
980 @property 1016 @cached_property
981 def is_prop_get(self): 1017 def is_prop_get(self):
982 return bool(lib.eolian_implement_is_prop_get(self._obj)) 1018 return bool(lib.eolian_implement_is_prop_get(self._obj))
983 1019
@@ -990,16 +1026,16 @@ class Implement(EolianBaseObject):
990 return not self.is_property 1026 return not self.is_property
991 1027
992 1028
993class Type(EolianBaseObject): # OK (4 eolian issue) 1029class Type(EolianBaseObject): # OK (4 TODO Unit*)
994 def __repr__(self): 1030 def __repr__(self):
995 # return "<eolian.Type '{0.full_name}', type: {0.type!s}, c_type: '{0.c_type}'>".format(self) 1031 # return "<eolian.Type '{0.full_name}', type: {0.type!s}, c_type: '{0.c_type}'>".format(self)
996 return "<eolian.Type '{0.full_name}', type={0.type!s}>".format(self) 1032 return "<eolian.Type '{0.full_name}', type={0.type!s}>".format(self)
997 1033
998 @property 1034 @cached_property
999 def name(self): 1035 def name(self):
1000 return _str_to_py(lib.eolian_type_name_get(self._obj)) 1036 return _str_to_py(lib.eolian_type_name_get(self._obj))
1001 1037
1002 @property 1038 @cached_property
1003 def full_name(self): 1039 def full_name(self):
1004 return _str_to_py(lib.eolian_type_full_name_get(self._obj)) 1040 return _str_to_py(lib.eolian_type_full_name_get(self._obj))
1005 1041
@@ -1007,95 +1043,95 @@ class Type(EolianBaseObject): # OK (4 eolian issue)
1007 def namespaces(self): 1043 def namespaces(self):
1008 return Iterator(_str_to_py, lib.eolian_type_namespaces_get(self._obj)) 1044 return Iterator(_str_to_py, lib.eolian_type_namespaces_get(self._obj))
1009 1045
1010 @property 1046 @cached_property
1011 def namespace(self): 1047 def namespace(self):
1012 return '.'.join(self.namespaces) 1048 return '.'.join(self.namespaces)
1013 1049
1014 @property 1050 @cached_property
1015 def free_func(self): 1051 def free_func(self):
1016 return _str_to_py(lib.eolian_type_free_func_get(self._obj)) 1052 return _str_to_py(lib.eolian_type_free_func_get(self._obj))
1017 1053
1018 @property 1054 @cached_property
1019 def type(self): 1055 def type(self):
1020 return Eolian_Type_Type(lib.eolian_type_type_get(self._obj)) 1056 return Eolian_Type_Type(lib.eolian_type_type_get(self._obj))
1021 1057
1022 @property 1058 @cached_property
1023 def builtin_type(self): 1059 def builtin_type(self):
1024 return Eolian_Type_Builtin_Type(lib.eolian_type_builtin_type_get(self._obj)) 1060 return Eolian_Type_Builtin_Type(lib.eolian_type_builtin_type_get(self._obj))
1025 1061
1026 # TODO FIXME STRANGE API (need Eolian_Unit*) 1062 # TODO FIXME STRANGE API (need Eolian_Unit*)
1027 @property 1063 @cached_property
1028 def c_type(self): 1064 def c_type(self):
1029 # return _str_to_py(lib.eolian_type_c_type_get(self._obj)) 1065 # return _str_to_py(lib.eolian_type_c_type_get(self._obj))
1030 return 'FIXME' 1066 return 'FIXME'
1031 1067
1032 # TODO FIXME STRANGE API (need Eolian_Unit*) 1068 # TODO FIXME STRANGE API (need Eolian_Unit*)
1033 # @property 1069 # @cached_property
1034 # def typedecl(self): 1070 # def typedecl(self):
1035 # c_tdecl = lib.eolian_type_typedecl_get(self._obj) 1071 # c_tdecl = lib.eolian_type_typedecl_get(self._obj)
1036 # return Typedecl(c_tdecl) if c_tdecl else None 1072 # return Typedecl(c_tdecl) if c_tdecl else None
1037 1073
1038 @property 1074 @cached_property
1039 def base_type(self): 1075 def base_type(self):
1040 c_type = lib.eolian_type_base_type_get(self._obj) 1076 c_type = lib.eolian_type_base_type_get(self._obj)
1041 return Type(c_type) if c_type else None 1077 return Type(c_type) if c_type else None
1042 1078
1043 @property 1079 @cached_property
1044 def next_type(self): 1080 def next_type(self):
1045 c_type = lib.eolian_type_next_type_get(self._obj) 1081 c_type = lib.eolian_type_next_type_get(self._obj)
1046 return Type(c_type) if c_type else None 1082 return Type(c_type) if c_type else None
1047 1083
1048 # TODO FIXME STRANGE API (need Eolian_Unit*) 1084 # TODO FIXME STRANGE API (need Eolian_Unit*)
1049 # @property 1085 # @cached_property
1050 # def aliased_base(self): 1086 # def aliased_base(self):
1051 # c_type = lib.eolian_type_aliased_base_get(self._obj) 1087 # c_type = lib.eolian_type_aliased_base_get(self._obj)
1052 # return Type(c_type) if c_type else None 1088 # return Type(c_type) if c_type else None
1053 1089
1054 # TODO FIXME STRANGE API (need Eolian_Unit*) 1090 # TODO FIXME STRANGE API (need Eolian_Unit*)
1055 # @property 1091 # @cached_property
1056 # def class_(self): 1092 # def class_(self):
1057 # c_cls = lib.eolian_type_class_get(self._obj) 1093 # c_cls = lib.eolian_type_class_get(self._obj)
1058 # return Class(c_cls) if c_cls else None 1094 # return Class(c_cls) if c_cls else None
1059 1095
1060 @property 1096 @cached_property
1061 def file(self): 1097 def file(self):
1062 return _str_to_py(lib.eolian_type_file_get(self._obj)) 1098 return _str_to_py(lib.eolian_type_file_get(self._obj))
1063 1099
1064 @property 1100 @cached_property
1065 def is_owned(self): 1101 def is_owned(self):
1066 return bool(lib.eolian_type_is_owned(self._obj)) 1102 return bool(lib.eolian_type_is_owned(self._obj))
1067 1103
1068 @property 1104 @cached_property
1069 def is_const(self): 1105 def is_const(self):
1070 return bool(lib.eolian_type_is_const(self._obj)) 1106 return bool(lib.eolian_type_is_const(self._obj))
1071 1107
1072 @property 1108 @cached_property
1073 def is_ptr(self): 1109 def is_ptr(self):
1074 return bool(lib.eolian_type_is_ptr(self._obj)) 1110 return bool(lib.eolian_type_is_ptr(self._obj))
1075 1111
1076 1112
1077class Typedecl(EolianBaseObject): # OK (2 TODO) 1113class Typedecl(EolianBaseObject): # OK (2 TODO Unit*)
1078 def __repr__(self): 1114 def __repr__(self):
1079 return "<eolian.Typedecl '{0.full_name}', type={0.type!s}>".format(self) 1115 return "<eolian.Typedecl '{0.full_name}', type={0.type!s}>".format(self)
1080 1116
1081 @property 1117 @cached_property
1082 def name(self): 1118 def name(self):
1083 return _str_to_py(lib.eolian_typedecl_name_get(self._obj)) 1119 return _str_to_py(lib.eolian_typedecl_name_get(self._obj))
1084 1120
1085 @property 1121 @cached_property
1086 def full_name(self): 1122 def full_name(self):
1087 return _str_to_py(lib.eolian_typedecl_full_name_get(self._obj)) 1123 return _str_to_py(lib.eolian_typedecl_full_name_get(self._obj))
1088 1124
1089 @property 1125 @cached_property
1090 def file(self): 1126 def file(self):
1091 return _str_to_py(lib.eolian_typedecl_file_get(self._obj)) 1127 return _str_to_py(lib.eolian_typedecl_file_get(self._obj))
1092 1128
1093 @property 1129 @cached_property
1094 def type(self): 1130 def type(self):
1095 return Eolian_Typedecl_Type(lib.eolian_typedecl_type_get(self._obj)) 1131 return Eolian_Typedecl_Type(lib.eolian_typedecl_type_get(self._obj))
1096 1132
1097 # TODO FIX THIS, need Eolian_Unit* param ??? 1133 # TODO FIX THIS, need Eolian_Unit* param ???
1098 # @property 1134 # @cached_property
1099 # def c_type(self): 1135 # def c_type(self):
1100 # return _str_to_py(lib.eolian_typedecl_c_type_get(self._obj)) 1136 # return _str_to_py(lib.eolian_typedecl_c_type_get(self._obj))
1101 1137
@@ -1103,15 +1139,15 @@ class Typedecl(EolianBaseObject): # OK (2 TODO)
1103 def namespaces(self): 1139 def namespaces(self):
1104 return Iterator(_str_to_py, lib.eolian_typedecl_namespaces_get(self._obj)) 1140 return Iterator(_str_to_py, lib.eolian_typedecl_namespaces_get(self._obj))
1105 1141
1106 @property 1142 @cached_property
1107 def namespace(self): 1143 def namespace(self):
1108 return '.'.join(self.namespaces) 1144 return '.'.join(self.namespaces)
1109 1145
1110 @property 1146 @cached_property
1111 def free_func(self): 1147 def free_func(self):
1112 return _str_to_py(lib.eolian_typedecl_free_func_get(self._obj)) 1148 return _str_to_py(lib.eolian_typedecl_free_func_get(self._obj))
1113 1149
1114 @property 1150 @cached_property
1115 def is_extern(self): 1151 def is_extern(self):
1116 return bool(lib.eolian_typedecl_is_extern(self._obj)) 1152 return bool(lib.eolian_typedecl_is_extern(self._obj))
1117 1153
@@ -1133,27 +1169,27 @@ class Typedecl(EolianBaseObject): # OK (2 TODO)
1133 c_field = lib.eolian_typedecl_struct_field_get(self._obj, _str_to_bytes(field)) 1169 c_field = lib.eolian_typedecl_struct_field_get(self._obj, _str_to_bytes(field))
1134 return Struct_Type_Field(c_field) if c_field else None 1170 return Struct_Type_Field(c_field) if c_field else None
1135 1171
1136 @property 1172 @cached_property
1137 def base_type(self): 1173 def base_type(self):
1138 c_type = lib.eolian_typedecl_base_type_get(self._obj) 1174 c_type = lib.eolian_typedecl_base_type_get(self._obj)
1139 return Type(c_type) if c_type else None 1175 return Type(c_type) if c_type else None
1140 1176
1141 # TODO FIX THIS, need Eolian_Unit* param ??? 1177 # TODO FIX THIS, need Eolian_Unit* param ???
1142 # @property 1178 # @cached_property
1143 # def aliased_base(self): 1179 # def aliased_base(self):
1144 # c_type = lib.eolian_typedecl_aliased_base_get(self._obj) 1180 # c_type = lib.eolian_typedecl_aliased_base_get(self._obj)
1145 # return Type(c_type) if c_type else None 1181 # return Type(c_type) if c_type else None
1146 1182
1147 @property 1183 @cached_property
1148 def documentation(self): 1184 def documentation(self):
1149 c_doc = lib.eolian_typedecl_documentation_get(self._obj) 1185 c_doc = lib.eolian_typedecl_documentation_get(self._obj)
1150 return Documentation(c_doc) if c_doc else None 1186 return Documentation(c_doc) if c_doc else None
1151 1187
1152 @property 1188 @cached_property
1153 def enum_legacy_prefix(self): 1189 def enum_legacy_prefix(self):
1154 return _str_to_py(lib.eolian_typedecl_enum_legacy_prefix_get(self._obj)) 1190 return _str_to_py(lib.eolian_typedecl_enum_legacy_prefix_get(self._obj))
1155 1191
1156 @property 1192 @cached_property
1157 def function_pointer(self): 1193 def function_pointer(self):
1158 c_func = lib.eolian_typedecl_function_pointer_get(self._obj) 1194 c_func = lib.eolian_typedecl_function_pointer_get(self._obj)
1159 return Function(c_func) if c_func else None 1195 return Function(c_func) if c_func else None
@@ -1163,23 +1199,23 @@ class Enum_Type_Field(EolianBaseObject):
1163 def __repr__(self): 1199 def __repr__(self):
1164 return "<eolian.Enum_Type_Field '{0.name}', c_name='{0.c_name}'>".format(self) 1200 return "<eolian.Enum_Type_Field '{0.name}', c_name='{0.c_name}'>".format(self)
1165 1201
1166 @property 1202 @cached_property
1167 def name(self): 1203 def name(self):
1168 return _str_to_py(lib.eolian_typedecl_enum_field_name_get(self._obj)) 1204 return _str_to_py(lib.eolian_typedecl_enum_field_name_get(self._obj))
1169 1205
1170 @property 1206 @cached_property
1171 def c_name(self): 1207 def c_name(self):
1172 s = lib.eolian_typedecl_enum_field_c_name_get(self._obj) 1208 s = lib.eolian_typedecl_enum_field_c_name_get(self._obj)
1173 ret = _str_to_py(s) 1209 ret = _str_to_py(s)
1174 lib.eina_stringshare_del(c_void_p(s)) 1210 lib.eina_stringshare_del(c_void_p(s))
1175 return ret 1211 return ret
1176 1212
1177 @property 1213 @cached_property
1178 def value(self): 1214 def value(self):
1179 c_expr = lib.eolian_typedecl_enum_field_value_get(self._obj, True) 1215 c_expr = lib.eolian_typedecl_enum_field_value_get(self._obj, True)
1180 return Expression(c_expr) if c_expr else None 1216 return Expression(c_expr) if c_expr else None
1181 1217
1182 @property 1218 @cached_property
1183 def documentation(self): 1219 def documentation(self):
1184 c_doc = lib.eolian_typedecl_enum_field_documentation_get(self._obj) 1220 c_doc = lib.eolian_typedecl_enum_field_documentation_get(self._obj)
1185 return Documentation(c_doc) if c_doc else None 1221 return Documentation(c_doc) if c_doc else None
@@ -1189,16 +1225,16 @@ class Struct_Type_Field(EolianBaseObject):
1189 def __repr__(self): 1225 def __repr__(self):
1190 return "<eolian.Struct_Type_Field '{0.name}', type={0.type!s}>".format(self) 1226 return "<eolian.Struct_Type_Field '{0.name}', type={0.type!s}>".format(self)
1191 1227
1192 @property 1228 @cached_property
1193 def name(self): 1229 def name(self):
1194 return _str_to_py(lib.eolian_typedecl_struct_field_name_get(self._obj)) 1230 return _str_to_py(lib.eolian_typedecl_struct_field_name_get(self._obj))
1195 1231
1196 @property 1232 @cached_property
1197 def type(self): 1233 def type(self):
1198 c_type = lib.eolian_typedecl_struct_field_type_get(self._obj) 1234 c_type = lib.eolian_typedecl_struct_field_type_get(self._obj)
1199 return Type(c_type) if c_type else None 1235 return Type(c_type) if c_type else None
1200 1236
1201 @property 1237 @cached_property
1202 def documentation(self): 1238 def documentation(self):
1203 c_doc = lib.eolian_typedecl_struct_field_documentation_get(self._obj) 1239 c_doc = lib.eolian_typedecl_struct_field_documentation_get(self._obj)
1204 return Documentation(c_doc) if c_doc else None 1240 return Documentation(c_doc) if c_doc else None
@@ -1208,40 +1244,40 @@ class Expression(EolianBaseObject):
1208 def __repr__(self): 1244 def __repr__(self):
1209 return "<eolian.Expression type={0.type!s}, serialize='{0.serialize}'>".format(self) 1245 return "<eolian.Expression type={0.type!s}, serialize='{0.serialize}'>".format(self)
1210 1246
1211 @property 1247 @cached_property
1212 def type(self): 1248 def type(self):
1213 return Eolian_Expression_Type(lib.eolian_expression_type_get(self._obj)) 1249 return Eolian_Expression_Type(lib.eolian_expression_type_get(self._obj))
1214 1250
1215 # TODO: EAPI Eolian_Value eolian_expression_value_get(const Eolian_Expression *expr); 1251 # TODO: EAPI Eolian_Value eolian_expression_value_get(const Eolian_Expression *expr);
1216 1252
1217 @property 1253 @cached_property
1218 def serialize(self): 1254 def serialize(self):
1219 s = lib.eolian_expression_serialize(self._obj) 1255 s = lib.eolian_expression_serialize(self._obj)
1220 ret = _str_to_py(s) 1256 ret = _str_to_py(s)
1221 lib.eina_stringshare_del(c_void_p(s)) 1257 lib.eina_stringshare_del(c_void_p(s))
1222 return ret 1258 return ret
1223 1259
1224 @property 1260 @cached_property
1225 def binary_operator(self): 1261 def binary_operator(self):
1226 c_op = lib.eolian_expression_binary_operator_get(self._obj) 1262 c_op = lib.eolian_expression_binary_operator_get(self._obj)
1227 return Eolian_Binary_Operator(c_op) if c_op is not None else None 1263 return Eolian_Binary_Operator(c_op) if c_op is not None else None
1228 1264
1229 @property 1265 @cached_property
1230 def binary_lhs(self): 1266 def binary_lhs(self):
1231 c_expr = lib.eolian_expression_binary_lhs_get(self._obj) 1267 c_expr = lib.eolian_expression_binary_lhs_get(self._obj)
1232 return Expression(c_expr) if c_expr else None 1268 return Expression(c_expr) if c_expr else None
1233 1269
1234 @property 1270 @cached_property
1235 def binary_rhs(self): 1271 def binary_rhs(self):
1236 c_expr = lib.eolian_expression_binary_rhs_get(self._obj) 1272 c_expr = lib.eolian_expression_binary_rhs_get(self._obj)
1237 return Expression(c_expr) if c_expr else None 1273 return Expression(c_expr) if c_expr else None
1238 1274
1239 @property 1275 @cached_property
1240 def unary_operator(self): 1276 def unary_operator(self):
1241 c_op = lib.eolian_expression_unary_operator_get(self._obj) 1277 c_op = lib.eolian_expression_unary_operator_get(self._obj)
1242 return Eolian_Unary_Operator(c_op) if c_op is not None else None 1278 return Eolian_Unary_Operator(c_op) if c_op is not None else None
1243 1279
1244 @property 1280 @cached_property
1245 def unary_expression(self): 1281 def unary_expression(self):
1246 c_expr = lib.eolian_expression_unary_expression_get(self._obj) 1282 c_expr = lib.eolian_expression_unary_expression_get(self._obj)
1247 return Expression(c_expr) if c_expr is not None else None 1283 return Expression(c_expr) if c_expr is not None else None
@@ -1251,11 +1287,11 @@ class Variable(EolianBaseObject):
1251 def __repr__(self): 1287 def __repr__(self):
1252 return "<eolian.Variable '{0.full_name}', type={0.type!s}, file={0.file}>".format(self) 1288 return "<eolian.Variable '{0.full_name}', type={0.type!s}, file={0.file}>".format(self)
1253 1289
1254 @property 1290 @cached_property
1255 def name(self): 1291 def name(self):
1256 return _str_to_py(lib.eolian_variable_name_get(self._obj)) 1292 return _str_to_py(lib.eolian_variable_name_get(self._obj))
1257 1293
1258 @property 1294 @cached_property
1259 def full_name(self): 1295 def full_name(self):
1260 return _str_to_py(lib.eolian_variable_full_name_get(self._obj)) 1296 return _str_to_py(lib.eolian_variable_full_name_get(self._obj))
1261 1297
@@ -1263,34 +1299,33 @@ class Variable(EolianBaseObject):
1263 def namespaces(self): 1299 def namespaces(self):
1264 return Iterator(_str_to_py, lib.eolian_variable_namespaces_get(self._obj)) 1300 return Iterator(_str_to_py, lib.eolian_variable_namespaces_get(self._obj))
1265 1301
1266 @property 1302 @cached_property
1267 def namespace(self): 1303 def namespace(self):
1268 return '.'.join(self.namespaces) 1304 return '.'.join(self.namespaces)
1269 1305
1270 @property 1306 @cached_property
1271 def type(self): 1307 def type(self):
1272 return Eolian_Variable_Type(lib.eolian_variable_type_get(self._obj)) 1308 return Eolian_Variable_Type(lib.eolian_variable_type_get(self._obj))
1273 1309
1274 @property 1310 @cached_property
1275 def value(self): 1311 def value(self):
1276 c_expr = lib.eolian_variable_value_get(self._obj) 1312 c_expr = lib.eolian_variable_value_get(self._obj)
1277 return Expression(c_expr) if c_expr else None 1313 return Expression(c_expr) if c_expr else None
1278 1314
1279 @property 1315 @cached_property
1280 def file(self): 1316 def file(self):
1281 return _str_to_py(lib.eolian_variable_file_get(self._obj)) 1317 return _str_to_py(lib.eolian_variable_file_get(self._obj))
1282 1318
1283 @property 1319 @cached_property
1284 def base_type(self): 1320 def base_type(self):
1285 c_type = lib.eolian_variable_base_type_get(self._obj) 1321 c_type = lib.eolian_variable_base_type_get(self._obj)
1286 return Type(c_type) if c_type else None 1322 return Type(c_type) if c_type else None
1287 1323
1288 @property 1324 @cached_property
1289 def is_extern(self): 1325 def is_extern(self):
1290 return bool(lib.eolian_variable_is_extern(self._obj)) 1326 return bool(lib.eolian_variable_is_extern(self._obj))
1291 1327
1292 1328 @cached_property
1293 @property
1294 def documentation(self): 1329 def documentation(self):
1295 c_doc = lib.eolian_variable_documentation_get(self._obj) 1330 c_doc = lib.eolian_variable_documentation_get(self._obj)
1296 return Documentation(c_doc) if c_doc else None 1331 return Documentation(c_doc) if c_doc else None
@@ -1300,25 +1335,25 @@ class Declaration(EolianBaseObject):
1300 def __repr__(self): 1335 def __repr__(self):
1301 return "<eolian.Declaration '{0.name}'>".format(self) 1336 return "<eolian.Declaration '{0.name}'>".format(self)
1302 1337
1303 @property 1338 @cached_property
1304 def name(self): 1339 def name(self):
1305 return _str_to_py(lib.eolian_declaration_name_get(self._obj)) 1340 return _str_to_py(lib.eolian_declaration_name_get(self._obj))
1306 1341
1307 @property 1342 @cached_property
1308 def type(self): 1343 def type(self):
1309 return Eolian_Declaration_Type(lib.eolian_declaration_type_get(self._obj)) 1344 return Eolian_Declaration_Type(lib.eolian_declaration_type_get(self._obj))
1310 1345
1311 @property 1346 @cached_property
1312 def class_(self): 1347 def class_(self):
1313 c_cls = lib.eolian_declaration_class_get(self._obj) 1348 c_cls = lib.eolian_declaration_class_get(self._obj)
1314 return Class(c_cls) if c_cls else None 1349 return Class(c_cls) if c_cls else None
1315 1350
1316 @property 1351 @cached_property
1317 def data_type(self): 1352 def data_type(self):
1318 c_typedec = lib.eolian_declaration_data_type_get(self._obj) 1353 c_typedec = lib.eolian_declaration_data_type_get(self._obj)
1319 return Typedecl(c_typedec) if c_typedec else None 1354 return Typedecl(c_typedec) if c_typedec else None
1320 1355
1321 @property 1356 @cached_property
1322 def variable(self): 1357 def variable(self):
1323 c_var = lib.eolian_declaration_variable_get(self._obj) 1358 c_var = lib.eolian_declaration_variable_get(self._obj)
1324 return Variable(c_var) if c_var else None 1359 return Variable(c_var) if c_var else None
@@ -1330,7 +1365,7 @@ class _Eolian_Doc_Token_Struct(ctypes.Structure):
1330 ("text_end", c_char_p)] 1365 ("text_end", c_char_p)]
1331 1366
1332 1367
1333class Documentation(EolianBaseObject): 1368class Documentation(EolianBaseObject): # OK (1 TODO Unit*)
1334 # def __repr__(self): 1369 # def __repr__(self):
1335 # return "<eolian.Documentation '{0.name}'>".format(self) 1370 # return "<eolian.Documentation '{0.name}'>".format(self)
1336 1371
@@ -1338,24 +1373,24 @@ class Documentation(EolianBaseObject):
1338 # def string_split(self, string): 1373 # def string_split(self, string):
1339 # c_list = lib.eolian_documentation_string_split 1374 # c_list = lib.eolian_documentation_string_split
1340 1375
1341 @property 1376 @cached_property
1342 def summary(self): 1377 def summary(self):
1343 return _str_to_py(lib.eolian_documentation_summary_get(self._obj)) 1378 return _str_to_py(lib.eolian_documentation_summary_get(self._obj))
1344 1379
1345 @property 1380 @cached_property
1346 def description(self): 1381 def description(self):
1347 return _str_to_py(lib.eolian_documentation_description_get(self._obj)) 1382 return _str_to_py(lib.eolian_documentation_description_get(self._obj))
1348 1383
1349 @property 1384 @cached_property
1350 def since(self): 1385 def since(self):
1351 return _str_to_py(lib.eolian_documentation_since_get(self._obj)) 1386 return _str_to_py(lib.eolian_documentation_since_get(self._obj))
1352 1387
1353 @property 1388 @cached_property
1354 def summary_tokens(self): 1389 def summary_tokens(self):
1355 """ return a list of paragraphs, each one is a list of tokens """ 1390 """ return a list of paragraphs, each one is a list of tokens """
1356 return self._tokenize(self.summary) 1391 return self._tokenize(self.summary)
1357 1392
1358 @property 1393 @cached_property
1359 def description_tokens(self): 1394 def description_tokens(self):
1360 """ return a list of paragraphs, each one is a list of tokens """ 1395 """ return a list of paragraphs, each one is a list of tokens """
1361 return self._tokenize(self.description) 1396 return self._tokenize(self.description)
@@ -1501,5 +1536,5 @@ if __name__ == '__main__':
1501 else: 1536 else:
1502 print('Additional arguments') 1537 print('Additional arguments')
1503 print('====================') 1538 print('====================')
1504 print(' --all To list all functions') 1539 print(' --all To list all functions found in Eolian.h')
1505 print() 1540 print()