# HG changeset patch # User Sebastien Jodogne # Date 1706697397 -3600 # Node ID a8e49d30f6347163089d0612303da7694fbb133c # Parent ba06331ac8dd618a8832f27e1384e870118fe718 compatibility of Plugins/Worklists/Run.py with python 3 diff -r ba06331ac8dd -r a8e49d30f634 Plugins/Worklists/Run.py --- a/Plugins/Worklists/Run.py Wed Jan 24 13:23:29 2024 +0100 +++ b/Plugins/Worklists/Run.py Wed Jan 31 11:36:37 2024 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # -*- coding: utf-8 -*- @@ -114,7 +114,9 @@ args.server, str(args.dicom), f.name ], stderr = subprocess.STDOUT).splitlines() - if len(filter(lambda x: x.startswith('E:'), a)) > 0: + a = list(map(lambda x: x.decode('utf-8', errors="ignore"), a)) + + if len(list(filter(lambda x: x.startswith('E:'), a))) > 0: raise Exception('Error while running findscu') b = map(lambda x: x[3:], filter(lambda x: (x.startswith('I: ---') or @@ -294,7 +296,7 @@ AddToDatabase('Encodings/database.dump') - for name, encoding in ENCODINGS.iteritems(): + for (name, encoding) in ENCODINGS.items(): self.assertEqual(name, DoPut(ORTHANC, '/tools/default-encoding', name)) result = RunQuery('Encodings/query.dump', [])