Backwards compatibility py2.6: replace etree iter

- Make python 2.6 compatible: replace iter() with findall()
This commit is contained in:
tomkat83 2016-04-09 16:26:08 +02:00
parent 1c68668eba
commit e53afe3fb9

View file

@ -572,7 +572,7 @@ class PlexAPI():
queue = Queue.Queue() queue = Queue.Queue()
threads = [] threads = []
for Dir in xml.iter(tag='Device'): for Dir in xml.findall('Device'):
if "server" in Dir.get('provides'): if "server" in Dir.get('provides'):
if Dir.find('Connection') is None: if Dir.find('Connection') is None:
# no valid connection - skip # no valid connection - skip
@ -599,7 +599,7 @@ class PlexAPI():
# If PMS seems (!!) local, try a local connection first # If PMS seems (!!) local, try a local connection first
# Backup to remote connection, if that failes # Backup to remote connection, if that failes
PMS['baseURL'] = '' PMS['baseURL'] = ''
for Con in Dir.iter(tag='Connection'): for Con in Dir.findall('Connection'):
localConn = Con.get('local') localConn = Con.get('local')
if ((PMS['local'] == '1' and localConn == '1') or if ((PMS['local'] == '1' and localConn == '1') or
(PMS['local'] == '0' and localConn == '0')): (PMS['local'] == '0' and localConn == '0')):