mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fatfsparse.py: enable automatic detection of lfn
This commit is contained in:
parent
892437d829
commit
72acbeb921
@ -55,9 +55,8 @@ def traverse_folder_tree(directory_bytes_: bytes,
|
||||
try:
|
||||
obj_: dict = Entry.ENTRY_FORMAT_SHORT_NAME.parse(
|
||||
directory_bytes_[obj_address_: obj_address_ + FATDefaults.ENTRY_SIZE])
|
||||
except (construct.core.ConstError, UnicodeDecodeError) as e:
|
||||
if not args.long_name_support:
|
||||
raise e
|
||||
except (construct.core.ConstError, UnicodeDecodeError):
|
||||
args.long_name_support = True
|
||||
continue
|
||||
|
||||
if obj_['DIR_Attr'] == 0: # empty entry
|
||||
@ -90,7 +89,7 @@ if __name__ == '__main__':
|
||||
help='Path to the image that will be parsed and extracted.')
|
||||
argument_parser.add_argument('--long-name-support',
|
||||
action='store_true',
|
||||
help='Set flag to enable long names support.')
|
||||
help=argparse.SUPPRESS)
|
||||
|
||||
argument_parser.add_argument('--wear-leveling',
|
||||
action='store_true',
|
||||
|
@ -320,7 +320,7 @@ class FatFSGen(unittest.TestCase):
|
||||
f'{os.path.join(os.path.dirname(__file__), "..", "fatfsgen.py")}',
|
||||
'testf', '--long_name_support'
|
||||
], stderr=STDOUT)
|
||||
run(['python', '../fatfsparse.py', 'fatfs_image.img', '--long-name-support'], stderr=STDOUT)
|
||||
run(['python', '../fatfsparse.py', 'fatfs_image.img'], stderr=STDOUT)
|
||||
assert compare_folders('testf', 'Espressif')
|
||||
|
||||
|
||||
|
@ -144,4 +144,4 @@ It is a reverse tool of (:component_file:`fatfsgen.py<fatfs/fatfsgen.py>`), i.e.
|
||||
|
||||
Usage::
|
||||
|
||||
./fatfsparse.py [-h] [--long-name-support] [--wear-leveling] fatfs_image.img
|
||||
./fatfsparse.py [-h] [--wear-leveling] fatfs_image.img
|
||||
|
@ -144,4 +144,4 @@ FatFs 分区分析器
|
||||
|
||||
您可以使用::
|
||||
|
||||
./fatfsparse.py [-h] [--long-name-support] [--wear-leveling] fatfs_image.img
|
||||
./fatfsparse.py [-h] [--wear-leveling] fatfs_image.img
|
||||
|
Loading…
Reference in New Issue
Block a user