PluginPrintRemover.py

changeset 51
a18bc7af1151
parent 49
d721d13f5e4e
child 53
359f9805af93
equal deleted inserted replaced
50:e8ea800139c9 51:a18bc7af1151
4 # 4 #
5 5
6 """ 6 """
7 Module implementing the Print Remover plug-in. 7 Module implementing the Print Remover plug-in.
8 """ 8 """
9
10 from __future__ import unicode_literals # __IGNORE_WARNING__
11 9
12 import os 10 import os
13 11
14 from PyQt5.QtCore import QObject, QTranslator, QCoreApplication 12 from PyQt5.QtCore import QObject, QTranslator, QCoreApplication
15 from PyQt5.QtWidgets import QAction, QMenu 13 from PyQt5.QtWidgets import QAction, QMenu
21 # Start-Of-Header 19 # Start-Of-Header
22 name = "Print Remover Plug-in" 20 name = "Print Remover Plug-in"
23 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 21 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
24 autoactivate = True 22 autoactivate = True
25 deactivateable = True 23 deactivateable = True
26 version = "2.2.0" 24 version = "3.0.0"
27 className = "PrintRemoverPlugin" 25 className = "PrintRemoverPlugin"
28 packageName = "PrintRemover" 26 packageName = "PrintRemover"
29 shortDescription = "Remove print() like debug statements." 27 shortDescription = "Remove print() like debug statements."
30 longDescription = \ 28 longDescription = (
31 """This plug-in implements a tool to remove lines starting with""" \ 29 """This plug-in implements a tool to remove lines starting with"""
32 """ a configurable string. This is mostly used to remove print()""" \ 30 """ a configurable string. This is mostly used to remove print()"""
33 """ like debug statements. The match is done after stripping all""" \ 31 """ like debug statements. The match is done after stripping all"""
34 """ whitespace from the beginning of a line. Lines containing the""" \ 32 """ whitespace from the beginning of a line. Lines containing the"""
35 """ string '__NO_REMOVE__' are preserved.""" 33 """ string '__NO_REMOVE__' are preserved."""
34 )
36 needsRestart = False 35 needsRestart = False
37 pyqtApi = 2 36 pyqtApi = 2
38 python2Compatible = True
39 # End-Of-Header 37 # End-Of-Header
40 38
41 error = "" 39 error = ""
42 40
43 printRemoverPluginObject = None 41 printRemoverPluginObject = None
49 47
50 @param configDlg reference to the configuration dialog 48 @param configDlg reference to the configuration dialog
51 @return reference to the configuration page 49 @return reference to the configuration page
52 """ 50 """
53 global printRemoverPluginObject 51 global printRemoverPluginObject
54 from PrintRemover.ConfigurationPage.PrintRemoverPage import \ 52 from PrintRemover.ConfigurationPage.PrintRemoverPage import (
55 PrintRemoverPage 53 PrintRemoverPage
56 page = PrintRemoverPage(printRemoverPluginObject) 54 )
57 return page 55 return PrintRemoverPage(printRemoverPluginObject)
58 56
59 57
60 def getConfigData(): 58 def getConfigData():
61 """ 59 """
62 Module function returning data as required by the configuration dialog. 60 Module function returning data as required by the configuration dialog.
63 61
69 from PyQt5.QtGui import QPalette 67 from PyQt5.QtGui import QPalette
70 palette = e5App().palette() 68 palette = e5App().palette()
71 lightness = palette.color(QPalette.Window).lightness() 69 lightness = palette.color(QPalette.Window).lightness()
72 usesDarkPalette = lightness <= 128 70 usesDarkPalette = lightness <= 128
73 if usesDarkPalette: 71 if usesDarkPalette:
74 iconSuffix = "dark" 72 iconSuffix = "dark"
75 else: 73 else:
76 iconSuffix = "light" 74 iconSuffix = "light"
77 75
78 return { 76 return {
79 "printRemoverPage": [ 77 "printRemoverPage": [

eric ide

mercurial