Hi there,
I stumbled on almost the same thing, while playing with freevo2.0.
In idlebar.clock there is almost the same code, and the same problem,
it results always in time with AM/PM.
My solution has been:
# let's check how the time is displayed
if time.strftime('%c').find('%P')==-1:
# 24 hours
format ='%a %H:%M'
else:
# 12 hours with pm/am
format ='%a %I:%M %P'
The format code %c displays the time in the appropriate locale format.
But I guess that it would be better, if the locale would be set
somewhere once and for all freevo.
Greetings
Tanja
Artur Cichocki schrieb:
> Hi all,
> I recently started studying the freevo source code;)
> In freevo/ui/gui/areas/info_area.py we have a function current_time():
>
> def current_time():
> if time.strftime('%P') =='':
> format ='%a %H:%M'
> else:
> format ='%a %I:%M %P'
> return time.strftime(format)
>
> Where exist a condition reffering to '%P' (12 or 24 hour clock, showing
> '' in case 24h, AM/PM otherwise), but there is no call to
> locale.setlocale(locale.LC_ALL, '') in the code (which should activate
> locale according to users default settings). In result it always shows
> time with AM/PM and weekday name in English.
>
> So there should be a call to locale.setlocale(locale.LC_ALL, '')
> somewhere in the initialization code (ie. freevo/ui/sysconfig.py).
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Freevo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freevo-devel
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel