| Prev |   2     3   4   5     6   | Next | Last
maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] Advanced Clock Plugin (https://talk.maemo.org/showthread.php?t=67408)

Mentalist Traceur 2010-12-30 16:12

Re: [Announce] Advanced Clock Plugin
 
So, skykooler, I found your source code in the .deb file, and it's rather ridiculous just how much cleaner than mine it looks. I don't know if it's more efficient or not, but the fact that I can't even properly understand what the for loops do shows you how abysmal my coding knowledge is. I know what shell and Python stuff I learned out of necessity, but not really the foundational stuff any good coder should know by heart.

geneven 2010-12-30 17:48

Re: [Announce] Advanced Clock Plugin
 
This is great.

I hate digital clocks that tell me it is 08 a.m. rather than 8 a.m.

Is there a way to get rid of digital clock times starting with zero?

skykooler 2010-12-30 18:47

Re: [Announce] Advanced Clock Plugin
 
Quote:

Originally Posted by Mentalist Traceur (Post 907683)
So, skykooler, I found your source code in the .deb file, and it's rather ridiculous just how much cleaner than mine it looks. I don't know if it's more efficient or not, but the fact that I can't even properly understand what the for loops do shows you how abysmal my coding knowledge is. I know what shell and Python stuff I learned out of necessity, but not really the foundational stuff any good coder should know by heart.

Basically I am measuring how much CPU time is taken in .1 second of real time. The potential problem here it that my script takes .1 second at least to execute, even though it is sleeping most of that time, which could lead to a battery drain if the clock were the only app running (does it shut off when the screen is locked?)

Quote:

This is great.

I hate digital clocks that tell me it is 08 a.m. rather than 8 a.m.

Is there a way to get rid of digital clock times starting with zero?
Edit one of the source files in /usr/lib/advanced-clock-plugin/clocks. Find where it says str(h).zfill(2) and change that to just str(h). Repeat with the minutes and seconds if desired.

Wonko 2010-12-30 23:25

Re: [Announce] Advanced Clock Plugin
 
Well,
based on the requests in here, I added some more improvements:
- you get your color setting "by value" back (i.e. you can enter numeric color codes, not in hex but in decimal notation, but I think this should suffice) ;),
- added an option to disable the leading zero padding for numeric values,
- and fixed a bug in the settings dialog which caused the color not being reloaded correctly.

The "Pad Numbers with Zeros" setting currently affects everything: hours, minutes, and seconds.
This is probably too much.
If you like a more specific behavior let me know.

Edit: I also added a version of the binary clock which indicated the next alarm time.

m2k 2010-12-31 00:51

Re: [Announce] Advanced Clock Plugin
 
I greatly appreciate your hard work on this plugin! I share the same suggestion of removing the leading zero for the decimal clock mode. Hopefully, you can apply an option to remove it just for the 'hours'. Thank you guys very much!!

theonelaw 2010-12-31 01:13

Re: [Announce] Advanced Clock Plugin
 
Quote:

Originally Posted by m2k (Post 907994)
I greatly appreciate your hard work on this plugin! I share the same suggestion of removing the leading zero for the decimal clock mode. Hopefully, you can apply an option to remove it just for the 'hours'. Thank you guys very much!!

I agree and second the notion of indeed a great work,

but

the notion of displaying numbers without leading zeroes is a cosmetic
that should be an _option_ rather than a default.

Please don't make that a default.

(I have made an awful lot of money over the decades sorting
mangled date-time-stamped data from bizarre formats
and the thought of discarding leading zeroes in numeric fields
screeches through my nerves like running fingernails across a chalkboard.
Just because other peoples shortsightedness has provided me
with a generously comfortable income does not mean I condone it.)

skykooler 2010-12-31 01:52

Re: [Announce] Advanced Clock Plugin
 
Does anyone have other suggestions for new clocks?
(I am thinking of making a few more but temporarily ran out of ideas).

Duy2anh 2010-12-31 01:52

Re: [Announce] Advanced Clock Plugin
 
Hi,
Thank you for the great effort.
I tried the plugin, very nice indeed. If it works well, it will be a perfect replacement for the builtin clock.
However, on my N900, the plugin ran well only for several hours, then refused to update the time. When I touch on the status area and go to the clock tab, the builtin clock still shows correct time, but time displayed by the advance clock plugin was stopped a couple of hours before although it still ran.
The phone got hot, which meant something was hogging the CPU, and indeed, things became so slow.
I removed the clock pluggin, reboot, and things went back to normal again.
I used Titan kernel ULV 250 750 at the time. Was that the cause?

