Page 1 of 1

Python Libraries

Posted: Fri Mar 30, 2018 4:48 pm
by kgschlosser
NEW PLUGIN!!!

This has been something a lot of you folks have wanted.. This is something that i have been working on for 2 years. And i finally got it to work!!!!!

THIS PLUGIN ALLOWS YOU TO INSTALL PYTHON LIBRARIES

WhooRaaa!!!!!

It is glitchy at the moment. specifically the install dialog. I am working on it so be patent. I am thinking i am going to deep six the whole install dialog in favor of a simple text control. If you want you can simply call the plugin directly

eg.plugins.PythonLibraries.Install('SomeLibrary')

if you want a specific version

eg.plugins.PythonLibraries.Install(u'SomeLibrary==0.1.1')

This is not guaranteed to work with all libraries. There are some things i need to pan out specifically with a library building c modules.
If a specific library does not work you can post the output from the install and i will see what i can do. but don't be all upset when i say sorry. it's not going to work.

***UPDATE***
So I used a little ingenuity and came up with a way to get the listing of the libraries to work properly.

I changed some of the folder structure. so if you installed any libraries you will have to update the plugin and reinstall the libraries and then go into you programdata/eventghost folder and delete anything ending in ".egg" and ".pth" also "site.py" and "site.pyc"


Just in case you have an issue.
there is a new folder in your programdata/eventghost folder called "site-packages'" this is where all libraries downloaded using this plugin are stored. if you run into an issue with one for some reason and can't seem to get it removed then go into this folder, locate the library folder ending in .egg delete it. then edit the easy-install.pth file with a text editor and delete the line pointing to that folder you deleted.

fixed an issue with libraries not being available when EG starts.
fixed the displaying of images embedded in the description of the libraries.
fixed the displaying of some of the text in the description of a library.
reworked the autocomplete to run faster and also have better handling of a user selecting and deleting, backspacing or adding text to the control

TODO:
Add a better update display
Remove all actions and add dropdown menu items instead.

Re: Python Libraries

Posted: Fri Mar 30, 2018 5:41 pm
by jachin99
Very Nice 8)

Re: Python Libraries

Posted: Sat Mar 31, 2018 6:36 am
by Snowbird
Kevin, you are never gonna believe me :) yesterday I was playing around with the SNMP protocol and thought too bad we don't have an snmp lib in EG... and today I discover your lib plugin !!!! :) This is Faaaaaaaaaan - Tassssss - Tiiiiiic !!

ok, enough compliments :p

I just tried it, and the first thing that needs to be improved is the loading of the lib list :) it takes too long even if we are informed that it's going to take a while, plus EG freezes during this process. I got hard time to find and select the snmp lib, it looks like the list keeps updating while searching for a lib, that's annoying. Question : while typing a lib name, do we need to take in consideration the capitals and lowercases ? I wasn't able to check this myself because EG freezes while searching...

Re: Python Libraries

Posted: Sat Mar 31, 2018 8:49 pm
by kgschlosser
OK so i will repeat myself here.
kgschlosser wrote: Fri Mar 30, 2018 4:48 pm It is glitchy at the moment. specifically the install dialog. I am working on it so be patent. I am thinking i am going to deep six the whole install dialog in favor of a simple text control. If you want you can simply call the plugin directly

eg.plugins.PythonLibraries.Install('SomeLibrary')

if you want a specific version

eg.plugins.PythonLibraries.Install(u'SomeLibrary==0.1.1')

I wanted to get this ability to you guys as soon an possible. And the mechanisms to grab the libraries are very complex. and I have been working on the issues. I am very close to having it all sorted out. This is all happening because there are 133974 libraries that are listed on pypi. and because of how pypi is set up i can obtain a list of the library names and url's then i have to go to each url and grab data from there to find out if it is compatible. This is a HUGE process. I had to change the control i was using from a combo box to a virtual list control because it was going all special ed on me because of the number of library names. (this is the reason for the current version locking up). I have tried setting up something that will parse the information but it is simply to much. so what I am going to do for the time being is I am going to display the library data when it is selected. if it is not compatible i will have it add to the top of the information NOT COMPATIBLE. This i feel is going to be the easiest resolution.

I also still have to add some version checking on the upgrade. so if there is not an upgrade available it will not add it to the list of libraries you can select from.

I may do another list control that will show the current installed version and a dropdown to select the version that you want to install.

Re: Python Libraries

Posted: Sun Apr 01, 2018 7:50 am
by Snowbird
You don't need to repeat yourself, I have already understood what you said the first time, I know it's WIP and we shouldn't expect too much for now. I was just reporting back what you already knew and confirming it. ;)

Now that I know why it's taking so long (more than 133974 libraries to list....), maybe you should do this in another way ? Because it's gonna take a while no matter how you address it, maybe it's better to build the library process (downloading, parsing, filtering, etc.) and insert it in the plugin itself as a separate file, so we (the users) don't need to do all this tedious task on our end. This way it will be usable right away, no need to download or process anything. I know you won't like the idea because of the update part, and I join you on that, well maybe you can do a cron task on the server where the EG website is hosted, and let the server do the hard work, once a day or once a week (depending on what's the more relevant thing to do). This way the user can update the libs just by downloading the latest file that is available on EG server, either manually by clicking on update, or by an EG action that could be scheduled. If you're short on bandwidth, once the file is generated you can place it on a free storage online, this way the users won't use EG's web server bandwidth.

That was just my thought on this, obviously I don't have your knowledge, and I probably don't know what I'm talking about because there are many other aspects that I ignore or didn't understand :) All I know for sure is that this plugin is a HUGE leap forward in EG history !! :) good job !!

Re: Python Libraries

Posted: Sun Apr 01, 2018 8:54 am
by kgschlosser
Your input and ideas are always invaluable. Even if the idea may not necessarily work it may point me in a different direction that leads to a solution. So i do greatly appreciate that.

The issue is in Windows. it's native controls really suck, especially when it comes it handling large amounts of data. End up writing something custom to handle it. As i did in a little thing i call the Float Slider Control. As i am sure you know what a slider control is. But in the control if you set it to show what are called tick marks (position indicators) and you give the control a min of say 0 and a max of 10000 and you tell it to draw a tick mark for each digit. The control goes completely bonkers if it even draws at all, or it could take a very long time to draw. My control does this exact scenario without batting an eyelash at it.


But a new version is posted with the listing of the libraries fixed.

Re: Python Libraries

Posted: Sun Apr 01, 2018 9:01 am
by kgschlosser
Snowbird wrote: Sat Mar 31, 2018 6:36 am Question : while typing a lib name, do we need to take in consideration the capitals and lowercases ?
Yes the autocomplete function is case sensitive.

Re: Python Libraries

Posted: Wed Apr 04, 2018 3:38 am
by kgschlosser
OK so this plugin is not functioning properly unless you have python installed. which is not something that is all that complicated to do. I will build into the plugin a means to download and install it. I forgot that EG grabs things from a python installation.