Guest User

ccsm-escape-fix.patch

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