From 0b14be3a52aed75e2078cd973cf58ab65d31e851 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Tue, 14 May 2019 20:00:59 +0100 Subject: Fix DeprecationWarning: cgi.escape is deprecated As per note at: https://docs.python.org/3.2/library/cgi.html#cgi.escape --- Mozo/MainWindow.py | 16 ++++++++-------- 1 file 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 = '' + cgi.escape(menu.get_name()) + '' + name = '' + html.escape(menu.get_name()) + '' 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 = '' + cgi.escape(item.get_app_info().get_display_name()) + '' + name = '' + html.escape(item.get_app_info().get_display_name()) + '' else: if show: - name = cgi.escape(item.get_name()) + name = html.escape(item.get_name()) else: - name = '' + cgi.escape(item.get_name()) + '' + name = '' + html.escape(item.get_name()) + '' self.item_store.append((show, icon, name, item)) #this is a little timeout callback to insert new items after -- cgit v1.2.1