Python-elementary on Pandora


arcol

Still Fresh
Joined
May 2, 2011
Messages
9
Hey,


Im seriously considering buying an openpandora.


My only reason is buying one, is to be able to run my own python-elementary application.


If it can run (if somebody want to test for me I can provide testcode),


I dont mind to spend the premium price for one.


Any confirmation?


Bests,


Laszlo
 
What are its dependencies? Pure-python dependencies should not be a problem, but others might need to be ported.


[edit]Apparently some enlightenment based gui library. Enlightenment ran on the Pandora before and it seems to be in the angstrom repository. I'm guessing that your chances are quite good that it will run.[/edit]
 
Last edited by a moderator:
Hi,


Thank you guys for the quick responses!


For testing simply launch it with 'python gui.py'.


Without the .edj file a black window should appear.


(please recompile the .edj file using the build.sh script)


So the complete testing is like this:


1. tar -xzvf gui.tar.gz


2. cd gui


3. ./build.sh


4. python gui.py


And you should view something like this:


5681121383_60e5b5f496.jpg



I attached the complete 'project' as .tar.gz.


But for quick testing, here is the gui.py file only:



Code:
import elementary

import edje

import evas

import ecore

from ecore.x import ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF, ECORE_X_VIRTUAL_KEYBOARD_STATE_ON





class Gui(object):

    """Elementary gui window"""


    def __init__(self):

        elementary.init()


        win = elementary.Window("arcolev", elementary.ELM_WIN_BASIC)

        win.title_set("arcolev")

        win.callback_destroy_add(self.destroy)


        ly = elementary.Layout(win)

        ly.file_set("gui.edj", "CreateContact")

        win.resize_object_add(ly)

        ly.show()






        self.cells = ["","","","","","",""]


        self._create_entry(win, ly, "0")

        self._create_entry(win, ly, "1")

        self._create_entry(win, ly, "2")

        self._create_entry(win, ly, "3")

        self._create_entry(win, ly, "4")

        self._create_entry(win, ly, "5")

        self._create_entry(win, ly, "6")




        win.resize(800, 480) # for Nokia N900

        #win.resize(480, 640-272) # with illume keyboard

        #win.resize(480, 640-64) # without illume keyboard

        win.show()


        self.win = win




        return



    def _create_entry(self, win, ly, name):

        scroller = elementary.Scroller(win)

        scroller.size_hint_weight_set(1.0, 1.0)

        scroller.size_hint_align_set(-1.0, -1.0)

        scroller.bounce_set(0, 0)

        scroller.show()


        textbox = elementary.Entry(win)

        textbox.single_line_set(True)

        textbox.entry_set("")


        textbox.size_hint_weight_set(1.0, 1.0)

        textbox.size_hint_align_set(-1.0, -1.0)

        textbox.scale_set(1.8)

        textbox.show()


        textbox.on_key_down_add(getattr(self, 'key_down_'+str(name)), ly)

        textbox.on_mouse_down_add(getattr(self, 'mouse_down_'+str(name)), ly)

        scroller.content_set(textbox)

        scroller.show()


        ly.content_set('cell'+name, scroller)

        self.cells[int(name)] = textbox



        return


    def run(self):

        """ launch ourself """

        elementary.run()

        elementary.shutdown()

        return



    def key_down_handler(self, name, entry, event, layout):

        """this method collects all keyboard events. If not, fix the code"""

        #print "yualksdjf", name, entry, event, layout

        if event.key == "Tab":

            if name == "0":

                print "lol", self.cells[1]

                self.cells[1].focus()

            elif name == "1":

                print "lol1"

                self.cells[2].focus()

            elif name == "2":

                print "lol2"

                self.cells[3].focus()

            elif name == "3":

                print "lol3"

                self.cells[4].focus()

            elif name == "4":

                print "lol4"

                self.cells[5].focus()

            elif name == "5":

                print "lol5"

                self.cells[6].focus()

            elif name == "6":

                print "lol6"

                self.cells[0].focus()


        return True


    def mouse_down_handler(self, name, entry, event, layout):

        """this method collects all keyboard events. If not, fix the code"""

        print "yualksdjf", name, entry, event, layout


        return



    def key_down_0(self, *args):

        return self.key_down_handler('0', *args)



    def key_down_1(self, *args):

        return self.key_down_handler('1', *args)



    def key_down_2(self, *args):

        self.key_down_handler('2', *args)

        return


    def key_down_3(self, *args):

        return self.key_down_handler('3', *args)



    def key_down_4(self, *args):

        self.key_down_handler('4', *args)

        return


    def key_down_5(self, *args):

        return self.key_down_handler('5', *args)



    def key_down_6(self, *args):

        return self.key_down_handler('6', *args)



    def mouse_down_0(self, *args):

        self.mouse_down_handler('0', *args)

        return


    def mouse_down_1(self, *args):

        self.mouse_down_handler('1', *args)

        return


    def mouse_down_2(self, *args):

        self.mouse_down_handler('2', *args)

        return


    def mouse_down_3(self, *args):

        self.mouse_down_handler('3', *args)

        return


    def mouse_down_4(self, *args):

        self.mouse_down_handler('4', *args)

        return


    def mouse_down_5(self, *args):

        self.mouse_down_handler('5', *args)

        return


    def mouse_down_6(self, *args):

        self.mouse_down_handler('6', *args)

        return



    def destroy(self, obj):

        print "DEBUG: window destroy callback called!"

        print "DEBUG: obj:"

        print obj

        self._quit()

        return


    def _quit(self):

        elementary.exit()

        return


if __name__ == "__main__":

    gui = Gui()

    gui.run()
 

Attachments

  • gui.tar.gz
    12.8 KB · Views: 98
Last edited by a moderator:
Last edited by a moderator:
As is ...this example do not run..


running with python gui.py in a shell:

ImportError: No module named elementary

next if i try to build the edj file...

./build.sh line 3: edje_cc: not found

Searching on Angstrom repo i found this..http://www.angstrom-...thon-elementary


but i don't know if/and how to install it.

Thank you for checking this. The rev 45002, which is in the angstrom repository is more than 1.5 years old.


The current revision is 59148.


In Enlightenment world it is crazy old. This january (or was it february?) the v1.0 came out of the core libraries after many years development.


So even if that python package would be installable, no modern/recent app could be run on that library.


Im really thankful, you saved me at least 500EUR unnecessary money spending!


I will keep an eye on this issue, but I dont have high hopes for it.


Bests,


Laszlo


ps: I did bought an nokia n900 for exactly this reason, but the issue is not solved there either,


I tried to compile/create the package myself, but I somewhat lost in maemo packaging,


and could not find any interested people/mentors.
 
Hey,


What is the process of package creating on openpandora platform?


Is there some kind of emulator to work/try in advance?


(like a scratchbox environment)


Any working group where I could join or catch a mentor?


Its rather simple in fact what Im seeking, its a pure program no driver or anything fancy involved.


Just some package creating thing. And everything opensource. So only knowledge what I would need.


Bests,


Laszlo
 
notaz, sebt3, mcobit, skeezix, milkshake, many others, lots of mentors, the greatest 'round here


PND is the way to go, our very own format, copy n play
I like that! Did you make that up yourself? If not, you've better trademark it asap!


e.g. The new motto!


PND...Copy 'n' Play™
 
Last edited by a moderator:
I would rather recommend the wiki and the irc channel.


If you're able to compile it you're mostly done, packaging it up into a PND isn't even necessary for it to run and it's also done in next to no time (even by a noob like me -.-).
 
Back
Top