Jump to content


Photo

ClockToText.py


  • Please log in to reply
6 replies to this topic

#1 mrvica

  • Senior Member
  • 1,227 posts

+82
Good

Posted 1 November 2017 - 00:32

a small fix, the hours with one digit look much better with preceding "0"

 

  if self.type == self.WITH_SECONDS:
   # TRANSLATORS: full time representation hour:minute:seconds

 -  return fix_space(_("%2d:%02d:%02d") % (t.tm_hour, t.tm_min, t.tm_sec))
 + return fix_space(_("%02d:%02d:%02d") % (t.tm_hour, t.tm_min, t.tm_sec))
  elif self.type == self.DEFAULT:
   # TRANSLATORS: short time representation hour:minute
 -  return fix_space(_("%2d:%02d") % (t.tm_hour, t.tm_min))

 + return fix_space(_("%02d:%02d") % (t.tm_hour, t.tm_min))

 

 

 

Attached Files



Re: ClockToText.py #2 littlesat

  • PLi® Core member
  • 56,273 posts

+691
Excellent

Posted 1 November 2017 - 08:03

Brrrr when changing this make it configurable....

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: ClockToText.py #3 Dimitrij

  • PLi® Core member
  • 10,020 posts

+338
Excellent

Posted 1 November 2017 - 08:41

012:00

need this:

hour = t.tm_hour

if hour <12: hour = '0'+str(t.tm_hour)


Edited by Dimitrij, 1 November 2017 - 08:43.

GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: ClockToText.py #4 WanWizard

  • PLi® Core member
  • 68,612 posts

+1,739
Excellent

Posted 1 November 2017 - 13:04

Brrrr when changing this make it configurable....

 

Why is that Brrr... I personally find it a lot more logical. It is quite normal to use 01:23 instead of 1:23.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Pro (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: ClockToText.py #5 mrvica

  • Senior Member
  • 1,227 posts

+82
Good

Posted 1 November 2017 - 14:41

he is afraid it could brake something elsewhere, on FullHD skins seems all ok, on HD I saw some errors, needs some Fixing, depends how is text aligned



Re: ClockToText.py #6 littlesat

  • PLi® Core member
  • 56,273 posts

+691
Excellent

Posted 1 November 2017 - 16:38


Why is that Brrr...

Replacing just the lines and do not make it configurable is brrrr.,,,

Actually I prefer the skin itself is give what it wants in a simple "%02d:%02d:%02d" string....

But enigma2 started to get this way... so adding a "leading hours zero" feature could be added....


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: ClockToText.py #7 mrvica

  • Senior Member
  • 1,227 posts

+82
Good

Posted 2 November 2017 - 21:36

in EpgList.py too (single list)

(eListboxPythonMultiContent.TYPE_TEXT, r1.x, r1.y, r1.w, r1.h, 0, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, self.days[t[6]]),
-  (eListboxPythonMultiContent.TYPE_TEXT, r2.x, r2.y, r2.w, r1.h, 0, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, "%2d.%02d, %02d:%02d"%(t[2],t[1],t[3],t[4]))

+ (eListboxPythonMultiContent.TYPE_TEXT, r2.x, r2.y, r2.w, r1.h, 0, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, "%02d.%02d, %02d:%02d"%(t[2],t[1],t[3],t[4]))

 

actually everywhere

 

Attached Files




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users