Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex

Notices

Reply
 
Thread Tools Search this Thread
Old 03-16-2010, 05:35 PM   #1
Mr. X
Connoisseur
Mr. X is on a distinguished road
 
Posts: 68
Karma: 64
Join Date: Mar 2010
Location: Philadelphia
Device: iRex DR800SG
Python + pyGTK package for the DR v3.0

For those that want to try their hand at writing/porting simple apps for the DR but don't want to mess with the whole SDK, or just those that like Python, I've built a package that contains python 2.6.4 and pygtk linked against the iRex libraries. This means you get the optimized screen redraws and such for free.

Screenshot below is the 'editable cell' demo right out of the pygtk install, showing the stylus selecting a field and the keyboard popping up.

To install, grab the tarball at https://dsl-scm.cis.upenn.edu:8888/s...+gtk-DR800.tbz and decompress it at the root of your sd card. Because it's just the support framework for writing other GUI apps, nothing runnable will show up automatically in the browser(so this really is for developers only right now).

But that's no fun, so once you've installed Python put the two files in Mines.zip in Personal Documents or wherever you like and enjoy a game of minesweeper (from http://sites.google.com/site/victorhr02/pymassrotate2).
Attached Thumbnails
Click image for larger version

Name:	pyGTK.png
Views:	730
Size:	47.7 KB
ID:	48198  
Attached Files
File Type: zip Mines.zip (7.7 KB, 496 views)
Mr. X is offline   Reply With Quote
Old 03-19-2010, 09:20 AM   #2
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
Quote:
Originally Posted by Mr. X View Post
For those that want to try their hand at writing/porting simple apps for the DR but don't want to mess with the whole SDK, or just those that like Python, I've built a package that contains python 2.6.4 and pygtk linked against the iRex libraries. This means you get the optimized screen redraws and such for free.

Screenshot below is the 'editable cell' demo right out of the pygtk install, showing the stylus selecting a field and the keyboard popping up.

To install, grab the tarball at https://dsl-scm.cis.upenn.edu:8888/s...+gtk-DR800.tbz and decompress it at the root of your sd card. Because it's just the support framework for writing other GUI apps, nothing runnable will show up automatically in the browser(so this really is for developers only right now).

But that's no fun, so once you've installed Python put the two files in Mines.zip in Personal Documents or wherever you like and enjoy a game of minesweeper (from http://sites.google.com/site/victorhr02/pymassrotate2).
Uhmm... and the speed?
I like python a lot, but on the Iliad I was forced to use lua because python was very slow.
(Damn, I can't test it here at work!)
Iņigo is offline   Reply With Quote
Old 03-19-2010, 09:53 AM   #3
Mr. X
Connoisseur
Mr. X is on a distinguished road
 
Posts: 68
Karma: 64
Join Date: Mar 2010
Location: Philadelphia
Device: iRex DR800SG
I haven't tried anything too complicated in python yet, but for the stuff I have the eink refresh seemed to be the bottleneck more than python... I expect the limited RAM is going to be a much bigger issue than raw execution speed for porting stuff since it's easy to import a whole huge library just for one function when you don't care about memory usage
Mr. X is offline   Reply With Quote
Old 03-19-2010, 03:18 PM   #4
badbob001
Fanatic
badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.badbob001 ought to be getting tired of karma fortunes by now.
 
badbob001's Avatar
 
Posts: 556
Karma: 1102020
Join Date: Sep 2009
Device: Kindle Keyboard (rip), Kindle Voyage, Fire Tablet 10 '17, iPad '19
Quote:
Originally Posted by Mr. X View Post
I haven't tried anything too complicated in python yet, but for the stuff I have the eink refresh seemed to be the bottleneck more than python... I expect the limited RAM is going to be a much bigger issue than raw execution speed for porting stuff since it's easy to import a whole huge library just for one function when you don't care about memory usage
How much free ram is normally available? Just curious how much the OS is taking up and leaving for viewers and applications.
badbob001 is offline   Reply With Quote
Old 03-24-2010, 11:36 AM   #5
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
Quote:
Originally Posted by Mr. X View Post
For those that want to try their hand at writing/porting simple apps for the DR but don't want to mess with the whole SDK, or just those that like Python, I've built a package that contains python 2.6.4 and pygtk linked against the iRex libraries. This means you get the optimized screen redraws and such for free.

Screenshot below is the 'editable cell' demo right out of the pygtk install, showing the stylus selecting a field and the keyboard popping up.

To install, grab the tarball at https://dsl-scm.cis.upenn.edu:8888/s...+gtk-DR800.tbz and decompress it at the root of your sd card. Because it's just the support framework for writing other GUI apps, nothing runnable will show up automatically in the browser(so this really is for developers only right now).

But that's no fun, so once you've installed Python put the two files in Mines.zip in Personal Documents or wherever you like and enjoy a game of minesweeper (from http://sites.google.com/site/victorhr02/pymassrotate2).
I've tested and it works well.

Some suggestions:
- add dbus bindings
- strip libraries and executables
- don't include .pyo files
- don't include documentation

Thanks for the package
Iņigo is offline   Reply With Quote
Old 03-24-2010, 11:54 AM   #6
Mr. X
Connoisseur
Mr. X is on a distinguished road
 
Posts: 68
Karma: 64
Join Date: Mar 2010
Location: Philadelphia
Device: iRex DR800SG
Quote:
Originally Posted by Iņigo View Post
I've tested and it works well.

Some suggestions:
- add dbus bindings
- strip libraries and executables
- don't include .pyo files
- don't include documentation

Thanks for the package
ah, dbus would definitely be good to include in a default package.

I should probably make a dev and non-dev version of the tarball, one for people building apps with it and the other for most users to just install and get the run-time bits. I was a bit lazy for this first release since I just wanted to share it and not burn any more time on it at the moment...
Mr. X is offline   Reply With Quote
Old 03-25-2010, 04:46 AM   #7
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
Quote:
Originally Posted by Mr. X View Post
ah, dbus would definitely be good to include in a default package.

I should probably make a dev and non-dev version of the tarball, one for people building apps with it and the other for most users to just install and get the run-time bits. I was a bit lazy for this first release since I just wanted to share it and not burn any more time on it at the moment...
Sorry, but can't understand the purpose of a dev package for the device, maybe for the emulator. .pyo, tests and docs waste a lot of space, more than 50 MB.
Iņigo is offline   Reply With Quote
Old 05-19-2010, 04:56 PM   #8
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
Hi,

find attached another python package for the DR800.
In fact it's the same Mr. X published in this thread, but without documentation, tests, and other stuff not needed for a runtime package. Binaries and libraries have been stripped as well. Finally I decided to mantain the .pyo files... 10 MB vs. a bit of speed at start time.

As a result, size after installation on the device has reduced from 100MB to 40MB, also the package is half of the original.

I've also added 2 new modules:
- ncurses
- hashlib

There is also a Eastern Egg, run /media/mmcblk0p1/Programs/_python26/bin/lfm from a terminal in emulator or using usbnet.
It doesn't work completely (f.e. pyview doesn't start at all), but is somehow useful when developing or porting stuff.
Attached Files
File Type: gz python26-dr800-v1.tar.gz (10.84 MB, 431 views)
Iņigo is offline   Reply With Quote
Old 01-19-2012, 06:05 AM   #9
Mackx
Guru
Mackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to behold
 
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
I wanted to get some more hands on experience with Python so I decided to continue where Iņigo and Mr.X stopped. What was missing is a way to control the local-libraries so that the application is added to the taskbar, menus can be added and toolbar icons can be added.
Iņigo did add this functionality in vala (which he uses to write his current additions to the DR) so I used that as a basis for Python. Since I also wanted to get some experience with the ctypes-module, I used that module to access the DR-libraries need for taskbar, menus, etc.

I uses a simple application as a 'vehicle' to use the new functionality. The application currently allows to show csv-files (comma separated values) in a spreadsheet-like UI. I intend to add more functionality when I find time.
I also modified the mines game that was part of the original port to use the new functionality (it now has a menu and appears in the taskbar).

This is only a first experiment, I did not solve all refresh issues and certainly did not test all functionality that is available in Python and its modules. I also do not understand the garbage-collection of Python that well, so there might be some memory leaks.

I created 3 new modules: eripc.py, erapp.py and erutils.py, they are located in _python26\lib\python2.6\site-packages. The applications are in _python26\apps. Note that to get the apps shown in the taskbar they had to be named 'python' else the firmware would not accept them. I added some desktop-files in Programs, so they can be started with the stylus.

Like vala this creates an easy platform for creating applications for the DR. I hope this will inspire more people to create DR applications.

What should be added/changed so that more people can use python (or vala)?
What kind of new application are people waiting/hoping for on the DR?
Attached Files
File Type: zip python26-dr-v2.tar.zip (11.86 MB, 375 views)
Mackx is offline   Reply With Quote
Old 01-20-2012, 06:08 AM   #10
Mackx
Guru
Mackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to behold
 
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
I modified some files so that the application can also be executed on a desktop PC (note I only tried under Windows). I am using Python2.7 (although on the DR 2.6 is used) and have installed pyGtk (got the instructions from internet).

For the DR, extract the upgrade zip-file on your SD card, it will overwrite the updated files (so first install the v2 release if you did not do that yet).

For your PC, extract the py files from the v3-zip file (about 7 files) and put them in a single directory. Use IDLE or your own favourite python tool to start the application.

Update: I made mistake in the mines.py, which is solved in the 3a version.
Attached Files
File Type: zip python26-dr-v3a-upgrade.zip (36.0 KB, 378 views)

Last edited by Mackx; 01-20-2012 at 06:27 AM. Reason: Mistake in mines.py
Mackx is offline   Reply With Quote
Old 01-20-2012, 11:28 AM   #11
fekhner
Addict
fekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animals
 
Posts: 326
Karma: 6908
Join Date: Sep 2010
Device: DRs, EE, ipad/iphone, Helix
Quote:
Originally Posted by Mackx View Post
What kind of new application are people waiting/hoping for on the DR?
Great, I will try the new python as soon as possible. As I said in another thread, an offline wikipedia, wiktionary viewer would be great (especially with the current blackout , it is one of the few things that some other readers have, even the iliad I believe, and that does not seem to be working on the DR. Btw, in the original implementation by Mr. X, python seems to have been a crucial ingredient ...

Apart from that, I do not see a lot. You can browse the pocketbook or the Boox forum, and I think that the DR's are still more than competitive in terms of applications that have been ported. For instance they would all like to have very much your Xournal port I believe.

A secret dream is still to get wireless working by using one of these wireless SD cards (I even saw the first micro cards somewhere).
fekhner is offline   Reply With Quote
Old 01-21-2012, 09:43 AM   #12
Mackx
Guru
Mackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to behold
 
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
Quote:
Originally Posted by fekhner View Post
As I said in another thread, an offline wikipedia, wiktionary viewer would be great (especially with the current blackout , it is one of the few things that some other readers have, even the iliad I believe, and that does not seem to be working on the DR. Btw, in the original implementation by Mr. X, python seems to have been a crucial ingredient ....
Yes I saw that thread, the programs you mention there all need Qt, I did not yet dare to start porting Qt...
Mackx is offline   Reply With Quote
Old 01-21-2012, 12:10 PM   #13
fekhner
Addict
fekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animals
 
Posts: 326
Karma: 6908
Join Date: Sep 2010
Device: DRs, EE, ipad/iphone, Helix
except for the original try by Mr X,
https://www.mobileread.com/forums/showthread.php?t=77453
which besides python contained ports of django, perl, php and xapian; at some stage I tried to make it work by just replacing the erbrowser with midori; I managed to get the server running on the DR, but somehow I could not generate usable datafiles... did you try that one ?
it seemed to be close to a small version that was working on the iliad
https://www.mobileread.com/forums/sho...ight=wikipedia

Last edited by fekhner; 01-21-2012 at 02:12 PM.
fekhner is offline   Reply With Quote
Old 01-21-2012, 03:41 PM   #14
fekhner
Addict
fekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animalsfekhner is kind to children and small, furry animals
 
Posts: 326
Karma: 6908
Join Date: Sep 2010
Device: DRs, EE, ipad/iphone, Helix
back to the original purpose of the thread, sorry for being obsessed with the offline wikipedia stuff ...

your new implementation of python works beautifully on my DR1000, thanks !

If I understand correctly, the spreadsheet application allows to see previously inaccessible cvs files, great, so you have added a new file-type to the DR, will try to open some, but for the moment I have none which would be directly useful ...

will try to see on the other forums which other python applications would be useful on the DR and have updated the wikipage accordingly.

Last edited by fekhner; 01-21-2012 at 06:30 PM.
fekhner is offline   Reply With Quote
Old 01-21-2012, 03:54 PM   #15
Mackx
Guru
Mackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to behold
 
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
Quote:
Originally Posted by fekhner View Post
If I understand correctly, the spreadsheet application allows to see previously inaccessible cvs file, great, so you have added a new file-type to the DR, will try to open some, but for the moment I have none which would be directly useful ...
You have to start the application and then use the Load-menu to open a cvs-file. I will see if I can change the application and create a schema-file to link cvs-extensions to the application.
Mackx is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Python 2.6 for iLiad ericshliao iRex 14 01-28-2009 01:08 AM
Python 2.5 or 2.6? itimpi Calibre 5 01-19-2009 12:48 PM
Mac and Python hackettt Sony Reader 5 11-17-2008 10:39 AM
python coding... alexxxm Sony Reader 8 01-31-2008 12:25 PM
iLiad pyGTK rudysplif iRex Developer's Corner 2 12-23-2007 06:29 AM


All times are GMT -4. The time now is 07:40 AM.


MobileRead.com is a privately owned, operated and funded community.