pySim.esim.saip: maintain a parsed fileystem hierarchy

With this change, the ProfileElementSequence object will maintain a
representation of the filesystem hierarchy of the eSIM profile.  Every
file that is added by a ProfileElement will add a FsNode into that tree,
and each FsNode will point to the File object for the respective file.

This allows us to find files by their path, as well as add files by
path.

Change-Id: I2caadc24b1087855f23f3c57cdf8dabbf81757c0
This commit is contained in:
Harald Welte
2024-08-17 10:16:58 +02:00
committed by laforge
parent 5e2b93eb55
commit c6f8457ff1
2 changed files with 633 additions and 76 deletions

View File

@@ -20,7 +20,7 @@ import sys
import argparse
import logging
import zipfile
from pathlib import Path
from pathlib import Path as PlPath
from typing import List
from pySim.esim.saip import *
@@ -66,7 +66,7 @@ parser_eapp.add_argument('--format', default='cap', choices=['ijc', 'cap'], help
def do_split(pes: ProfileElementSequence, opts):
i = 0
for pe in pes.pe_list:
basename = Path(opts.INPUT_UPP).stem
basename = PlPath(opts.INPUT_UPP).stem
if not pe.identification:
fname = '%s-%02u-%s.der' % (basename, i, pe.type)
else: