From ddcfc0ab5aa01eb216ef8f441c4e281fb399c391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 14 Jul 2020 11:32:53 +0200 Subject: [PATCH] Fix use of deprecated flask.ext imports flask.ext has been deprecated for years now and has been logging a warning to console ever since. OctoPrint 1.4.1 had to update the flask dependencies due to security considerations and with the new flask version the old compatibility layer still allowing flask.ext to work got removed. See also the discussion in OctoPrint/OctoPrint#3638 Closes #269 --- octoprint_telegram/__init__.py | 4 ++-- octoprint_telegram/telegramCommands.py | 2 +- octoprint_telegram/telegramNotifications.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/octoprint_telegram/__init__.py b/octoprint_telegram/__init__.py index d4c02a8..4cefc92 100644 --- a/octoprint_telegram/__init__.py +++ b/octoprint_telegram/__init__.py @@ -3,8 +3,8 @@ from subprocess import Popen, PIPE import threading, requests, re, time, datetime, StringIO, json, random, logging, traceback, io, collections, os, flask,base64,PIL, pkg_resources,subprocess,zipfile,glob #,resource import octoprint.plugin, octoprint.util, octoprint.filemanager -from flask.ext.babel import gettext -from flask.ext.login import current_user +from flask_babel import gettext +from flask_login import current_user from .telegramCommands import TCMD # telegramCommands. from .telegramNotifications import TMSG # telegramNotifications from .telegramNotifications import telegramMsgDict # dict of known notification messages diff --git a/octoprint_telegram/telegramCommands.py b/octoprint_telegram/telegramCommands.py index c8ee65e..6d9a004 100644 --- a/octoprint_telegram/telegramCommands.py +++ b/octoprint_telegram/telegramCommands.py @@ -2,7 +2,7 @@ import logging, sarge, hashlib, datetime, time, operator, socket import octoprint.filemanager import requests -from flask.ext.babel import gettext +from flask_babel import gettext from .telegramNotifications import telegramMsgDict ################################################################################################################ diff --git a/octoprint_telegram/telegramNotifications.py b/octoprint_telegram/telegramNotifications.py index af75a35..bf07301 100644 --- a/octoprint_telegram/telegramNotifications.py +++ b/octoprint_telegram/telegramNotifications.py @@ -1,7 +1,7 @@ from __future__ import absolute_import import time, datetime, logging import octoprint.util -from flask.ext.babel import gettext +from flask_babel import gettext ################################################################################################### # Here you find the known notification messages and their handles.