maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Flip clock pre pre pre pre release (https://talk.maemo.org/showthread.php?t=25582)

ciroip 2008-12-14 07:20

Flip clock pre pre pre pre release
 
EDIT
Most recent version: 0.1.7 Beta DBUS Alarm
https://garage.maemo.org/frs/downloa....1.7_armel.deb
0.1.2 plankton application alarm
22th February 2009: .DEB
https://garage.maemo.org/frs/downloa....1.2.armel.deb
OS 2008 5.2008.43-7 (DIABLO) on Nokia N810 (but it should disable the Led function on N800).
Packaged with Kerthan's Pypackager using the qwerty12's previous version.
Dependencies: Python 2.5 - Python2.5-pygame (the 1.7 but the 1.5 should do the job)
I dont think exist a really easy way to install python2.5: a workaround could be to install an application
that use python and let the application manager take care of the dependencies
(from wha I understand only an application in a repository can manage the dependencies)
SolarWolf (a game) made the trick for python2.5 AND pygame:
http://maemo.org/downloads/product/OS2008/solarwolf/
I wasnt able to find a list of apps that actually use python or python+pygame.
BE AWARE PEOPLE: Installing python would take something like 4 precious mb of the tablet
link to single debs:
Python2.5:
http://repository.maemo.org/extras/p...sso2_armel.deb
http://files.myopera.com/ciroip/albu...3/fc-0.1.2.jpg
Garage page:
https://garage.maemo.org/frs/?group_id=851
[disclaimer in poopie english]
No one should use under any circumstance this application: Im not responsable for any damage that will occour to your tablet
or any appointment you will eventually miss for the application misfunctioning
__________________________________________________ _______________________________________
[ORIGINALL POST]

...
Since I didnt see any hand raising:
http://www.internettablettalk.com/fo...ad.php?t=24865
I decided to try by myself so here my really 1st python program ever. The thing need python (of course) and pygame to 'work'.
I have no idea what really is goin'on... I just randomly copied and pasted code around. No one should try this release. I dont assume any responsability. L'application run ONLY in full screen and there is no way to kill it. It dosn't manage the display lit (every minute the screen eventualy return bright ), no alarms, no radio manager, no flipanimations, no flashing leds, no nothing (well, the clock should work....)
https://garage.maemo.org/frs/downloa...pclock.tar.bz2
https://garage.maemo.org/frs/downloa...flipclock1.jpg

pton 2008-12-14 10:49

Re: Flip clock pre pre pre pre release
 
Looks cool!

lcuk 2008-12-14 13:30

Re: Flip clock pre pre pre pre release
 
ciroip,

!!! impressive, but it doesn't work by default :(

Your code is looking for d1.png and d2.png in the clock function:

def clock(cfr1,cfr2,cfr3,cfr4):
# sep1=pygame.image.load("d1.png")
# sep2=pygame.image.load("d2.png")

commenting these out gets it running :)

Package it up and make it available for everyone.
Simple little usable apps are great to have.

lcuk 2008-12-14 13:39

Re: Flip clock pre pre pre pre release
 
ciroip, do you mind if i use the glyphs you constructed to build a widget in liqbase?
it will help me to test things.

ciroip 2008-12-14 15:02

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by lcuk (Post 249439)
ciroip, do you mind if i use the glyphs you constructed to build a widget in liqbase?
it will help me to test things.

not at all.The opposite.. I cant wait to see more apps from you.
Feel free to use whatever you want.

ciroip 2008-12-14 15:08

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by pton (Post 249422)
Looks cool!

thank you. For now just 'look' cool. I hope I ll can find a way to make it work too
:p

qwerty12 2008-12-14 15:16

Re: Flip clock pre pre pre pre release
 
Nice work, looks cool. :)

2 suggestions, please use a text editor that understands unix line endings! (in vi, i'm getting ^M after each line which means it was saved in windows format). Plus, replacing "#!/usr/bin/python" with "#!/usr/bin/env python2.5" lets you start the program quicker if you hav python-launcher installed.

Also +1 with lcuk but all you need to do is remove the "d" rather than commenting the lines.

ciroip 2008-12-14 15:17

Re: Flip clock pre pre pre pre release
 
Quote:

commenting these out gets it running

Package it up and make it available for everyone.
Simple little usable apps are great to have.
Damn, I uploaded the wrong one... anyway Im still looking for help.
I would love to leave the boring parts :p (coding packaging...)to someone else who want complete the thing. I promise fame and celebrities.

ciroip 2008-12-14 17:09

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by qwerty12 (Post 249445)
Nice work, looks cool. :)

2 suggestions, please use a text editor that understands unix line endings! (in vi, i'm getting ^M after each line which means it was saved in windows format). Plus, replacing "#!/usr/bin/python" with "#!/usr/bin/env python2.5" lets you start the program quicker if you hav python-launcher installed.

Also +1 with lcuk but all you need to do is remove the "d" rather than commenting the lines.

that's the kind of comments I like :)
I hope Ill became a bit less sloppy if/when maemo will approve this project and things 'll became a bit more official...

daperl 2008-12-14 17:45

Re: Flip clock pre pre pre pre release
 
Making the following change allows me to run this app in Kubuntu 8.10 and on my n800. Otherwise it changes the screen resolution of my KDE nvidia graphics desktop. Painful.
Code:

try:
  window = pygame.display.set_mode((0,0))
except:
  window = pygame.display.set_mode((800, 480))

Cool stuff. Thanks.

qwerty12 2008-12-14 18:54

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by ciroip (Post 249447)
Damn, I uploaded the wrong one... anyway Im still looking for help.
I would love to leave the boring parts :p (coding packaging...)to someone else who want complete the thing. I promise fame and celebrities.

I've packaged it up, just need to make a few fixes and I'll put out a package tomorrow.

ciroip 2008-12-14 18:55

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by daperl (Post 249473)
Making the following change allows me to run this app in Kubuntu 8.10 and on my n800. Otherwise it changes the screen resolution of my KDE nvidia graphics desktop. Painful.
Code:

try:
  window = pygame.display.set_mode((0,0))
except:
  window = pygame.display.set_mode((800, 480))

Cool stuff. Thanks.

mh, yes, I realized it could have some potential on desktops.
Im sorry you have to touch a so shitty code :o

I am usually more ashamed to show my sh**ty experiment but im confident that xmas make you nicer...

ciroip 2008-12-14 18:57

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by qwerty12 (Post 249491)
I've packaged it up, just need to make a few fixes and I'll put out a package tomorrow.

Mh great! People at maemo.org just approved the project: should I add u to the developers?
I have no idea how things works...

qwerty12 2008-12-14 19:04

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by ciroip (Post 249493)
Mh great! People at maemo.org just approved the project: should I add u to the developers?
I have no idea how things works...

If you wish! :)

But I must warn, i'm bad at python too (i'd say as bad as you say you are but you made this program :)) but I know bits and I can package :D

daperl 2008-12-14 19:28

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by ciroip (Post 249492)
mh, yes, I realized it could have some potential on desktops.
Im sorry you have to touch a so shitty code :o

I am usually more ashamed to show my sh**ty experiment but im confident that xmas make you nicer...

Don't worry about such things. There's plenty of us hacking our way around here. Thanks for sharing and keep up the good work.

ciroip 2008-12-14 19:57

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by qwerty12 (Post 249498)
If you wish! :)

But I must warn, i'm bad at python too (i'd say as bad as you say you are but you made this program :)) but I know bits and I can package :D

Glad to. Is qwert david you?
I just want make the NIT usefull during the nightly charging time so I was thinking to add something like alarm manage, small weather icons, rss scroll, background slideshows or whatever does not need any interaction and justify an always on display.
More people, more ideas, feel free to add any release u want, Im a pretty caotic guy so dont worry to touch my stuff. I dont think things could ever became worste :).
In case the project will became mature enough we will decide what promote to maemo.org

qwerty12 2008-12-14 20:00

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by ciroip (Post 249511)
Glad to. Is qwert david you?
I just want make the NIT usefull during the nightly charging time so I was thinking to add something like alarm manage, small weather icons, rss scroll, background slideshows or whatever does not need any interaction and justify an always on display.
More people, more ideas, feel free to add any release u want, Im a pretty caotic guy so dont worry to touch my stuff. I dont think things could ever became worste :).
In case the project will became mature enough we will decide what promote to maemo.org

Hehe, no, I'm Faheem Pervez with the username of qwerty12 on both garage and maemo.org. :)

allnameswereout 2008-12-15 00:14

Re: Flip clock pre pre pre pre release
 
Very nice, much preferred over the analog clocks because these are not very clear to read...

qwerty12 2008-12-15 08:00

