mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-29 14:24:15 +03:00
ts_31_102: Use perror() instead of poutput() for errors
This adds colorization and ensures they go to stderr and not stdout Change-Id: I34b8f974b4ff13002679c4700bdf604db7d7f3cd
This commit is contained in:
@@ -620,9 +620,9 @@ class EF_UServiceTable(TransparentEF):
|
|||||||
if exists != should_exist:
|
if exists != should_exist:
|
||||||
num_problems += 1
|
num_problems += 1
|
||||||
if exists:
|
if exists:
|
||||||
cmd.poutput(" ERROR: File %s is selectable but should not!" % f)
|
cmd.perror(" ERROR: File %s is selectable but should not!" % f)
|
||||||
else:
|
else:
|
||||||
cmd.poutput(" ERROR: File %s is not selectable (%s) but should!" % (f, sw))
|
cmd.perror(" ERROR: File %s is not selectable (%s) but should!" % (f, sw))
|
||||||
finally:
|
finally:
|
||||||
# re-select the EF.UST
|
# re-select the EF.UST
|
||||||
cmd.card._scc.select_file(self.fid)
|
cmd.card._scc.select_file(self.fid)
|
||||||
@@ -655,11 +655,11 @@ class EF_UST(EF_UServiceTable):
|
|||||||
active_services = selected_file.get_active_services(self._cmd)
|
active_services = selected_file.get_active_services(self._cmd)
|
||||||
# Service n°46 can only be declared "available" if service n°45 is declared "available"
|
# Service n°46 can only be declared "available" if service n°45 is declared "available"
|
||||||
if 46 in active_services and not 45 in active_services:
|
if 46 in active_services and not 45 in active_services:
|
||||||
self._cmd.poutput("ERROR: Service 46 available, but it requires Service 45")
|
self._cmd.perror("ERROR: Service 46 available, but it requires Service 45")
|
||||||
num_problems += 1
|
num_problems += 1
|
||||||
# Service n°125 shall only be taken into account if Service n°124 is declared "available"
|
# Service n°125 shall only be taken into account if Service n°124 is declared "available"
|
||||||
if 125 in active_services and not 124 in active_services:
|
if 125 in active_services and not 124 in active_services:
|
||||||
self._cmd.poutput("ERROR: Service 125 is ignored as Service 124 not available")
|
self._cmd.perror("ERROR: Service 125 is ignored as Service 124 not available")
|
||||||
num_problems += 1
|
num_problems += 1
|
||||||
# Service n°95, n°99 and n°115 shall not be declared "available" if an ISIM application is present on the UICC
|
# Service n°95, n°99 and n°115 shall not be declared "available" if an ISIM application is present on the UICC
|
||||||
non_isim_services = [95, 99, 115]
|
non_isim_services = [95, 99, 115]
|
||||||
@@ -667,7 +667,7 @@ class EF_UST(EF_UServiceTable):
|
|||||||
if 'ADF.ISIM' in app_names:
|
if 'ADF.ISIM' in app_names:
|
||||||
for s in non_isim_services:
|
for s in non_isim_services:
|
||||||
if s in active_services:
|
if s in active_services:
|
||||||
self._cmd.poutput("ERROR: Service %u shall not be available as ISIM application is present" % s)
|
self._cmd.perror("ERROR: Service %u shall not be available as ISIM application is present" % s)
|
||||||
num_problems += 1
|
num_problems += 1
|
||||||
self._cmd.poutput("===> %u service / file inconsistencies detected" % num_problems)
|
self._cmd.poutput("===> %u service / file inconsistencies detected" % num_problems)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user