01-23-2012, 11:32 PM | #16 |
Guru
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 Mackx,
I quick note as I will comment deeper in another message. In the apps "python" launchers in version 3a you write "import appcalc.py". That's not correct python, it should be "import appcalc", without the extension. You use the syntax "import module.submodule" to import some submodules from a big package, as in "import books.epub", where you have a module books with different submodules: Code:
python26/ lib/ site-packages/ books/ __init.py__ epub.py pdf.py ... Last edited by Iņigo; 01-23-2012 at 11:35 PM. |
01-24-2012, 12:00 AM | #17 |
Guru
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
Quick comment #2: can't load liberutils
Code:
root@qemuarm:/media/mmcblk0p1/Programs# ./_python26/bin/python Python 2.6.4 (r264:75706, Mar 16 2010, 14:39:27) [GCC 4.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes as C >>> erutils = C.cdll.LoadLibrary( 'liberutils.so.0' ) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/media/mmcblk0p1/Programs/_python26/lib/python2.6/ctypes/__init__.py", line 431, in LoadLibrary return self._dlltype(name) File "/media/mmcblk0p1/Programs/_python26/lib/python2.6/ctypes/__init__.py", line 353, in __init__ self._handle = _dlopen(self._name, mode) OSError: /usr/lib/liberutils.so.0: undefined symbol: g_free |
Advert | |
|
01-24-2012, 03:04 PM | #18 |
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
Oops, yes, I totally missed that, I am so used to C ... I will fix it in the next version. Maybe I will also use the module.submodule construction for the er-modules.
|
01-24-2012, 03:31 PM | #19 | |
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
Quote:
I added: lib@PACKAGE_NAME@_la_LIBADD = $(DEPS_LIBS) to the makefile of liberutils, see also bitbucket (I just pushed) Thanks for reporting both comments (bugs ! |
|
01-24-2012, 04:01 PM | #20 |
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
I created an installation package for the patched system-file. This is an update,
1) so first copy python26-dr-v2.tar.zip and 2) then the attached file (python26-dr-v4-upgrade.zip). After re-inserting the SD card you will see 'Install Python Patch' in SD-Card/Programs/Install. 3) Click on the icon (note that this only needs to be done once!). The file will be copied and the DR will reset so the new library will be used (might cause strange artifacts on the screen). Note that the package is still in alpha state, the screen refreshes on the DR are really bad I need to find some good moments to refresh the screen. So the Calc-program is not really usable yet. Iņigo: thanks again for the feedback. |
Advert | |
|
01-25-2012, 04:40 AM | #21 |
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
Sorry sorry sorry, I keep on messing things up. The install script from the previous zip file does not work correctly. This is an update, see the installation instructions in the previous message use the v5 instead of the v4.
Refreshes are a little better, but not good yet. |
01-26-2012, 08:55 AM | #22 |
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
I have solved the refresh problem, but had to rewrite a lot of the drawing code. I now use a pixmap that is copied to the DrawingArea using draw_drawable. This should show others how to use python and get proper refreshes of the screen (might also work for vala).
The calc program is now very basic, you can open a file which will be shown and you can scroll the content using the widgets in top of the screen or, on the DR1000, the buttons at the side of the DR. There are a lot of limitations, columns have a fixed width, font is fixed, no formulas, alignment is fixed to the left, etc etc etc. For installation see message #20. If you already did the actions described there, you only have to copy the new content attached to this message to your SD card. |
03-19-2012, 05:49 AM | #23 |
Guru
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
|
I updated the calc application a little bit so that it is more usefull:
- Cells can be edited - Files can be stored - Simple formulas can be used - Copying/Pasting cells is possible Examples of formulas are (enter the text below without the quotes): '=[-2,0]-[-2,-1]' : use relative position for cell '=[A1] + 10' : absolute cell '=100/[-1,0]' : +, -, / and * are supported, as are brackets '()' Note that I still consider it more like a demonstrator then as an application. There is still a lot that can be improved on the usability of the application. For installation see message #20. If you already did the actions described there, you only have to copy the new content attached to this message to your SD card. However, to link the .csv-extension to Calc, you need to (re-)run Programs/Install/Install Python Patch, even if you did this before. |
|
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 |