Re: Flip clock pre pre pre pre release
 
Hmm, I'm having trouble getting flipclock to use the new paths. Anyone know what the correct way to do:
Quote:

str("/usr/share/flipclock/")+(orario[3])+".png"
is in python?

Atm, I'm getting:
Quote:

Traceback (most recent call last):
File "/usr/bin/flipclock.py", line 91, in <module>
cfr1,cfr2,cfr3,cfr4=singole()
File "/usr/bin/flipclock.py", line 48, in singole
cfr2=str("/usr/share/flipclock/")+(orario[3])+".png"
TypeError: cannot concatenate 'str' and 'int' objects
(Tried
Quote:

str"/usr/share/flipclock/"+(orario[3])+".png"
but then it says it is invalid syntax)

daperl 2008-12-15 08:23

Re: Flip clock pre pre pre pre release
 
orario[3] is an integer. Try and make it a string with:

str(orario[3])

Then you would have:

cfr2=str("/usr/share/flipclock/")+str(orario[3])+".png"

nilchak 2008-12-15 14:45

Re: Flip clock pre pre pre pre release
 
Great work and a big thanks for a nice interface to a simple big clock.

Would love to have alarms as a minimum addition to it - so I can use it as my wake-up device.
Right now I use the StatusBar Big clock with alarms - but frustratingly - it kills the sound daemon totally everytime after the first snooze. I have to reboot the NIT to get sound back each time. So having another alternative without the sound problems would be great indeed.

Personally - I would lile the clock to have minimal function overloads - i.e alarm functionas a addition. Would not want to have weather, news etc features overloaded onto it.

qwerty12 2008-12-15 15:42

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by daperl (Post 249622)
orario[3] is an integer. Try and make it a string with:

str(orario[3])

Then you would have:

cfr2=str("/usr/share/flipclock/")+str(orario[3])+".png"

Worked a treat, thank you!

qwerty12 2008-12-15 16:46

Re: Flip clock pre pre pre pre release
 
Packaged finally!

You can get the deb from here:
https://garage.maemo.org/frs/downloa..._0.001_all.deb

Source packages are available on (unless you want to make changes, the deb is what you should need):
https://garage.maemo.org/frs/?group_id=851

All the changes I've made to flipclock itself are in patches managed by quilt so it should be easy to see what was done. Any other changes such as setup.py installer script, debian folder etc are in the diff.gz.Thanks to daperl for the str help and for the window size modification (which I've included).

And now, we can exit it :):
http://qwerty12.maemobox.org/ciroip%27sflipclock.png

fpp 2008-12-15 21:10

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by qwerty12 (Post 249621)
Hmm, I'm having trouble getting flipclock to use the new paths. Anyone know what the correct way to do:
Quote:

cfr2 = str("/usr/share/flipclock/")+(orario[3])+".png"
is in python?

The most usual and "pythonic" idiom would be :

Quote:

cfr2 = "/usr/share/flipclock/%d.png" % orario[3]
PS: great job BTW ciroip and Faheem - I love it !

daperl 2008-12-15 21:36

Re: Flip clock pre pre pre pre release
 
@fpp

Good call.

@others

And if you decide to use more complex string formatting, don't forget that the variables need to be in a list (comma separated inside parenthesis). For example:
Code:

#! /usr/bin/env python

don = 7
a = 6
b = 8
s = "Q: %03d, what is the speed limit of sex?\nA: %d%d" % (don, a, b)
print s


qole 2008-12-15 22:11

Re: Flip clock pre pre pre pre release
 
daperl: can you get a ticket for going just one over the speed limit?

daperl 2008-12-15 22:33

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by qole (Post 249755)
daperl: can you get a ticket for going just one over the speed limit?

Well, I've never heard about getting a ticket, but here are 3 things that can happen:
  • you eat it
  • you have to turn around
  • she blows a rod
Or did something just go over my head? Again.

TrueJournals 2008-12-15 23:02

Re: Flip clock pre pre pre pre release
 
