PluginSelectionEncloser.py

changeset 41
e747eb5f3f43
parent 39
401d0bab970d
child 43
135907873e65
equal deleted inserted replaced
40:e534c4399087 41:e747eb5f3f43
4 # 4 #
5 5
6 """ 6 """
7 Module implementing the Selection Encloser plug-in. 7 Module implementing the Selection Encloser plug-in.
8 """ 8 """
9
10 from __future__ import unicode_literals
11 9
12 import os 10 import os
13 import json 11 import json
14 12
15 from PyQt5.QtCore import QObject, QTranslator, QCoreApplication 13 from PyQt5.QtCore import QObject, QTranslator, QCoreApplication
22 # Start-Of-Header 20 # Start-Of-Header
23 name = "Selection Encloser Plug-in" 21 name = "Selection Encloser Plug-in"
24 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 22 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
25 autoactivate = True 23 autoactivate = True
26 deactivateable = True 24 deactivateable = True
27 version = "2.2.0" 25 version = "3.0.0"
28 className = "SelectionEncloserPlugin" 26 className = "SelectionEncloserPlugin"
29 packageName = "SelectionEncloser" 27 packageName = "SelectionEncloser"
30 shortDescription = "Enclose the selection with a string." 28 shortDescription = "Enclose the selection with a string."
31 longDescription = \ 29 longDescription = (
32 """This plug-in implements a tool to enclose the selection of""" \ 30 """This plug-in implements a tool to enclose the selection of"""
33 """ the current editor with a string. The enclosing string is""" \ 31 """ the current editor with a string. The enclosing string is"""
34 """ selectable via a configurable menu hierarchy.""" 32 """ selectable via a configurable menu hierarchy."""
33 )
35 needsRestart = False 34 needsRestart = False
36 pyqtApi = 2 35 pyqtApi = 2
37 python2Compatible = True
38 # End-Of-Header 36 # End-Of-Header
39 37
40 error = "" 38 error = ""
41 39
42 selectionEncloserPluginObject = None 40 selectionEncloserPluginObject = None
48 46
49 @param configDlg reference to the configuration dialog 47 @param configDlg reference to the configuration dialog
50 @return reference to the configuration page 48 @return reference to the configuration page
51 """ 49 """
52 global selectionEncloserPluginObject 50 global selectionEncloserPluginObject
53 from SelectionEncloser.ConfigurationPage.SelectionEncloserPage import \ 51 from SelectionEncloser.ConfigurationPage.SelectionEncloserPage import (
54 SelectionEncloserPage 52 SelectionEncloserPage
55 page = SelectionEncloserPage(selectionEncloserPluginObject) 53 )
56 return page 54 return SelectionEncloserPage(selectionEncloserPluginObject)
57 55
58 56
59 def getConfigData(): 57 def getConfigData():
60 """ 58 """
61 Module function returning data as required by the configuration dialog. 59 Module function returning data as required by the configuration dialog.
68 from PyQt5.QtGui import QPalette 66 from PyQt5.QtGui import QPalette
69 palette = e5App().palette() 67 palette = e5App().palette()
70 lightness = palette.color(QPalette.Window).lightness() 68 lightness = palette.color(QPalette.Window).lightness()
71 usesDarkPalette = lightness <= 128 69 usesDarkPalette = lightness <= 128
72 if usesDarkPalette: 70 if usesDarkPalette:
73 iconSuffix = "dark" 71 iconSuffix = "dark"
74 else: 72 else:
75 iconSuffix = "light" 73 iconSuffix = "light"
76 74
77 return { 75 return {
78 "selectionEncloserPage": [ 76 "selectionEncloserPage": [

eric ide

mercurial