Updated inkface

1 view
Skip to first unread message

ekondrashev

unread,
Sep 27, 2009, 5:32:18 AM9/27/09
to inkface
I've spent some time playing with inkface and want to post results of
my work.
http://groups.google.com/group/inkface/web/inkface2_ek.tar
Code was updated according to my needs, perhaps you don't wanna these
updates, let me know if you don't. Otherwise i'll continue posting
results
So, changes:
-occupies method was changed
-added occupies.py to handle occupies call for different shapes
-Only path and rect tag are implemented for now. Logic was ported from
Point2D.Float java class.

What should be done:
- change cloud mechanizm to use new uccupy.py
- implement other shapes
- finish unimplemented path commands
and
-clean up the code as it is quite dirty for now. This is intermediate
result to view and discuss.

The aim of these changes is to get inkface behave like Batik svg
toolkit in sense of event system. So now if i have a map with
buildings and roads of unexpected shapes(but, described as path
elements) i can highlight an object by a click.

I've left some comments at code where, in my oponion, some refactor
work should be done.

Finally, please, feel free for an advice and comments.
http://inkface.googlegroups.com/web/inkface2_ek.tar?gda=DIyCjUEAAADlHzMs9hT8K2xGs3IBpAoTBnJPz-4slCKlU7xKw8Xa1p28PTy_O7eFPKfXqQGcV0hTCT_pCLcFTwcI3Sro5jAzlXFeCn-cdYleF-vtiGpWAA&gsc=TcXy6QsAAAAK5EEZfAszY8avi49dVxyB

checkitout(from test dir):
python basic.py ./..data/examplePathCubic.svg
python basic.py ./..data/examplePathLine.svg
python basic.py ./..data/examplePathQuad.svg

Keep it real!

Jayesh Salvi

unread,
Sep 27, 2009, 11:34:47 AM9/27/09
to ink...@googlegroups.com
Hi Eugen,

Glad to see someone trying to improve inkface.

I untarred your bundle and tried to run it. Which math module am I missing?

$ PYTHONPATH=.. python basic.py ../tests/data/examplePathCubic.svg
Traceback (most recent call last):
  File "basic.py", line 4, in <module>
    from inkface.pygame import PygameFace, PygameCanvas
  File "/home/jayesh/Download/inkface2_ekondrashev/inkface2/inkface/pygame/__init__.py", line 13, in <module>
    from inkface.canvas import Face, Canvas, CanvasElement
  File "/home/jayesh/Download/inkface2_ekondrashev/inkface2/inkface/canvas.py", line 11, in <module>
    from inkface.altsvg.occupy import NODE_OCCUPY_MAP
  File "/home/jayesh/Download/inkface2_ekondrashev/inkface2/inkface/altsvg/occupy.py", line 10, in <module>
    from math import isnan
ImportError: cannot import name isnan

If you would like to get your code in the inkface project, please provide it in the form of a patch (against top of tree), explain in brief what you are trying to achieve with it and after review I will be glad to accept it.

Thanks,
Jayesh

ekondrashev

unread,
Sep 29, 2009, 4:04:49 AM9/29/09
to inkface
Correct me if a wrong, but it's a default python package.
http://docs.python.org/library/math.html#math.isnan
Ok, I'll provide a patch as soon as possible.
> >http://inkface.googlegroups.com/web/inkface2_ek.tar?gda=DIyCjUEAAADlH...

Thomas Perl

unread,
Sep 29, 2009, 4:34:45 AM9/29/09
to ink...@googlegroups.com
2009/9/29 ekondrashev <kondrash...@gmail.com>:

> Correct me if a wrong, but it's a default python package.
> http://docs.python.org/library/math.html#math.isnan
> Ok, I'll provide a patch as soon as possible.

Yeah, "New in version 2.6." I believe Jayesh wants to have
everything Python 2.5-compatible, as this is what runs on
the tablets. Googling around reveals the following:

http://stackoverflow.com/questions/944700/how-to-check-for-nan-in-python

def isNaN(num):
return num != num

You should be able to use this function as a replacement
for math.isnan() when it's not available (e.g. on Python 2.5).

HTH.

Thomas

ekondrashev

unread,
Sep 30, 2009, 3:46:36 AM9/30/09
to inkface
Ok, but perhaps it is worth to think about keeping separate branches
for different python versions?
Say:
-Inkface_2.5
-Inkface_2.6
Just aloud thoughts.

On 29 сен, 11:34, Thomas Perl <th.p...@gmail.com> wrote:
> 2009/9/29 ekondrashev <kondrashev.eu...@gmail.com>:

Jayesh Salvi

unread,
Sep 30, 2009, 4:28:42 AM9/30/09
to ink...@googlegroups.com


2009/9/30 ekondrashev <kondrash...@gmail.com>


Ok, but perhaps it is worth to think about keeping separate branches
for different python versions?
Say:
-Inkface_2.5
-Inkface_2.6
Just aloud thoughts.

If it's just a matter of one simple function, then you can include it in your code (as Thomas said earlier), instead of creating a dependency on python version.
 
Reply all
Reply to author
Forward
0 new messages