skykooler 2010-12-31 02:02

Re: [Announce] Advanced Clock Plugin
 
Wow, apparently over a thousand people have downloaded my binary clock plugin!

skykooler 2010-12-31 02:03

Re: [Announce] Advanced Clock Plugin
 
Quote:

Originally Posted by Duy2anh (Post 908014)
Hi,
Thank you for the great effort.
I tried the plugin, very nice indeed. If it works well, it will be a perfect replacement for the builtin clock.
However, on my N900, the plugin ran well only for several hours, then refused to update the time. When I touch on the status area and go to the clock tab, the builtin clock still shows correct time, but time displayed by the advance clock plugin was stopped a couple of hours before although it still ran.
The phone got hot, which meant something was hogging the CPU, and indeed, things became so slow.
I removed the clock pluggin, reboot, and things went back to normal again.
I used Titan kernel ULV 250 750 at the time. Was that the cause?

Maybe. Using the default kernel I haven't had any problems.

Duy2anh 2010-12-31 03:19

Re: [Announce] Advanced Clock Plugin
 
Quote:

Originally Posted by skykooler (Post 908020)
Wow, apparently over a thousand people have downloaded my binary clock plugin!

As I have said, if it does not crash with others, it would be exactly what I need. I want to see the time and date on the status bar. Without the pluggin, I have to open the calendar app to see what date it is! That's bad.

TomJ 2010-12-31 05:51

Re: [Announce] Advanced Clock Plugin
 
Quote:

Originally Posted by skykooler (Post 908013)
Does anyone have other suggestions for new clocks?
(I am thinking of making a few more but temporarily ran out of ideas).

Showing multiple timezones, as per the request upthread somewhere?

skykooler 2010-12-31 06:07

Re: [Announce] Advanced Clock Plugin
 
Quote:

Originally Posted by TomJ (Post 908102)
Showing multiple timezones, as per the request upthread somewhere?

Great idea! That may take a day or so, as I will have to figure out the settings panel stuff.

theonelaw 2010-12-31 07:33

Re: [Announce] Advanced Clock Plugin
 
Anyone know yet what the useful limit is on the width of the clock?
If not, I will report back as my next mod needs 16 characters width.

Cheers all

Mentalist Traceur 2010-12-31 07:39

Re: [Announce] Advanced Clock Plugin
 
There's no "limit" from a coding stand point (except maybe what the python engine or the N900's hardware or Maemo five can support). It's just that if you make it too big, it will keep widening the status icon area, hiding more and more of the rest of the status bar. I don't know if it maxes out towards the very end, but by then it's already a usability PITA if the user using the clock style wants to open the menu of an app that has its menu in the status bar.

F2thaK 2010-12-31 07:47

Re: [Announce] Advanced Clock Plugin
 
noice one as usual!

my one idea: alarm indicator as a bell (like default) instead of red dot..

just a suggestion

cheers

Radicalz38 2010-12-31 11:00

Re: [Announce] Advanced Clock Plugin
 
Hi wonko... there's a bug on the latest version... the setting for 24/12 hour clock won't work on BcdClock. It just stays at 24 hours even if I set it to 12 hours. Also the time seems inaccurate. Not sure but it looks like it's 1 hour delayed.

Wonko 2010-12-31 13:12

Re: [Announce] Advanced Clock Plugin
 
1 Attachment(s)
Just uploaded version 0.9.0 to extras-devel.
This version fixes the BcdClock twelve-hour mode and only applies the "Pad Zeros" setting to hours.
Furthermore, this version is compatible to the Klingon fonts which can be installed via the following package:
http://maemo.org/packages/view/ttf-klingon
Go grab 'em now to increase your nerd-level even further! ;)

Edit: I attached a screenshot of a clock with Klingon fonts.

Wonko 2011-01-01 10:50

Re: [Announce] Advanced Clock Plugin
 
Alright,
first of all: happy new year all! ;)

I made some major changes with respect to the packaging.
Instead of having the status area plugin and the control panel plugin in separate packages, I decided to move both together into a single package.
Hence, from now on everything will come bundled in the "advanced-clock-plugin" package.
The first "all-inclusive" version is 0.9.2 and should be available in extras-devel at the time of writing.

