mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-16 18:38:32 +03:00
pySim.esim.saip.personalization: Fix docstring errors + warnings
pysim/pySim/esim/saip/personalization.py:docstring of pySim.esim.saip.personalization.ConfigurableParameter:27: ERROR: Unexpected indentation. [docutils] pysim/pySim/esim/saip/personalization.py:docstring of pySim.esim.saip.personalization.ConfigurableParameter:29: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils] pysim/pySim/esim/saip/personalization.py:docstring of pySim.esim.saip.personalization.ConfigurableParameter:34: ERROR: Unexpected indentation. [docutils] pysim/pySim/esim/saip/personalization.py:docstring of pySim.esim.saip.personalization.ConfigurableParameter:35: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils] pysim/pySim/esim/saip/personalization.py:docstring of pySim.esim.saip.personalization.ConfigurableParameter:52: ERROR: Unexpected indentation. [docutils] pysim/pySim/esim/saip/personalization.py:docstring of pySim.esim.saip.personalization.ConfigurableParameter:53: WARNING: Block quote ends without a blank line; unexpected unindent. [docutils] Change-Id: I3918308856c3a1a5e6e90561c3e2a6b88040670d
This commit is contained in:
@@ -69,40 +69,41 @@ class ConfigurableParameter(abc.ABC, metaclass=ClassVarMeta):
|
|||||||
|
|
||||||
Usage examples, by example of Iccid:
|
Usage examples, by example of Iccid:
|
||||||
|
|
||||||
1) use a ConfigurableParameter instance, with .input_value and .value state:
|
1) use a ConfigurableParameter instance, with .input_value and .value state::
|
||||||
|
|
||||||
iccid = Iccid()
|
iccid = Iccid()
|
||||||
try:
|
try:
|
||||||
iccid.input_value = '123456789012345678'
|
iccid.input_value = '123456789012345678'
|
||||||
iccid.validate()
|
iccid.validate()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print(f"failed to validate {iccid.name} == {iccid.input_value}")
|
print(f"failed to validate {iccid.name} == {iccid.input_value}")
|
||||||
|
|
||||||
pes = ProfileElementSequence.from_der(der_data_from_file)
|
pes = ProfileElementSequence.from_der(der_data_from_file)
|
||||||
try:
|
try:
|
||||||
iccid.apply(pes)
|
iccid.apply(pes)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print(f"failed to apply {iccid.name} := {iccid.input_value}")
|
print(f"failed to apply {iccid.name} := {iccid.input_value}")
|
||||||
|
|
||||||
changed_der = pes.to_der()
|
changed_der = pes.to_der()
|
||||||
|
|
||||||
2) use a ConfigurableParameter class, without state:
|
2) use a ConfigurableParameter class, without state::
|
||||||
|
|
||||||
cls = Iccid
|
cls = Iccid
|
||||||
input_val = '123456789012345678'
|
input_val = '123456789012345678'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
clean_val = cls.validate_val(input_val)
|
clean_val = cls.validate_val(input_val)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print(f"failed to validate {cls.get_name()} = {input_val}")
|
print(f"failed to validate {cls.get_name()} = {input_val}")
|
||||||
|
|
||||||
pes = ProfileElementSequence.from_der(der_data_from_file)
|
pes = ProfileElementSequence.from_der(der_data_from_file)
|
||||||
try:
|
try:
|
||||||
cls.apply_val(pes, clean_val)
|
cls.apply_val(pes, clean_val)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print(f"failed to apply {cls.get_name()} = {input_val}")
|
print(f"failed to apply {cls.get_name()} = {input_val}")
|
||||||
|
|
||||||
|
changed_der = pes.to_der()
|
||||||
|
|
||||||
changed_der = pes.to_der()
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# A subclass can set an explicit string as name (like name = "PIN1").
|
# A subclass can set an explicit string as name (like name = "PIN1").
|
||||||
|
|||||||
Reference in New Issue
Block a user