EG running python 3.5

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
User avatar
kgschlosser
Site Admin
Posts: 4202
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

EG running python 3.5

Post by kgschlosser » Tue Sep 04, 2018 7:57 am

OK so i have been messing around with this on and off for a while now. I think I am pretty close to being done.

I know that everyone thinks that an upgrade like this is going to mess everyone up... well guess again 8) been something I have been working on over the past 2 years or so, on and off.

This is what I have done.
I have written a series of monkey patches and wrappers. This code does all of the behind the scenes conversions for wxPython and the builtin functions. module redirects. for the most part python 2 and python 3 to the user function the same. There are some things I do not think I will be able to handle properly. The biggest one being how python 3 handles unicode. So they say there is no more "unicode" But it is a lie. it got merged with byte arrays is what happened. unicode strings still exist but instead of putting a "u" before the string now you put a "b". so it is said converting a "byte array" (unicode) to a string is easier.. b'some unicode string'.encode('utf-8') vrs str(u'some unicode string'), i guess you can call it semantics. you say potato, i say potahto. damned thing is still a mystery to me and i can't ever seem to get it right. But anywho.

I also wrote a very simple code converter that upon plugin load it will read the file fix most things that do not agree with python 3. Now I do not know if i covered all of my bases with this. I tried the 2to3 converter thing and that was a colossal FAILURE. I am sure there are things that I missed and I will have to add. My point is that I am trying to make this change as painless as possible for the plugin developers.

with a tad over a year remaining until Python 2.x is EOL we should probably start making these changes now. I know that for the most part the plugins I have written are python 3 compatible (except for print statements). The code I have written to help ease this transition is meant to be used temporarily until we can get the 2+ million lines of code between the plugins and core manually converted. and don't you worry script kiddies. I also added the automatic bits so it will parse scripts as well.

I am going to try and build EG tomorrow. I am sure it is going fail but the number of issues should be very minimal. I will post a link to it once i get a full running version. and anyone that is willing to endure some problems and report them back to me is more then welcome to do so.

I hope I will have to running soon..
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4202
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: EG running python 3.5

Post by kgschlosser » Sat Sep 15, 2018 3:32 pm

I wanted to give an update.

I am partially there. I still have quite a bit of work. But i did manage to get the GUI to show. EventGhost is not functional but it is a good start.

I had to rewrite the whole builder.
I also had to update all of the C/CPP code for the dlls that EG uses. I also built into this builder the compilation of those DLL's
I had to write a mechanism that actually works properly for setting up a Visual C build environment. It also updates the solution files for the dll's

I still have to work out building of the documentation.
I need to get EventGhost functional.


Here is what is dome so far in case anyone wanted to have a look see

https://github.com/kdschlosser/EventGhost-x64-Python3.5
If you like the work I have been doing then feel free to Image

jachin99
Experienced User
Posts: 529
Joined: Sat Feb 13, 2016 8:39 pm

Re: EG running python 3.5

Post by jachin99 » Sun Sep 16, 2018 2:46 am

This looks like it will be a really good thing. Keeping your software within the limits of its support life cycle never hurts, and anyone using EventGhost for serious work (Where compliance might come into play) is going to be looking for applications that are still being supported. I know its a moving target, and python 3 gets updated regularly but you are still taking a lot of work out of it for others to build upon.

User avatar
kgschlosser
Site Admin
Posts: 4202
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: EG running python 3.5

Post by kgschlosser » Mon Sep 17, 2018 6:24 am

WAHOOOOOOOOOOOOOOOO



Ladies and gents...

a picture speaks 1000 words
eg 3.5 x64.png
It still has some glitches I need to iron out. End result is EG x64 running on Python 3.5 does indeed work!!

I have created a massive amount of wrappers to make this thing run without the need to convert all of the code. there are some things that will still need to be done manually. but those are limited. I need to write code to backup all of the plugins / config files on a users PC before installing this. I am also going to change the install path and the appmutex keys as well as the program guid's and named pipe name. this way older versions will not get uninstalled. I am going to build in something that will detect of another version of EG is running and not allow it to start/have it shutdown if an older version is detected.
If you like the work I have been doing then feel free to Image

Post Reply