For the record, at first I could not duplicate this error. But once I did I
determined that this is not a efl-1.19.1 nor an issue with 1.19.1's
associated python-efl as I can duplicate the same issue using efl1.18.4 and
appropriate python-efl.

The fact only some users got this error as well as the specific nature of
the error message:

ValueError: Eo object at 0x40000002662348f1 of type Edje.Object does not
 have a mapping!

and rasters comment  "the preferences-system would probably end up being
sourced from theme thus it'd be an edje object, NOT an evas image object,
and the window wants an evas image object. not an edje object."

lead me to believe that it had something to do with specifics of the users
configuration. I was not getting the error at first, but found that opening
elementary_config and changing the Icon settings to use Elementary theme
icons then I get the above error.

so before changing elm setttings to use elm theme the
code icon.object_get() or icon.object returns type: <type 'efl.evas.Image'>
or if I try to print it: <<Image object (Eo) at 0xb4b7107c (obj=0x40002829,
parent=0x40001112, refcount=6)> ( geometry=(0, 0, 0, 0), color=(255, 255,
255, 255), layer=0, clip=False, visible=False)>

BUT after setting elm settings to use the theme icons icon.object,
icon.object_get() spit out the error noted above. One can not take the type
print or use in any python statement. THAT is what needs fixed in my mind.
A python-efl issue.

BUT again as far as Jeffs specific error goes, i fixed it and it is now
fixed in our repos. It is as simple as self.icon_object_set(icon).  It
seems when Jeff originally wrote the code on whatever version
of python-efl/efl he was using then self.icon_object_set(icon) did not work
his self.icon_object_set(icon.object_get()) was a hack that worked  then
and works now so long as the icons are actual icons and not edje objects
from the elementary theme.

@Kai and dave:

"We can fix that by adding an import in that binding method so that it no
longer errors out. Though as raster explained, the Edje object still can't
be used as a window icon as such, so you'd get
another error further down the line."

Think of it from a python programmers point of view

if a is any python object then i should be able to do:

a
print a
type(a)

and so on

for icon.object this is only true depending on elementary settings not only
that it is completely undocumented in the python-efl docs.

BUT daves suggestion to add

from efl import edje

then

print a returns as it
should: <Edje(file=u'/usr/share/elementary/themes/default.edj',
group=u'elm/icon/preferences-system/default', geometry=(0, 0, 0, 0),
color=(255, 255, 255, 255), layer=0, clip=False, visible=True)>
type(a) returns as it should: <type 'efl.edje.Edje'>

 and contrary to Kai's thoughts:

self.icon_object_set(icon.object_get()) works as I think it should. .it is
unneeded as self.icon_object_set(icon) works.

self.icon_object_set(icon.object_get())  SHOULD WORK by application of the
python principle of DUCK TYPING. Python is not C and python-efl should at
least try to follow what python programmers are going to expect of any well
behaved python library. I don't know the code base well enough to comment
on why it works but KUDDOS to whatever duck typing (conversion to an image)
is going on underneath the hood so to speak.

SO I think python-efl needs fixed somehow so that
self.icon_object_set(icon.object_get()) works without the edje import. OR
at the very least this documented somewhere in the py-efl docs.




On Fri, Jun 16, 2017 at 12:47 AM, Carsten Haitzler <[email protected]>
wrote:

> On Thu, 15 Jun 2017 23:05:22 -0500 Jeff Hoogland <[email protected]>
> said:
>
> > Since upgrading from EFL 1.18 to 1.19 I am having some users report
> > <http://forums.bodhilinux.com/index.php?/topic/14430-swami-
> control-activation/
> > > that
> > one of our py-efl applications is crashing at startup for them. The error
> > is:
> >
> > Traceback (most recent call last):
> >   File "/usr/bin/swami", line 177, in <module>
> >     app = MainWin(launchArg)
> >   File "/usr/bin/swami", line 46, in __init__
> >     self.icon_object_set(icon.object_get())
> >   File "efl/elementary/image.pxi", line 469, in
> > efl.elementary.__init__.Image.object_get (efl/elementary/__init__.c:
> 174473)
> >   File "efl/eo/efl.eo.pyx", line 137, in efl.eo.object_from_instance
> > (efl/eo/efl.eo.c:2170)
> > ValueError: Eo object at 0x40000002662348f1 of type Edje.Object does not
> > have a mapping!
>
> this would be in the bindings themselves. efl doesnt have any error like
> the
> above. 0x40000002662348f1 definitely looks like an eoid (not a ptr). i
> haven't
> looked into the bindings themselves to see what it's doing there but i
> smell an
> invalid eo id maybe?
>
> icon = Icon(self, size_hint_weight = EXPAND_BOTH, size_hint_align =
> FILL_BOTH)
> icon.standard_set('preferences-system')
> icon.show()
> self.icon_object_set(icon.object_get())
>
> seems like the relevant bit of python with the last line complaining... i
> can
> only assume that self.icon_object_set() on the window (which is self) maps
> to:
> elm_win_icon_object_set(self, ...)
>
> you'd getting the internal icon object. the preferences-system would
> probably
> end up being sourced from theme thus it'd be an edje object, NOT an evas
> image
> object, and the window wants an evas image object. not an edje object. elm
> icon. elm image. a raw evas image object. so it's probably complaining
> there
> because that system has a different theme config and is using theme
> provided
> icons, not xdg icons which then happen to be image objects in the icon
> widget.
>
> this of course points out the danger of exposing internals like you are now
> using with icon.object_get(). you are getting the internal object the icon
> widget uses and that means you need to know what it is and how it can
> change.
> we just should not expose stuff like this so you can't shoot yourself in
> the
> foot.
>
> the window needs a raw evas image object because it has to be able to get
> the
> argb pixel data so it can set it as an x11 property with argb data in it.
> an
> edje object is not "argb data". it's a live set of objects that is not
> static
> that adapts to sizing changes and can animate... elm icon widgets are the
> same.
> they may map to a simple image object.. maybe an edje object. maybe
> something
> else (an evas vg object... ?). the point is for this to be hidden from
> you...
> until we expose the ability to peek behind the curtain and you rely on that
> peeking... :)
>
> so create a raw evas image object. find the raw image file path to use for
> the
> icon then set that object as the icon.
>
> also don't show the icon. no need. it's not needed. :)
>
> > Source code for the tool is here <https://github.com/JeffHoogland/swami>.
> I
> > am not seeing this error message on every computer I have with EFL 1.19
> > though. In fact it launches as expected on the computer I am typing this
> > from.
> >
> > Any suggestions?
> >
> > --
> > ~Jeff Hoogland <http://jeffhoogland.com/>
> > My Projects on GitHub <https://github.com/JeffHoogland>
> > ------------------------------------------------------------
> ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > _______________________________________________
> > enlightenment-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> >
>
>
> --
> ------------- Codito, ergo sum - "I code, therefore I am" --------------
> The Rasterman (Carsten Haitzler)    [email protected]
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to