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:
|
||||
|
||||
1) use a ConfigurableParameter instance, with .input_value and .value state:
|
||||
1) use a ConfigurableParameter instance, with .input_value and .value state::
|
||||
|
||||
iccid = Iccid()
|
||||
try:
|
||||
iccid.input_value = '123456789012345678'
|
||||
iccid.validate()
|
||||
except ValueError:
|
||||
print(f"failed to validate {iccid.name} == {iccid.input_value}")
|
||||
iccid = Iccid()
|
||||
try:
|
||||
iccid.input_value = '123456789012345678'
|
||||
iccid.validate()
|
||||
except ValueError:
|
||||
print(f"failed to validate {iccid.name} == {iccid.input_value}")
|
||||
|
||||
pes = ProfileElementSequence.from_der(der_data_from_file)
|
||||
try:
|
||||
iccid.apply(pes)
|
||||
except ValueError:
|
||||
print(f"failed to apply {iccid.name} := {iccid.input_value}")
|
||||
pes = ProfileElementSequence.from_der(der_data_from_file)
|
||||
try:
|
||||
iccid.apply(pes)
|
||||
except ValueError:
|
||||
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
|
||||
input_val = '123456789012345678'
|
||||
cls = Iccid
|
||||
input_val = '123456789012345678'
|
||||
|
||||
try:
|
||||
clean_val = cls.validate_val(input_val)
|
||||
except ValueError:
|
||||
print(f"failed to validate {cls.get_name()} = {input_val}")
|
||||
try:
|
||||
clean_val = cls.validate_val(input_val)
|
||||
except ValueError:
|
||||
print(f"failed to validate {cls.get_name()} = {input_val}")
|
||||
|
||||
pes = ProfileElementSequence.from_der(der_data_from_file)
|
||||
try:
|
||||
cls.apply_val(pes, clean_val)
|
||||
except ValueError:
|
||||
print(f"failed to apply {cls.get_name()} = {input_val}")
|
||||
pes = ProfileElementSequence.from_der(der_data_from_file)
|
||||
try:
|
||||
cls.apply_val(pes, clean_val)
|
||||
except ValueError:
|
||||
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").
|
||||
|
||||
Reference in New Issue
Block a user