diff options
author | Sam Tygier <[email protected]> | 2019-05-14 20:00:59 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-06-12 15:26:43 +0200 |
commit | 0b14be3a52aed75e2078cd973cf58ab65d31e851 (patch) | |
tree | 2ea0ad26262a57ffe0414ede13828e70baf95f9e /Mozo | |
parent | cf3507d505ce4c2d00f82a3a16005834379c70c5 (diff) | |
download | mozo-0b14be3a52aed75e2078cd973cf58ab65d31e851.tar.bz2 mozo-0b14be3a52aed75e2078cd973cf58ab65d31e851.tar.xz |
Fix DeprecationWarning: cgi.escape is deprecated
As per note at:
https://docs.python.org/3.2/library/cgi.html#cgi.escape
Diffstat (limited to 'Mozo')
-rw-r--r-- | Mozo/MainWindow.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Mozo/MainWindow.py b/Mozo/MainWindow.py index 01639b9..6b92227 100644 --- a/Mozo/MainWindow.py +++ b/Mozo/MainWindow.py @@ -23,7 +23,7 @@ gi.require_version('MateMenu', '2.0') from gi.repository import GLib, Gio from gi.repository import Gtk, Gdk, GdkPixbuf from gi.repository import MateMenu -import cgi +import html import os import gettext import subprocess @@ -238,13 +238,13 @@ class MainWindow: def loadMenu(self, iters, parent, depth=0): if depth == 0: icon = util.getIcon(parent) - iters[depth] = self.menu_store.append(None, (icon, cgi.escape(parent.get_name()), parent)) + iters[depth] = self.menu_store.append(None, (icon, html.escape(parent.get_name()), parent)) depth += 1 for menu, show in self.editor.getMenus(parent): if show: - name = cgi.escape(menu.get_name()) + name = html.escape(menu.get_name()) else: - name = '<small><i>' + cgi.escape(menu.get_name()) + '</i></small>' + name = '<small><i>' + html.escape(menu.get_name()) + '</i></small>' icon = util.getIcon(menu) iters[depth] = self.menu_store.append(iters[depth-1], (icon, name, menu)) self.loadMenu(iters, menu, depth) @@ -258,14 +258,14 @@ class MainWindow: name = '---' elif isinstance(item, MateMenu.TreeEntry): if show: - name = cgi.escape(item.get_app_info().get_display_name()) + name = html.escape(item.get_app_info().get_display_name()) else: - name = '<small><i>' + cgi.escape(item.get_app_info().get_display_name()) + '</i></small>' + name = '<small><i>' + html.escape(item.get_app_info().get_display_name()) + '</i></small>' else: if show: - name = cgi.escape(item.get_name()) + name = html.escape(item.get_name()) else: - name = '<small><i>' + cgi.escape(item.get_name()) + '</i></small>' + name = '<small><i>' + html.escape(item.get_name()) + '</i></small>' self.item_store.append((show, icon, name, item)) #this is a little timeout callback to insert new items after |