As this is quite a big change there are various possibilities for things to break. ;)
So, I'd like your feedback about the transition and if everything worked out fine.

Edit: Already found the first issue: the new package was categorized as "libs".
Version 0.9.2-1 fixes this issue and is correctly categorized as "user/desktop".
Furthermore, I changed the description that appears in the application manager to read "Advanced Clock Plugin" instead of "advanced-clock-plugin".

joppu 2011-01-01 11:32

Re: [Announce] Advanced Clock Plugin
 
http://farm6.static.flickr.com/5010/...3925a45e_b.jpg
Screenshot-20110101-132938.png by joppu1, on Flickr

Looking awesome :)

Mentalist Traceur 2011-01-01 12:04

Re: [Announce] Advanced Clock Plugin
 
skykooler, I'm either almost at the point where I can present you (and everyone else, really) with a working model of processor and memory usage monitoring in the clock style, OR I'm almost at the point where I throw my hands up in the air in frustration and go with your sleeps using thing. Memory was easy as hell, but this processor thing has hit a little snag.

I figured out a method that doesn't use sleeps, but as a result, the intervals between measuring /proc/stat values are so small, that it almost always gives 1 or 0 as the value to the equation of time CPU spent in non-idle processes, vs. time spent in total (or anything at all. If you do the cpumem applet route and compare ONLY idle, it never reports anything but 0, because there's no idle time in the time spent processing the script, I suspect, during the two moments it fetches info from /proc/stat. (I am pretty sure it's not a math screw up, because other than the idle times, all the others do have time to change, and under the right circumstances, 2, 3, and even up to 6 has shown up [when comparing differences between different moments of the first three numbers of /proc/stat together. Division of that difference by the difference in 'total' time also yields either 1, 0, or [until I figured out to account for possible zeroes in the 'total' time, which is the denominator] errors.)

Mathematically all of this basically comes down to exactly that: I can't make python wait long enough between checks for the stats in procs to accumulate enough 'Jiffies'/USER_HZ to change significantly. The only reason I got any changes at all was by placing one /proc/stat opening and closing before the opening and closing of /proc/meminfo, then calculating the mem part of the script, then fetching the second instance of /proc/stat.

The main thing tripping this up is needing to declare a variable in python before you can use it (it's probably not a problem in all of python, but I couldn't figure out how to do it within a clock-style once, without that first declaration either crashing the clock style, or being run every new iteration of the clock - you can put that down to lack of Python knowledge or some unintended behavior, I don't know.

But right now, this is what I was trying to do for about two days straight, before stumbling upon the above, which still isn't actually a practical solution (if you pad it with enough code between the two accessings of /proc/stat, it either just ends up wasting more processing power on running the padding, and it becomes more efficient to use your sleep approach.

Wonko: Am I missing something here? Is there a way I can set a variable from within the clock style once, just so that it's initialized, and then have later looping parts of the draw clock code use it?

To be clear, I'm going for something like this:

cpuprevious = 0 [or NoneType, doesn't matter]
[blah blah blah various code]
cpulist = file("/proc/stat", 'r')
[more code]
cpucurrent = [stuff taken from cpulist.readline().whatever]
cpu = cpucurrent - cpuprevious
cpuprevious = cpucurrent

The point being, I want the initializing cpuprevious = 0 code to just run once, and I want cpuprevious = cpucurrent to run every execution. That way the last run's current /proc/stat gets uses as the previous value for the next run, etc. The very first initial calculation ends up off, but you only see it during boot/restart of hildon-status-menu, and then processor load would be on-off anyway. I have tried putting "cpuprevious = 0" [my variable names are a bit different, but for example's sake, we're going with "cpuprevious"], in various places in the code. It always has to run before the cpuprevious = cpucurrent, because if it doesn't, Python will throw a fit about cpuprevious not being defined when it hits "cpu = cpucurrent - cpuprevious". Naturally making them equal each other before you run that "cpu =" is counter productive, because then it'll just make cpu = 0 the entire time, so again, you have to define cpuprevious before you run "cpu =", but the only places I've been able to put it within the clock style without crashing the clock causes that line to be run on every clock-refresh, thus wiping whatever the 'last' value may have been. I also tried using "try cpuprevious/except NameError/else/finally" combinations, but so far, they seem to get stuck on the one choice they're given. So, the clock style initializes, it hits the "try", hits the exception, and then runs the exception (defining the variable as whatever). Then it does the rest (cpuprevious = cpucurrent at the end), and I thought that from there, when it hits the next loop, it will have a defined cpuprevious, so the try/except thing won't get a name error, and would move on. But, apparently, it gets stuck running whatever the exception suite was, even when the exception is no longer valid. I also tried some stuff with while loops, but failed at that too, since I couldn't find anything in the last few days of non-stop working (literally, this has become addictive, most of my day is doing this) that would check for the variable not existing. I tried "while cpuprevious not in locals()" and "while cpuprevious not in globals()", but near as I could tell, that doesn't do it either.

I mean, I haven't literally done every conceivable combination of code possible, but pretty close, and I haven't found it to be doable within the clock style with my limited skills.

Oh, also, "from __future__ import division" didn't work from within my clock style. Anything I'm missing about python on the N900, that could explain why this didn't work for me? (Of course, I also manage to have a bunch of other stuff I thought I imitated just fine from other example python code just not work... so I'm sure there's something really important I just don't know about importing.)

- While I wrote this, Wonko posted about the new update -
Wonko, I'll tell you if I get any bugs tomorrow. I just spend an all-nighter again working on the above problem (this is day 4 or 5 I did that in a row now... lol), so I want to sleep.

Wonko 2011-01-01 13:32

Re: [Announce] Advanced Clock Plugin
 
Quote:

Originally Posted by Mentalist Traceur (Post 908932)
Wonko: Am I missing something here? Is there a way I can set a variable from within the clock style once, just so that it's initialized, and then have later looping parts of the draw clock code use it?

That's what the constructor (the __init__ method) is for.
There you can initialize member variables like this:
Code:

class DecimalClock(clock.Clock):
    def __init__(self, drawing_area):
        clock.Clock.__init__(self, drawing_area)
        self.my_member_variable = 0 #None, "some_string" whatsoever

And then later on you just use "self.my_member_variable" in your code to access it.


P.S.: I didn't read your complete post yet, just wanted to give you a quick feedback. ;)
By the way, I seem to have missed what you're up to.
What exactly are you trying to do?

Edit: By the way, if you have the "Show Seconds" option disabled the clock is only updated once per minute.
Consequently, the draw_clock method is also only called once per minute.

theonelaw 2011-01-01 15:13

Re: [Announce] Advanced Clock Plugin
 
Just upgraded from the old 0.3 to 0.9.2-1
and I seem to have lost the fonts somewhere,
as the binary clocks all work but the character-based clocks
are just blank.

This is on my stock-version unit (my test unit which
I normally use to check things out on is still not working)
so it has no special things going on aside from PR 1.3
and the usual stuff.

I see a very involved list of fonts to choose from but none seem
to show up in the clock - just a black blank.
I changed the color settings to make sure it was not
doing something silly like printing black on black but again no joy.
I tried just using sans and nokia sans and a few others from the list
but the results are always just a blank.
The binary and bcd and analog clocks are all ok,
only the clocks needing text are affected.

I am still looking for where this went off the rails,
uninstalling and rebooting had no effect, so I am guessing
I have a misconfigured gconf setting maybe?


Found it - I was doing something silly like
using the default text scaling setting of 1.
This might be better set to some nominal scale, perhaps?
I notice it always resets to 1 each time I open the dialogue,
which may be a problem for some users.

Anwhay - it works even better now thanks:D:D:D:D:D

theonelaw 2011-01-01 16:59

Re: [Announce] Advanced Clock Plugin
 
Weird - I just set text scaling to 80 or 90 and it jumps to 100.
Not a real problem but wondering what the mechanism for that is...

Also notice that when I add a personal clock it immediately
to /usr/lib/advanced... it immediately becomes available
for selection but it does not run when selected,
the previous selection runs.
I am guessing this is because only clocks found at boot are
available perhaps?

Rebooted and no clock now, will try uninstall and re-install and see
where I broke it

hildon-status-menu mantra - (this helps):
Code:

pkill -f /usr/bin/hildon-status-menu
back to testing my ISO mod

singpolyma 2011-01-01 17:01

Re: [Announce] Advanced Clock Plugin
 
Great app! I'm interested in seeing the DateTime clock and the Decimal clock be configurable such that I could put an arbitrary strftime-compatible string in to get whatever date/time formats I want. Also, I would really like to see support for fractional days (probably I would pre-process %J into millidays so that it remains compatible with normal strftime syntax).

I am willing to write the code for this. Is a patch to this effect likely to get accepted? Is there a public source repository or other good thing or are hackers just extracting python from the .deb and using diff?

skykooler 2011-01-01 17:33

Re: [Announce] Advanced Clock Plugin
 
Quote:

Originally Posted by Mentalist Traceur (Post 908932)
skykooler, I'm either almost at the point where I can present you (and everyone else, really) with a working model of processor and memory usage monitoring in the clock style, OR I'm almost at the point where I throw my hands up in the air in frustration and go with your sleeps using thing. Memory was easy as hell, but this processor thing has hit a little snag.

I figured out a method that doesn't use sleeps, but as a result, the intervals between measuring /proc/stat values are so small, that it almost always gives 1 or 0 as the value to the equation of time CPU spent in non-idle processes, vs. time spent in total (or anything at all. If you do the cpumem applet route and compare ONLY idle, it never reports anything but 0, because there's no idle time in the time spent processing the script, I suspect, during the two moments it fetches info from /proc/stat. (I am pretty sure it's not a math screw up, because other than the idle times, all the others do have time to change, and under the right circumstances, 2, 3, and even up to 6 has shown up [when comparing differences between different moments of the first three numbers of /proc/stat together. Division of that difference by the difference in 'total' time also yields either 1, 0, or [until I figured out to account for possible zeroes in the 'total' time, which is the denominator] errors.)

Mathematically all of this basically comes down to exactly that: I can't make python wait long enough between checks for the stats in procs to accumulate enough 'Jiffies'/USER_HZ to change significantly. The only reason I got any changes at all was by placing one /proc/stat opening and closing before the opening and closing of /proc/meminfo, then calculating the mem part of the script, then fetching the second instance of /proc/stat.

The main thing tripping this up is needing to declare a variable in python before you can use it (it's probably not a problem in all of python, but I couldn't figure out how to do it within a clock-style once, without that first declaration either crashing the clock style, or being run every new iteration of the clock - you can put that down to lack of Python knowledge or some unintended behavior, I don't know.

But right now, this is what I was trying to do for about two days straight, before stumbling upon the above, which still isn't actually a practical solution (if you pad it with enough code between the two accessings of /proc/stat, it either just ends up wasting more processing power on running the padding, and it becomes more efficient to use your sleep approach.

Wonko: Am I missing something here? Is there a way I can set a variable from within the clock style once, just so that it's initialized, and then have later looping parts of the draw clock code use it?

To be clear, I'm going for something like this:

cpuprevious = 0 [or NoneType, doesn't matter]
[blah blah blah various code]
cpulist = file("/proc/stat", 'r')
[more code]
cpucurrent = [stuff taken from cpulist.readline().whatever]
cpu = cpucurrent - cpuprevious
cpuprevious = cpucurrent

The point being, I want the initializing cpuprevious = 0 code to just run once, and I want cpuprevious = cpucurrent to run every execution. That way the last run's current /proc/stat gets uses as the previous value for the next run, etc. The very first initial calculation ends up off, but you only see it during boot/restart of hildon-status-menu, and then processor load would be on-off anyway. I have tried putting "cpuprevious = 0" [my variable names are a bit different, but for example's sake, we're going with "cpuprevious"], in various places in the code. It always has to run before the cpuprevious = cpucurrent, because if it doesn't, Python will throw a fit about cpuprevious not being defined when it hits "cpu = cpucurrent - cpuprevious". Naturally making them equal each other before you run that "cpu =" is counter productive, because then it'll just make cpu = 0 the entire time, so again, you have to define cpuprevious before you run "cpu =", but the only places I've been able to put it within the clock style without crashing the clock causes that line to be run on every clock-refresh, thus wiping whatever the 'last' value may have been. I also tried using "try cpuprevious/except NameError/else/finally" combinations, but so far, they seem to get stuck on the one choice they're given. So, the clock style initializes, it hits the "try", hits the exception, and then runs the exception (defining the variable as whatever). Then it does the rest (cpuprevious = cpucurrent at the end), and I thought that from there, when it hits the next loop, it will have a defined cpuprevious, so the try/except thing won't get a name error, and would move on. But, apparently, it gets stuck running whatever the exception suite was, even when the exception is no longer valid. I also tried some stuff with while loops, but failed at that too, since I couldn't find anything in the last few days of non-stop working (literally, this has become addictive, most of my day is doing this) that would check for the variable not existing. I tried "while cpuprevious not in locals()" and "while cpuprevious not in globals()", but near as I could tell, that doesn't do it either.

I mean, I haven't literally done every conceivable combination of code possible, but pretty close, and I haven't found it to be doable within the clock style with my limited skills.

Oh, also, "from __future__ import division" didn't work from within my clock style. Anything I'm missing about python on the N900, that could explain why this didn't work for me? (Of course, I also manage to have a bunch of other stuff I thought I imitated just fine from other example python code just not work... so I'm sure there's something really important I just don't know about importing.)

- While I wrote this, Wonko posted about the new update -
Wonko, I'll tell you if I get any bugs tomorrow. I just spend an all-nighter again working on the above problem (this is day 4 or 5 I did that in a row now... lol), so I want to sleep.

What I did in the net speed monitor is create a small file in /tmp with the data you want. This stays there every time the clock is run and is updated each time. Since the file size is so small, the extra execution time due to the read/write is negligible.

Hope this helps!

skykooler 2011-01-01 17:38

Re: [Announce] Advanced Clock Plugin
 
Quote:

Originally Posted by singpolyma (Post 909125)
Great app! I'm interested in seeing the DateTime clock and the Decimal clock be configurable such that I could put an arbitrary strftime-compatible string in to get whatever date/time formats I want. Also, I would really like to see support for fractional days (probably I would pre-process %J into millidays so that it remains compatible with normal strftime syntax).

I am willing to write the code for this. Is a patch to this effect likely to get accepted? Is there a public source repository or other good thing or are hackers just extracting python from the .deb and using diff?

You can post any package you want to extras-devel (that's what I did with my clock plugin). As for the source - I believe there is a public source repository, but why not just look at the installed python files (seeing as they are not compiled)? The clocks are in /usr/lib/advanced-clock-plugin/clocks; take a look at them and write your own versions.

Wonko 2011-01-01 19:47

Re: [Announce] Advanced Clock Plugin
 
I just uploaded version 0.10.0.
This version adds a simple "world clock" and an option for selecting the displayed time zone.
Also, this version hopefully fixes some issues which were mentioned here.

Quote:

Originally Posted by theonelaw (Post 909119)
Weird - I just set text scaling to 80 or 90 and it jumps to 100.

Fixed in 0.10.0.
Was reading an integer from gconf whereas it should have been float.

Quote:

Originally Posted by singpolyma
Is there a public source repository or other good thing or are hackers just extracting python from the .deb and using diff?

The complete source code can be found in the SVN repository at the garage site:
https://garage.maemo.org/projects/advclockplugin
Patches are also welcome (as long as they don't break any existing logic). ;)
Or you could write your own addition as skykooler mentioned.
Advanced Clock Plugin is intended to be open for extension by others via custom "clock styles".

Quote:

Originally Posted by singpolyma
I'm interested in seeing the DateTime clock and the Decimal clock be configurable such that I could put an arbitrary strftime-compatible string in to get whatever date/time formats I want.

For this use case I'd suggest to add another "clock style".
A good start would probably be to copy the existing DecimalClock.
Of course you would need some String input field in the configuration plugin and a method for adding that string to the clocks.
I could add a free text field and set it in a way such that the text is available when inheriting from the Clock base class.
This would others also to use that free text probably for even completely different purposes.

Currently, all options that can be set via the options frontend are accessible when inheriting from the Clock base class.
So anyone writing a custom clock can access these fields.
Have a look in clock.py to see what is currently available.

Wonko 2011-01-01 20:43

Re: [Announce] Advanced Clock Plugin
 
While I was at it I just uploaded version 0.11.0 to extras devel.
Firstly, this version fixes a bug with respect to dependencies.
Secondly, this version adds a "Custom Format" setting which can be used for basically anything you are up to. ;)
In clocks inheriting from Clock (in clock.py) the content of this field can be accessed via "self.custom_format".

pusak gaoq 2011-01-01 21:26

Re: [Announce] Advanced Clock Plugin
 
Quote:

Originally Posted by Wonko (Post 909241)
While I was at it I just uploaded version 0.11.0 to extras devel.
Firstly, this version fixes a bug with respect to dependencies.
Secondly, this version adds a "Custom Format" setting which can be used for basically anything you are up to. ;)
In clocks inheriting from Clock (in clock.py) the content of this field can be accessed via "self.custom_format".

love your great works....i have been updating this plugin to the latest version....
can i give you a few idea to makes this plugin even better???
i only suggest two thing to adds for this plugins....

1.change the analog clock = i was hopping you can change the circle analog clock to square analog clock & makes the clock use all the space in the status bar so the square clock can looks bigger...

2.hide the clock = after every upgrading to any version you can see the clock disappear from the status bar (really looks nice) & will re-appear after you have reboot it....i hoping you can adds hide the clock function on this plugins....

hopes you can takes my idea as a considerations for the latest version next....

jdr93 2011-01-01 22:01

Re: [Announce] Advanced Clock Plugin
 
this is a good thing. been waiting for something like this to come along. thank you.

i don't wear a watch. to know the time sometimes i press the on/off button to access the slide screen which shows the time. it would be helpful if it showed the time and the time of they next appointment; pulling the appointment time from the calendar. if i don't turn on the phone i can just slide the thing back in my pocket.

Mentalist Traceur 2011-01-01 22:10

Re: [Announce] Advanced Clock Plugin
 
1 Attachment(s)
Wonko: Thank you. That got it to work. I am thinking it'd be easier to just see the code now that I got it working, instead of me explaining it.

skykooler, you now have a method without using sleeps (since the gap happens in between clock refreshes... which means I need to see if it works reasonably if it refreshes without showing seconds - since I always show seconds). Not sure if you can adapt it into your clocks, but seems easy enough. I just stuffed all of my code inside the draw_clock part.

Also, last night, I couldn't update from 9.whatever to the version that combined the packages for settings and normal. Basically, it seemed dpkg had the newly installing advanced-clock-plugin conflict with the yet uninstalled advanced-clock-settings-UI thing. Reinstall fixed it, as was expected.

Now, for all those interested, this is the current non-static version of the clock I showed you guys a static screenshot of earlier:

Attachment 16677

It ONLY duplicates the cpumem applet function for now, so this is only for those who feel like looking at the code, or like using half-finished clock styles. Unlike cpumem/load applets, which use 4 bars (5 if you count the gray bottom one), this fits in 5 (6 counting the gray bottom one). Thus, while cpumem uses wierd percentages (you can look at the source code to see what they are) of memory and cpu for checking off which bars to display, this cuts it simply at 20|40|60|80|100. Meaning, one gray bar indicates 0-20% use, one white bar indicates 20-40%, etc. And the top bar only turns on when you hit the max 100% (cpumem/load applets light up the top bar at 90% for cpu, and something else for memory).

The blue value is where the wifi signal applet clone will eventually go (white number 0-10 for signal quality), but for the tim being I was using it to debug the values being used to draw the bars, so in the version attached, it displays the cpu variable being used to display the cpu bar.

Other than that, the copyright line also includes my name as well as Wonko's, but I don't intend to leave it worded like that - I just stuck it in there for formality's sake when I firct created my TestClock.py file.

Right now, all I'm putting this out for is one, in case it helps skykooler (or others, but he's explicitlyl expresed concern over the efficiency of his cpu stat fetching), and two, to get feedback on it so far (mainly bugs people find, if they test it)... It doesn't properly update when the time is set to not show seconds (because it updates with the clock redraws; it doesn't support any new feature since around version 3.something of the Advanced Clock Applet (I've been so caught up making it do what it's supposed to do I haven't updated the code to support all the currently possible settings, and Wonko's been rolling out new features at a phenomenal rate).

Ummm, yeah. I'll keep adding stuff as I figure it out.

Meanwhile, just fyi to everyone, with the optification, clocks are now in /opt/maemo/usr/lib/advanced-clock-plugin/clocks/ (though the old directory symlinks there anyway).

Mentalist Traceur 2011-01-01 22:14

Re: [Announce] Advanced Clock Plugin
 
@ Hide-the-clock request: what would you actually use this for? If it's not something you're turning on-off often, it can easily be done with a clock style, if you'd like.

Hootenholler 2011-01-01 23:30

Re: [Announce] Advanced Clock Plugin
 
1 Attachment(s)
A few questions!

Any idea as to why my date is cut off, as seen below? It has been this way since the first version showing Date & Time was released.

http://i54.tinypic.com/6fwh9v.jpg

Is it possible for my clock to be in the format "Jan 1st 00:00"? Or if not, "1/1 00:00" either way reading across as one line of text, rather than date above time. How?!

enceladus47 2011-01-02 00:28

Re: [Announce] Advanced Clock Plugin
 
Thanks, was really amazed to find such an application :)
However the twelve hour mode does not seem to work with binary.

theonelaw 2011-01-02 02:22

ISO-8601 mod for Advanced Clock Plugin rev 0.11.0
 
2 Attachment(s)
ISO-8601 mod for Advanced Clock Plugin rev 0.11.0

ISO-8601 format again, hardcoded font size

enjoy

ISO_8601_Clock.py
Code:

import cairo
from datetime import datetime
import gtk
import math
import pango

import clock

def get_name():
    return "ISO_8601 Clock"

class ISO_8601_Clock(clock.Clock):
    def __init__(self, drawing_area):
        clock.Clock.__init__(self, drawing_area)

    def draw_clock(self):


# Draw date.in ISO-8601 compliant
        self.context.set_font_size(20)
        self.context.move_to(2, 16)
        text = str(self.time.year) + "." + str(self.time.month).zfill(2) + "." + str(self.time.day).zfill(2)
        self.context.text_path(text)
        self.context.stroke()

# Draw time.
        self.context.set_font_size(20)
        self.context.move_to(2, 35)
        text = str(self.time.hour).zfill(2) + ":" + str(self.time.minute).zfill(2) + ":" + str(self.time.second).zfill(2)
        self.context.text_path(text)
        self.context.stroke()


    def resize(self):
        self.drawing_area.set_size_request(110, 36)


Duy2anh 2011-01-02 06:31

Re: [Announce] Advanced Clock Plugin
 
Hi,
Do I miss something? After a complete reflash of my N900, I installed the newest Advance clock Pluggin package from extras-devel today, it show up in setting/personalize area and hide the default clock on the status bar, but it did not show the new advanced clock on the bar.
I tried to change clocks, change font, change color, almost anything, even turned off the phone and turned on again, but still, it did not show up.
Do I need somthing else beside the package?

theonelaw 2011-01-02 07:30

Re: [Announce] Advanced Clock Plugin
 
Quote:

Originally Posted by Duy2anh (Post 909549)
Hi,
Do I miss something? After a complete reflash of my N900, I installed the newest Advance clock Pluggin package from extras-devel today, it show up in setting/personalize area and hide the default clock on the status bar, but it did not show the new advanced clock on the bar.
I tried to change clocks, change font, change color, almost anything, even turned off the phone and turned on again, but still, it did not show up.
Do I need somthing else beside the package?

One step at a time - it is still working through the devel stage.
Did you try the analog clock ?
Important you change color so you can see it

(I know - I went round and round learning I had silly settings)

After analog clock try BCD clock

for the date time and decimal clocks
the fonts need to be right,
you need color or white in the color picker
and the font size needs to be some number like 80 or 100
( a real gotcha if you tend to think in point size)

and you may need to completely restart the thing sometimes
when you make big changes:
use this mantra:
Code:

pkill -f /usr/bin/hildon-status-menu

pusak gaoq 2011-01-02 08:06

Re: [Announce] Advanced Clock Plugin
 
Quote:

Originally Posted by Mentalist Traceur (Post 909309)
@ Hide-the-clock request: what would you actually use this for? If it's not something you're turning on-off often, it can easily be done with a clock style, if you'd like.

the reason why i ask the hide the clock request is so we can use other clock widgets on our phone....
there a few clock widgets that we can use on our N900...these widgets can be customize & resize so it can looks better....
it just an idea so its up to the developer if he want to implant the hide the clock request or not later...

theonelaw 2011-01-02 08:25

Re: [Announce] Advanced Clock Plugin
 
Quote:

Originally Posted by pusak gaoq (Post 909581)
the reason why i ask the hide the clock request is so we can use other clock widgets on our phone....
there a few clock widgets that we can use on our N900...these widgets can be customize & resize so it can looks better....
it just an idea so its up to the developer if he want to implant the hide the clock request or not later...

I have several hours experience at hiding the clock,
it is quite easy to do actually.
Just install advanced-clock-plugin
then rename /usr/lib/advanced-clock-plugin/clock.py to noclock
and then reboot - no more clock ! :D :D


| Prev |   2     3   4   5     6   | Next | Last
All times are GMT. The time now is 21:28.

vBulletin® Version 3.8.8