laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/42081?usp=email )
Change subject: pySim.esim.saip.personalization: Fix docstring errors + warnings ......................................................................
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 --- M pySim/esim/saip/personalization.py 1 file changed, 27 insertions(+), 26 deletions(-)
Approvals: fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified
diff --git a/pySim/esim/saip/personalization.py b/pySim/esim/saip/personalization.py index c61675f..8bf9a70 100644 --- a/pySim/esim/saip/personalization.py +++ b/pySim/esim/saip/personalization.py @@ -69,40 +69,41 @@
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").