I hate to be a nit-picker here, but... daperl: from my understanding of python (and I could be wrong, I'm still learning), items in parentheses () are a tuple, while items in brackets [] are a list. So, in this case, the items need to be in a tuple, not a list. Not a big deal here, but the terminology changes what you can do with the items. (Reference Link)

daperl 2008-12-15 23:44

Re: Flip clock pre pre pre pre release
 
@TrueJournals

Yes, thanks. Grandpa always said, "better to pick the nit than pass on bad information." We used to slap the sh*t out of him. Just kidding. Variation on an old George Carlin joke. Thanks again.

ciroip 2008-12-16 06:16

Re: Flip clock pre pre pre pre release
 
New release: 0.002
I optimized a bit the code, now should be easier to read/modify/touch it :).
Im testing new graphics: feedback, feedback, feedback.
I hate it so ll probably decide for the naked flipping number.
I added a completely useless (and probably deadly for the cpu) flipping animation at the start.
I still have no idea how create a package out of the thing so I keep uploading the .py for now.
https://garage.maemo.org/frs/downloa...ock002.tar.bz2
https://garage.maemo.org/frs/downloa...eenshot002.jpg
https://garage.maemo.org/frs/downloa...eenshot003.jpg

qole 2008-12-16 06:57

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by daperl (Post 249760)
Well, I've never heard about getting a ticket, but here are 3 things that can happen...

Hey, daperl, any time you need a staight man... :D:p

qole 2008-12-16 07:24

Re: Flip clock pre pre pre pre release
 
ciroip:

This is really, really nice. What a great idea. Of course, when I see this, I immediately think of other retro ideas for full-screen clocks. For instance, how about nixie tubes?

Yes, I confirm that the opening animation doesn't really work on the tablet; waaaay too slow. EDIT: my fault, running a transparent desktop was making everything run slower...

Also, is there any way you could make the numbers fill more of the screen? I think it would look better with bigger numbers and less black space.

daperl 2008-12-16 07:54

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by qole (Post 249841)
Hey, daperl, any time you need a staight man... :D:p

You'll be the first. And maybe just for sh*ts and giggles I'll post some unoriginal qole avatars tomorrow. I think I've been sitting on them long enough. But as usual, I'm having problems sorting out the inappropriate ones.

daperl 2008-12-16 08:06

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by ciroip (Post 249835)

Is this Italy time? If so, I have to get back there. F*ck if I'm gonna miss that renaissance.

ciroip 2008-12-16 14:08

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by daperl (Post 249849)
Is this Italy time? If so, I have to get back there. F*ck if I'm gonna miss that renaissance.

it's called looking forward. Maybe someone will came with some wacko religion with 99 hours days...:)

ciroip 2008-12-16 14:14

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by qole (Post 249843)
ciroip:

This is really, really nice. What a great idea. Of course, when I see this, I immediately think of other retro ideas for full-screen clocks. For instance, how about nixie tubes?

Yes, I confirm that the opening animation doesn't really work on the tablet; waaaay too slow. EDIT: my fault, running a transparent desktop was making everything run slower...

Also, is there any way you could make the numbers fill more of the screen? I think it would look better with bigger numbers and less black space.

on the paper the nixie tubes sound great but I think Im not skilled enough to came out with a decent result... Ill give a try anyway.
Yes I can easily make the number bigger, just happen I begin with a size and remain stuck with that because I simply stop thinking about...

fpp 2008-12-16 14:18

Re: Flip clock pre pre pre pre release
 
Faheem, if there is a next package, could you maybe relax the python dependency a bit ? On my N810 running Chinook the deb won't install because it wants python ≥ 2.5.2, which is probably not necessary :-)

qwerty12 2008-12-16 15:30

Re: Flip clock pre pre pre pre release
 
Quote:

Originally Posted by fpp (Post 249900)
Faheem, if there is a next package, could you maybe relax the python dependency a bit ? On my N810 running Chinook the deb won't install because it wants python ≥ 2.5.2, which is probably not necessary :-)

Indeed, sure I can :). I'm making a package now of ciroip's new version (thank you ciroip for the path modification!) and will relax the versions.

I've lowered it to 2.5.1, should be fine for both diablo and chinook. Pygame version is the same so no changes there.

ciroip 2008-12-16 18:32

Re: Flip clock pre pre pre pre release
 
0.002 packaged version is out. as fast as precise as a british train qwerty12 'build' the packaged version
(british 's trains are note in Italy as the fastest and precise train in europe)
https://garage.maemo.org/frs/downloa..._0.002_all.deb
https://garage.maemo.org/frs/downloa...eenshot003.jpg
Thank you again qwerty12

gazza_d 2008-12-16 19:17

Re: Flip clock pre pre pre pre release
 
cool work guys. this is great


All times are GMT. The time now is 04:10.

vBulletin® Version 3.8.8