mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 15:37:23 +00:00
New release 1.2.1
widget: * added checking verification of existences battery and ac
This commit is contained in:
parent
e37a5b40f8
commit
7ae496155c
BIN
old_versions/pytextmonitor-1.0.0.plasmoid
Normal file
BIN
old_versions/pytextmonitor-1.0.0.plasmoid
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
old_versions/pytextmonitor-1.1.4.plasmoid
Normal file
BIN
old_versions/pytextmonitor-1.1.4.plasmoid
Normal file
Binary file not shown.
BIN
pytextmonitor-1.2.1.plasmoid
Normal file
BIN
pytextmonitor-1.2.1.plasmoid
Normal file
Binary file not shown.
Binary file not shown.
@ -511,17 +511,23 @@ class pyTextWidget(plasmascript.Applet):
|
||||
"""function to set battery text"""
|
||||
line = self.batFormat
|
||||
if (line.split('$bat')[0] != line):
|
||||
with open (self.battery_device, 'r') as bat_file:
|
||||
bat = bat_file.readline().split('\n')[0]
|
||||
if os.path.exists(self.battery_device):
|
||||
with open (self.battery_device, 'r') as bat_file:
|
||||
bat = bat_file.readline().split('\n')[0]
|
||||
else:
|
||||
bat = 'off'
|
||||
bat = "%3s" % (bat)
|
||||
line = line.split('$bat')[0] + bat + line.split('$bat')[1]
|
||||
if (line.split('$ac')[0] != line):
|
||||
with open (self.ac_device, 'r') as bat_file:
|
||||
bat = bat_file.readline().split('\n')[0]
|
||||
if (bat == '1'):
|
||||
bat = '(*)'
|
||||
if os.path.exists(self.ac_device):
|
||||
with open (self.ac_device, 'r') as bat_file:
|
||||
bat = bat_file.readline().split('\n')[0]
|
||||
if (bat == '1'):
|
||||
bat = '(*)'
|
||||
else:
|
||||
bat = '( )'
|
||||
else:
|
||||
bat = '( )'
|
||||
bat = '(?)'
|
||||
line = line.split('$ac')[0] + bat + line.split('$ac')[1]
|
||||
text = self.formatLine.split('$LINE')[0] + line + self.formatLine.split('$LINE')[1]
|
||||
self.label_bat.setText(text)
|
||||
|
@ -9,7 +9,7 @@ X-Plasma-MainScript=code/main.py
|
||||
X-KDE-PluginInfo-Author=Evgeniy Alexeev aka arcanis
|
||||
X-KDE-PluginInfo-Email=esalexeev@gmail.com
|
||||
X-KDE-PluginInfo-Name=py-text-monitor
|
||||
X-KDE-PluginInfo-Version=1.2.0
|
||||
X-KDE-PluginInfo-Version=1.2.1
|
||||
X-KDE-PluginInfo-Website=http://kde-look.org/
|
||||
X-KDE-PluginInfo-Category=System Information
|
||||
X-KDE-PluginInfo-Depends=
|
||||
|
Loading…
Reference in New Issue
Block a user