3 // Copyright (c) 2014 - Michele De Stefano (micdestefano@users.sourceforge.net)
5 // Distributed under the MIT License (See accompanying file LICENSE)
9 * \example obj_usage.pycmd
11 * Shows the usage of the obj_usage extension from the Python prompt.
14 >>> import obj_usage as ou
19 >>> ou.set_attr(a,'x',1.1)
23 >>> ou.print_attr(a,'x')
25 >>> ou.print_attr(a,'y')
26 Traceback (most recent call last):
27 File "<stdin>", line 1, in <module>
28 RuntimeError: Cannot get a double value
29 >>> # Obviously the implemented function is able to retrieve only double values
32 >>> ou.print_attr(a,'z')
45 ... def __call__(self):
46 ... print 'Output from __call__'
47 ... def test_call_attr(self):
48 ... print 'Output from test_call_attr'
53 >>> ou.test_call_attr(b,'test_call_attr')
54 Output from test_call_attr
56 ... def __call__(self,a=1,b=2,c=3):
57 ... print "a = ",a,"\nb = ",b,"\nc = ",c,"\n"
60 >>> ou.test_call_args(a,())
65 >>> ou.test_call_args(a,('aa','bb',[1,2,3]))
70 >>> ou.test_call_args_kw(a,(7,),{'b':5,'c':6})
75 >>> ou.test_call_args_kw(a,(),{'b':5,'c':6})
80 >>> ou.test_call_args_kw(a,(),{'b':5,'c':6,'a':8})