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)

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


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

vBulletin® Version 3.8.8