New release 1.3.2:

* optimization and refactoring
  * gpu* and hddtemp now read from ext-sysmon DataEngine
Extended SystemMonitor DataEngine:
  initial release 1.0:
    + add gpu source
    + add gputemp source
    + add hddtemp source
    + add install script
This commit is contained in:
arcan1s
2013-05-24 19:48:10 +04:00
parent 9243220505
commit 4c59e7e892
18 changed files with 447 additions and 415 deletions

View File

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
import os
from shutil import copyfile
from PyKDE4.kdecore import *
import os
@ -10,16 +10,19 @@ class Util():
def __init__(self, applet):
self.applet = applet
def createDirectory(self, name):
if not os.path.isdir(name):
try:
os.mkdir(name)
except:
print 'Failed to create directory: ' + name
def kdeHome(self):
return unicode(KGlobal.dirs().localkdedir())
def createNotifyrc(self):
print '[%s] creating notifyrc' % (self.applet._name)
self.createDirectory(self.kdeHome() + 'share/apps/%s' % self.applet._name)
@ -28,9 +31,10 @@ class Util():
destination = self.kdeHome() + 'share/apps/%s/%s.notifyrc' % (self.applet._name, self.applet._name)
copyfile(source, destination)
def createConfig(self):
self.createDirectory(self.kdeHome() + 'share/apps/%s' % self.applet._name)
source = self.applet.package().path() + 'contents/misc/%s.ini' % self.applet._name
destination = self.kdeHome() + 'share/apps/%s/%s.ini' % (self.applet._name, self.applet._name)
copyfile(source, destination)
copyfile(source, destination)