summarylogtreecommitdiffstats
path: root/ccsm-escape-fix.patch
blob: a1d20492fb7e1b6203f65277f93c15696109d469 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
diff --unified --recursive --text compiz-0.9.14.0/compizconfig/ccsm/ccm/Pages.py compiz-0.9.14.0-new/compizconfig/ccsm/ccm/Pages.py
--- compiz-0.9.14.0/compizconfig/ccsm/ccm/Pages.py	2019-02-16 18:14:41.000000000 +0530
+++ compiz-0.9.14.0-new/compizconfig/ccsm/ccm/Pages.py	2019-11-17 10:36:48.719451182 +0530
@@ -33,7 +33,7 @@
 from ccm.Utils import gtk_process_events, getScreens, Image, PrettyButton, Label, NotFoundBox, GlobalUpdater, CategoryKeyFunc, GroupIndexKeyFunc, PluginKeyFunc, GetSettings, GetAcceleratorName
 from ccm.Widgets import ClearEntry, PluginView, GroupView, SelectorButtons, ScrolledList, Popup, KeyGrabber, AboutDialog, PluginWindow
 
-from cgi import escape as protect_pango_markup
+from html import escape as protect_pango_markup
 
 import os
 
@@ -397,7 +397,7 @@
         for index, n in enumerate(context.Plugins):
             plugin = context.Plugins[n]
             bar.set_fraction((index+1)/float(length))
-            label.set_markup("<i>%s</i>" %protect_pango_markup(plugin.ShortDesc))
+            label.set_markup("<i>%s</i>" %protect_pango_markup(plugin.ShortDesc, quote=False))
             gtk_process_events()
 
             groups = []
@@ -1383,7 +1383,7 @@
         self.VisibleAreas = self.subGroupAreas = []
         self.Label = Gtk.Alignment(xalign=0.0, yalign=0.5)
         self.Label.set_padding(4, 4, 4, 4)
-        label = Gtk.Label(label="<b>%s</b>" % (protect_pango_markup(name or _('General'))))
+        label = Gtk.Label(label="<b>%s</b>" % (protect_pango_markup(name or _('General'), quote=False)))
         label.set_use_markup(True)
         label.set_xalign(0.0)
         self.Label.add(label)
diff --unified --recursive --text compiz-0.9.14.0/compizconfig/ccsm/ccm/Settings.py compiz-0.9.14.0-new/compizconfig/ccsm/ccm/Settings.py
--- compiz-0.9.14.0/compizconfig/ccsm/ccm/Settings.py	2019-02-16 18:14:41.000000000 +0530
+++ compiz-0.9.14.0-new/compizconfig/ccsm/ccm/Settings.py	2019-11-17 10:36:48.719451182 +0530
@@ -29,7 +29,7 @@
 from ccm.Widgets import CellRendererColor, ModifierSelector, SingleEdgeSelector, KeyGrabber, MatchButton, FileButton, ErrorDialog
 from ccm.Utils import Image, ActionImage, SizedButton, GlobalUpdater, PureVirtualError, SettingKeyFunc, EnumSettingKeyFunc, HasOnlyType, GetSettings, GetAcceleratorName
 
-from cgi import escape as protect_pango_markup
+from html import escape as protect_pango_markup
 
 import locale
 import gettext
@@ -110,7 +110,7 @@
             return
 
         label = Gtk.Label()
-        desc = protect_pango_markup (self.Setting.ShortDesc)
+        desc = protect_pango_markup (self.Setting.ShortDesc, quote=False)
         style = "%s"
         if self.Setting.Integrated:
             style = "<i>%s</i>"
@@ -966,7 +966,7 @@
     def HandleDialogText (self, accel):
         name = self.ReorderKeyString (accel)
         if len (accel) != len (name):
-            accel = protect_pango_markup (accel)
+            accel = protect_pango_markup (accel, quote=False)
             ErrorDialog (self.Widget.get_toplevel (),
                          _("\"%s\" is not a valid shortcut") % accel)
             return
