diff --git a/CHANGELOG b/CHANGELOG index cee81c3..488dc92 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,8 @@ Ver.1.10.0: + added error checking of DataEngine variables + added Brazillian Portuguese translation (@underr) + added Ukrainian translation (Виктор Слободян) +- removed util.py +- removed createNotifyrc since it isn't needed * refactoring of configuration interface * player settings was moved from plasmoid to dataengine * edited readme call @@ -16,8 +18,8 @@ Ver.1.9.0: + added support of several custom commands ($customN) + added hdd speed label ($hddrN, $hddwN) + added actions to context menu (open readme and run ksysguard) -* fix parsing pkg label - removed doubleclick event +* fix parsing pkg label Ver.1.8.3: + added Spanish translation (thanks to Ernesto Avilés Vzqz) diff --git a/CHANGELOG-RU b/CHANGELOG-RU index 468f977..7b29485 100644 --- a/CHANGELOG-RU +++ b/CHANGELOG-RU @@ -7,6 +7,8 @@ + добавлена проверка ошибок для переменных DataEngine + добавлен перевод Brazillian Portuguese (@underr) + добавлена украинская локализация (Виктор Слободян) +- удален util.py +- удалены функции createNotifyrc, поскольку они больше не нужны * рефакторинг конфигурационного интерфейса * настройки плеера были перенесены из виджета в dataengine * исправлен вызов readme под четырехсимвольное обозначение diff --git a/sources/ptm/CMakeLists.txt b/sources/ptm/CMakeLists.txt index 32d6023..06970a0 100644 --- a/sources/ptm/CMakeLists.txt +++ b/sources/ptm/CMakeLists.txt @@ -12,10 +12,11 @@ add_subdirectory (po) # set sources set (SUBPROJECT_CODE_DIR "contents/code") +set (SUBPROJECT_MISC_DIR "contents/misc") set (SUBPROJECT_UI_DIR "contents/ui") file (GLOB SUBPROJECT_DESKTOP_IN *.desktop) file (RELATIVE_PATH SUBPROJECT_DESKTOP ${CMAKE_SOURCE_DIR} ${SUBPROJECT_DESKTOP_IN}) -file (GLOB SUBPROJECT_NOTIFY *.notifyrc) +file (GLOB SUBPROJECT_NOTIFY ${SUBPROJECT_MISC_DIR}/*.notifyrc) file (GLOB SUBPROJECT_SOURCE ${SUBPROJECT_CODE_DIR}/*.py) file (GLOB SUBPROJECT_UI ${SUBPROJECT_UI_DIR}/*.ui) diff --git a/sources/ptm/contents/code/config.py b/sources/ptm/contents/code/config.py index 189f088..9ae47c5 100644 --- a/sources/ptm/contents/code/config.py +++ b/sources/ptm/contents/code/config.py @@ -18,8 +18,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # ############################################################################ -from util import * - class Config(): diff --git a/sources/ptm/contents/code/main.py b/sources/ptm/contents/code/main.py index eba18aa..4c087d4 100644 --- a/sources/ptm/contents/code/main.py +++ b/sources/ptm/contents/code/main.py @@ -1,4 +1,3 @@ -#!/usr/bin/python2 # -*- coding: utf-8 -*- ############################################################################ @@ -37,7 +36,7 @@ import reinit import tooltip import tooltipconfig import widget -from util import * + def getTemp(temp, unit): @@ -77,7 +76,6 @@ class pyTextWidget(plasmascript.Applet): # initialization def init(self): """function to initializate widget""" - self._name = str(self.package().metadata().pluginName()) self.setupVar() self.dataengine = dataengine.DataEngine(self) @@ -95,11 +93,6 @@ class pyTextWidget(plasmascript.Applet): self.setBackgroundHints(Plasma.Applet.DefaultBackground) self.setHasConfigurationInterface(True) - # create notifyrc file if required - kdehome = unicode(KGlobal.dirs().localkdedir()) - if ((not os.path.exists(kdehome + "/share/apps/plasma_applet_pytextmonitor/plasma_applet_pytextmonitor.notifyrc")) and - (not os.path.exists("/usr" + "/share/apps/plasma_applet_pytextmonitor/plasma_applet_pytextmonitor.notifyrc"))): - self.createNotifyrc(kdehome) # actions self.createActions() @@ -180,14 +173,6 @@ class pyTextWidget(plasmascript.Applet): confdef.createConfigurationInterface(parent) - def createNotifyrc(self, kdehome): - """function to create *.notifyrc""" - if (not os.path.isdir(kdehome + "/share/apps/plasma_applet_pytextmonitor")): - os.mkdir(kdehome + "/share/apps/plasma_applet_pytextmonitor") - shutil.copy(kdehome + "/share/apps/plasma/plasmoids/py-text-monitor/contents/code/plasma_applet_pytextmonitor.notifyrc", - kdehome + "/share/apps/plasma_applet_pytextmonitor/") - - def initTooltip(self): """function to create tooltip""" self.tooltip = Plasma.ToolTipContent() diff --git a/sources/ptm/contents/code/util.py b/sources/ptm/contents/code/util.py deleted file mode 100644 index 842a53d..0000000 --- a/sources/ptm/contents/code/util.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- - -############################################################################ -# Copyright 2012 Alex Oleshkevich # -# # -# This program is free software; you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation; either version 2 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License along # -# with this program; if not, write to the Free Software Foundation, Inc., # -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -############################################################################ - -from shutil import copyfile -from PyKDE4.kdecore import * -import os - - - -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) - source = self.applet.package().path() + 'contents/misc/%s.notifyrc' % self.applet._name - 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) diff --git a/sources/ptm/plasma_applet_pytextmonitor.notifyrc b/sources/ptm/contents/misc/plasma_applet_pytextmonitor.notifyrc similarity index 100% rename from sources/ptm/plasma_applet_pytextmonitor.notifyrc rename to sources/ptm/contents/misc/plasma_applet_pytextmonitor.notifyrc