Closed despiegk closed 4 years ago
3BOTDEVEL:3bottest:~: kosmos -p 'j.tutorials.worldtest.scheduling.test()'
Mon 18 09:03:03 <string> - 1 - <module> : EXCEPTION:
AttributeError("'group_j__tutorials' object has no attribute 'worldtest'",)
--TRACEBACK------------------
<string> in <module>
1
-----------------------------
Is this code pushed? i've latest development_3git in all repos (also re-did jsx generate
).
Code was pushed and still investigating.
It seems like _properties_names_get
for j.basclasses.object
based objects only, it returns empty list. Any class that inherits j.baseclasses.object
might have this problem (not e.g. j.baseclasses.object_config
).
So, JSBase._inspect()
get called earlier and newer properties defined in _init
cannot be listed.
Till now, i didn't get the root cause of the problem, only calling obj._insepct()
before trying to list properties would work, and don't know if it's the right solution.
I found the main issue here, in JSBase
we call self.__init_class()
first:
which results in calling other methods that call properties
, which if called once, will just get old values if called again, so if _init
is called after, and it introduces some new properties set as self.prop....
inside the method, they won't get listed by calling properties
again.
Now i don't know the what should be the actual order of calling __init_class
and _init
inside JSBase
(even got confused by how much inits are there!):
I added this fix https://github.com/threefoldtech/jumpscaleX_core/pull/248/commits/7a9040e73ce511e0e442cd997aeb70920c99f8d4.
It contains the solution mentioned earlier
...only calling obj._insepct() before trying to list properties would work, and don't know if it's the right solution.
not working with me as below steps
3BOTDEVEL:3bot:~: kosmos -p 'j.tutorials.worldtest.scheduling.test()'
Wed 20 11:07:26 BCDB.py - 448 - bcdb : load model:jumpscale.bcdb.acl.circle.2
Wed 20 11:07:26 BCDB.py - 448 - bcdb : load model:jumpscale.bcdb.acl.user.2
Wed 20 11:07:26 BCDB.py - 448 - bcdb : load model:jumpscale.example.ship.1
Wed 20 11:07:26 BCDB.py - 87 - bcdb : BCDB INIT DONE:system
Wed 20 11:07:26 6551e65f3b187bf1b.py - 31 - 1_0efba627421ce096551e65f3b187bf1b : init index:jumpscale.example.ship.1
waittest:1
waittest:1
waittest:1
waittest:1
waittest:1
waittest:1
waittest:1
open new ksomos shell
all jsx are in development_3git
3BOTDEVEL:3bot:jumpscaleX_core: git log -1
commit 0f70acd4e4a630c46d0d48e16fe9bd40fddec741 (HEAD -> development_3git, origin/development_3git)
Author: kristof de spiegeleer <>
Date: Wed Nov 20 06:08:26 2019 +0100
don't remove servers from j.... yet
@Pishoy the code was changed, you cannot test it this way kosmos -p 'j.tutorials.worldtest.scheduling.test()'
Maybe you can put a j.shell() before or so.
Also, this won't work in new kosmos sessions, only using j.shell() as it's embedded and you can access local variables.
after adding js_shell before ship2.scheduler.sleep_time, it works
jsx version
3BOTDEVEL:jsx:jumpscaleX_core: git log -1
commit 0f70acd4e4a630c46d0d48e16fe9bd40fddec741 (HEAD -> development_3git, origin/development_3git)
Author: kristof de spiegeleer <>
Date: Wed Nov 20 06:08:26 2019 +0100
don't remove servers from j.... yet
used
`kosmos -p 'j.tutorials.worldtest.scheduling.test()'