From 7a9a59ada33c1dbc7a47ade00ac71462dc4cfbc8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Strasdas?= Date: Wed, 20 Jul 2011 08:52:16 +0200 Subject: [PATCH] [ShowClock]Minor code optimization --- showclock/CONTROL/control | 2 +- showclock/src/plugin.py | 92 ++++++++++++++++++--------------------- 2 files changed, 44 insertions(+), 50 deletions(-) diff --git a/showclock/CONTROL/control b/showclock/CONTROL/control index 7935505a..2288597e 100644 --- a/showclock/CONTROL/control +++ b/showclock/CONTROL/control @@ -1,5 +1,5 @@ Package: enigma2-plugin-extensions-showclock -Version: 0.4 +Version: 0.5 Description: Push key "Exit long" to show the clock while watching TV Maintainer: JuSt611 Depends: enigma2 (>= 2.6git20090615) diff --git a/showclock/src/plugin.py b/showclock/src/plugin.py index 65acfe0c..007ee1fc 100644 --- a/showclock/src/plugin.py +++ b/showclock/src/plugin.py @@ -1,10 +1,10 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- # # Show Clock E2 # # $Id$ # -# Coded by JuSt611 © 2011 +# Coded by JuSt611 © 2011 # Derived from Permanent Clock plugin written by AliAbdul # and placed in the public domain. He has my thanks. # Support: http://www.i-have-a-dreambox.com/wbb2/thread.php?threadid=??? @@ -61,9 +61,10 @@ from Screens.Setup import SetupSummary ############################################################################### -VERSION = "0.4" +VERSION = "0.5" # History: # 0.4 First public version +# 0.5 Minor code optimization pluginPrintname = "[ShowClock Ver. %s]" %VERSION debug = False # If set True, plugin will print some additional status info to track logic flow @@ -313,53 +314,46 @@ showClock = ShowClockMain() ############################################################################## def clockSkin(): - - clockSkinSD = """ - - - Default - - - Format::%S - - - Format:%A, %d.%m.%Y - - """ - - clockSkinXD = """ - - - Default - - - Format::%S - - - Format:%A, %d.%m.%Y - - """ - - clockSkinHD = """ - - - Default - - - Format::%S - - - Format:%A, %d.%m.%Y - - """ - if width < 1280: - if width < 1024: - currentSkin = clockSkinSD - else: - currentSkin = clockSkinXD - else: - currentSkin = clockSkinHD + if width < 1024: # SD + currentSkin = """ + + + Default + + + Format::%S + + + Format:%A, %d.%m.%Y + + """ + else: # XD + currentSkin = """ + + + Default + + + Format::%S + + + Format:%A, %d.%m.%Y + + """ + else: # HD + currentSkin = """ + + + Default + + + Format::%S + + + Format:%A, %d.%m.%Y + + """ try: # try to import DateToText converter (GP3 component) to check for its existence from Components.Converter.DateToText import DateToText # change converter to obtain localized weekdays -- 2.20.1