mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 23:47:20 +00:00
removed util.py
removed createNotifyrc function
This commit is contained in:
parent
b1f8340774
commit
fe580ef806
@ -7,6 +7,8 @@ Ver.1.10.0:
|
|||||||
+ added error checking of DataEngine variables
|
+ added error checking of DataEngine variables
|
||||||
+ added Brazillian Portuguese translation (@underr)
|
+ added Brazillian Portuguese translation (@underr)
|
||||||
+ added Ukrainian translation (Виктор Слободян)
|
+ added Ukrainian translation (Виктор Слободян)
|
||||||
|
- removed util.py
|
||||||
|
- removed createNotifyrc since it isn't needed
|
||||||
* refactoring of configuration interface
|
* refactoring of configuration interface
|
||||||
* player settings was moved from plasmoid to dataengine
|
* player settings was moved from plasmoid to dataengine
|
||||||
* edited readme call
|
* edited readme call
|
||||||
@ -16,8 +18,8 @@ Ver.1.9.0:
|
|||||||
+ added support of several custom commands ($customN)
|
+ added support of several custom commands ($customN)
|
||||||
+ added hdd speed label ($hddrN, $hddwN)
|
+ added hdd speed label ($hddrN, $hddwN)
|
||||||
+ added actions to context menu (open readme and run ksysguard)
|
+ added actions to context menu (open readme and run ksysguard)
|
||||||
* fix parsing pkg label
|
|
||||||
- removed doubleclick event
|
- removed doubleclick event
|
||||||
|
* fix parsing pkg label
|
||||||
|
|
||||||
Ver.1.8.3:
|
Ver.1.8.3:
|
||||||
+ added Spanish translation (thanks to Ernesto Avilés Vzqz)
|
+ added Spanish translation (thanks to Ernesto Avilés Vzqz)
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
+ добавлена проверка ошибок для переменных DataEngine
|
+ добавлена проверка ошибок для переменных DataEngine
|
||||||
+ добавлен перевод Brazillian Portuguese (@underr)
|
+ добавлен перевод Brazillian Portuguese (@underr)
|
||||||
+ добавлена украинская локализация (Виктор Слободян)
|
+ добавлена украинская локализация (Виктор Слободян)
|
||||||
|
- удален util.py
|
||||||
|
- удалены функции createNotifyrc, поскольку они больше не нужны
|
||||||
* рефакторинг конфигурационного интерфейса
|
* рефакторинг конфигурационного интерфейса
|
||||||
* настройки плеера были перенесены из виджета в dataengine
|
* настройки плеера были перенесены из виджета в dataengine
|
||||||
* исправлен вызов readme под четырехсимвольное обозначение
|
* исправлен вызов readme под четырехсимвольное обозначение
|
||||||
|
@ -12,10 +12,11 @@ add_subdirectory (po)
|
|||||||
|
|
||||||
# set sources
|
# set sources
|
||||||
set (SUBPROJECT_CODE_DIR "contents/code")
|
set (SUBPROJECT_CODE_DIR "contents/code")
|
||||||
|
set (SUBPROJECT_MISC_DIR "contents/misc")
|
||||||
set (SUBPROJECT_UI_DIR "contents/ui")
|
set (SUBPROJECT_UI_DIR "contents/ui")
|
||||||
file (GLOB SUBPROJECT_DESKTOP_IN *.desktop)
|
file (GLOB SUBPROJECT_DESKTOP_IN *.desktop)
|
||||||
file (RELATIVE_PATH SUBPROJECT_DESKTOP ${CMAKE_SOURCE_DIR} ${SUBPROJECT_DESKTOP_IN})
|
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_SOURCE ${SUBPROJECT_CODE_DIR}/*.py)
|
||||||
file (GLOB SUBPROJECT_UI ${SUBPROJECT_UI_DIR}/*.ui)
|
file (GLOB SUBPROJECT_UI ${SUBPROJECT_UI_DIR}/*.ui)
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@
|
|||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
from util import *
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Config():
|
class Config():
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/python2
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
@ -37,7 +36,7 @@ import reinit
|
|||||||
import tooltip
|
import tooltip
|
||||||
import tooltipconfig
|
import tooltipconfig
|
||||||
import widget
|
import widget
|
||||||
from util import *
|
|
||||||
|
|
||||||
|
|
||||||
def getTemp(temp, unit):
|
def getTemp(temp, unit):
|
||||||
@ -77,7 +76,6 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
# initialization
|
# initialization
|
||||||
def init(self):
|
def init(self):
|
||||||
"""function to initializate widget"""
|
"""function to initializate widget"""
|
||||||
self._name = str(self.package().metadata().pluginName())
|
|
||||||
self.setupVar()
|
self.setupVar()
|
||||||
|
|
||||||
self.dataengine = dataengine.DataEngine(self)
|
self.dataengine = dataengine.DataEngine(self)
|
||||||
@ -95,11 +93,6 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
self.setBackgroundHints(Plasma.Applet.DefaultBackground)
|
self.setBackgroundHints(Plasma.Applet.DefaultBackground)
|
||||||
|
|
||||||
self.setHasConfigurationInterface(True)
|
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
|
# actions
|
||||||
self.createActions()
|
self.createActions()
|
||||||
@ -180,14 +173,6 @@ class pyTextWidget(plasmascript.Applet):
|
|||||||
confdef.createConfigurationInterface(parent)
|
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):
|
def initTooltip(self):
|
||||||
"""function to create tooltip"""
|
"""function to create tooltip"""
|
||||||
self.tooltip = Plasma.ToolTipContent()
|
self.tooltip = Plasma.ToolTipContent()
|
||||||
|
@ -1,56 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
############################################################################
|
|
||||||
# Copyright 2012 Alex Oleshkevich <alex.oleshkevich@gmail.com> #
|
|
||||||
# #
|
|
||||||
# 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)
|
|
Loading…
Reference in New Issue
Block a user