Drop python2 support.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/6/head
Slávek Banko 2 years ago
parent fb00dc9e43
commit 26d55d4aba
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -68,13 +68,14 @@ import os
import sys import sys
import re import re
import string import string
from functools import reduce
try: try:
APP_ID = sys.argv[1] APP_ID = sys.argv[1]
IRC_SERVER = sys.argv[2] IRC_SERVER = sys.argv[2]
TARGET = sys.argv[3] TARGET = sys.argv[3]
except IndexError: 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) sys.exit(0)
if (sys.hexversion >> 16) < 0x0204: if (sys.hexversion >> 16) < 0x0204:
@ -137,7 +138,7 @@ class Player(object):
#Update args last to prevent non-sensical override in formatVariables #Update args last to prevent non-sensical override in formatVariables
x={'title':title, 'artist':artist, 'album':album} x={'title':title, 'artist':artist, 'album':album}
if FIXUP: if FIXUP:
for i,j in x.items(): for i,j in list(x.items()):
if re.search(FIXUP,j): if re.search(FIXUP,j):
x[i]='%s%s%s'%(QUOTE_BEFORE,j,QUOTE_AFTER) x[i]='%s%s%s'%(QUOTE_BEFORE,j,QUOTE_AFTER)
self._format.update(x) 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]) 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]] play=[unsorted.pop(i.lower(),Player("ImproperlySupported")) for i in playerRankings[kind]]
if len(unsorted): if len(unsorted):
play.extend(unsorted.values()) play.extend(list(unsorted.values()))
else: else:
play=[i for i in PLAYERS if i.displayName.lower() == kind] play=[i for i in PLAYERS if i.displayName.lower() == kind]
try: try:

Loading…
Cancel
Save