@@ -1149,7 +1149,7 @@
 
     def HandleDialogText (self, button):
         def ShowErrorDialog (button):
-            button = protect_pango_markup (button)
+            button = protect_pango_markup (button, quote=False)
             ErrorDialog (self.Widget.get_toplevel (),
                          _("\"%s\" is not a valid button") % button)
         if button.lower ().strip () in ("", "disabled", "none"):
@@ -1330,7 +1330,7 @@
                 valid = False
                 break
         if not valid:
-            mask = protect_pango_markup (mask)
+            mask = protect_pango_markup (mask, quote=False)
             ErrorDialog (self.Widget.get_toplevel (),
                          _("\"%s\" is not a valid edge mask") % mask)
             return
diff --unified --recursive --text compiz-0.9.14.0/compizconfig/ccsm/ccm/Utils.py compiz-0.9.14.0-new/compizconfig/ccsm/ccm/Utils.py
--- compiz-0.9.14.0/compizconfig/ccsm/ccm/Utils.py	2019-02-16 18:14:41.000000000 +0530
+++ compiz-0.9.14.0-new/compizconfig/ccsm/ccm/Utils.py	2019-11-17 10:36:48.719451182 +0530
@@ -27,7 +27,7 @@
 import weakref
 
 from ccm.Constants import ImageNone, ImagePlugin, ImageCategory, ImageThemed, ImageStock, DataDir, IconDir
-from cgi import escape as protect_pango_markup
+from html import escape as protect_pango_markup
 import operator
 
 import locale
@@ -57,7 +57,7 @@
     return Gdk.Screen.get_default().get_number()
 
 def protect_markup_dict (dict_):
-    return dict((k, protect_pango_markup (v)) for (k, v) in dict_.items())
+    return dict((k, protect_pango_markup (v, quote=False)) for (k, v) in dict_.items())
 
 class Image (Gtk.Image):
 
@@ -187,7 +187,7 @@
         box = Gtk.HBox()
         self.Warning = Gtk.Label()
         self.Markup = _("<span size=\"large\"><b>No matches found.</b> </span><span>\n\n Your filter \"<b>%s</b>\" does not match any items.</span>")
-        value = protect_pango_markup(value)
+        value = protect_pango_markup(value, quote=False)
         self.Warning.set_markup(self.Markup % value)
         image = Image("face-surprise", ImageThemed, 48)
             
@@ -196,7 +196,7 @@
         self.add(box)
 
     def update(self, value):
-        value = protect_pango_markup(value)
+        value = protect_pango_markup(value, quote=False)
         self.Warning.set_markup(self.Markup % value)
 
 class IdleSettingsParser:
diff --unified --recursive --text compiz-0.9.14.0/compizconfig/ccsm/ccm/Widgets.py compiz-0.9.14.0-new/compizconfig/ccsm/ccm/Widgets.py
--- compiz-0.9.14.0/compizconfig/ccsm/ccm/Widgets.py	2019-02-16 18:14:41.000000000 +0530
+++ compiz-0.9.14.0-new/compizconfig/ccsm/ccm/Widgets.py	2019-11-17 10:36:48.719451182 +0530
@@ -27,7 +27,7 @@
 from gi.repository import PangoCairo
 from gi.repository import GdkPixbuf
 import cairo
-from cgi import escape as protect_pango_markup
+from html import escape as protect_pango_markup
 from math import pi, sqrt
 import time
 import os
@@ -295,7 +295,7 @@
     def add_item(self, item, callback, markup="%s", image=None, info=None):
         button = Gtk.Button()
         label = Label(wrap=170)
-        text = protect_pango_markup(item)
+        text = protect_pango_markup(item, quote=False)
         label.set_markup(markup % text or _("General"))
         labelBox = Gtk.VBox()
         labelBox.set_spacing(5)