From 26d55d4aba1e4cab18567fef65bc78099d764c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Wed, 18 Jan 2023 09:00:25 +0100 Subject: Drop python2 support. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- konversation/scripts/media | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/konversation/scripts/media b/konversation/scripts/media index e369262..dcfc7d3 100755 --- a/konversation/scripts/media +++ b/konversation/scripts/media @@ -68,13 +68,14 @@ import os import sys import re import string +from functools import reduce try: APP_ID = sys.argv[1] IRC_SERVER = sys.argv[2] TARGET = sys.argv[3] except IndexError: - print >>sys.stderr, "This script is intended to be run from within Konversation." + print("This script is intended to be run from within Konversation.", file=sys.stderr) sys.exit(0) if (sys.hexversion >> 16) < 0x0204: @@ -137,7 +138,7 @@ class Player(object): #Update args last to prevent non-sensical override in formatVariables x={'title':title, 'artist':artist, 'album':album} if FIXUP: - for i,j in x.items(): + for i,j in list(x.items()): if re.search(FIXUP,j): x[i]='%s%s%s'%(QUOTE_BEFORE,j,QUOTE_AFTER) self._format.update(x) @@ -408,7 +409,7 @@ def run(kind): unsorted=dict([(i.displayName.lower(),i) for i in PLAYERS if kind in i.type]) play=[unsorted.pop(i.lower(),Player("ImproperlySupported")) for i in playerRankings[kind]] if len(unsorted): - play.extend(unsorted.values()) + play.extend(list(unsorted.values())) else: play=[i for i in PLAYERS if i.displayName.lower() == kind] try: -- cgit v1.2.1