@@ -304,15 +304,15 @@ def decode_unicode_escape(value):
304304 # Loop through all sections
305305 for section in config .sections ():
306306 required_keys = [
307- "len" , "hex" , "ver" , "name" , "lower" ,
307+ "len" , "hex" , "ver" , "name" ,
308308 "magic" , "delimiter" , "extension" ,
309309 "newstyle" , "advancedlist" , "altinode"
310310 ]
311- if all (key in config [section ] for key in required_keys ):
311+ if section != "config" and all (key in config [section ] for key in required_keys ):
312312 delim = decode_unicode_escape (config .get (section , 'delimiter' ))
313313 if (not is_only_nonprintable (delim )):
314314 delim = "\x00 " * len ("\x00 " )
315- __file_format_multi_dict__ .update ( { decode_unicode_escape (config .get (section , 'magic' )): {'format_name' : decode_unicode_escape (config .get (section , 'name' )), 'format_magic' : decode_unicode_escape (config .get (section , 'magic' )), 'format_lower' : decode_unicode_escape ( config . get ( section , 'lower' )), ' format_len' : config .getint (section , 'len' ), 'format_hex' : config .get (section , 'hex' ), 'format_delimiter' : delim , 'format_ver' : config .get (section , 'ver' ), 'new_style' : config .getboolean (section , 'newstyle' ), 'use_advanced_list' : config .getboolean (section , 'advancedlist' ), 'use_alt_inode' : config .getboolean (section , 'altinode' ), 'format_extension' : decode_unicode_escape (config .get (section , 'extension' )) } } )
315+ __file_format_multi_dict__ .update ( { decode_unicode_escape (config .get (section , 'magic' )): {'format_name' : decode_unicode_escape (config .get (section , 'name' )), 'format_magic' : decode_unicode_escape (config .get (section , 'magic' )), 'format_len' : config .getint (section , 'len' ), 'format_hex' : config .get (section , 'hex' ), 'format_delimiter' : delim , 'format_ver' : config .get (section , 'ver' ), 'new_style' : config .getboolean (section , 'newstyle' ), 'use_advanced_list' : config .getboolean (section , 'advancedlist' ), 'use_alt_inode' : config .getboolean (section , 'altinode' ), 'format_extension' : decode_unicode_escape (config .get (section , 'extension' )) } } )
316316 if not __file_format_multi_dict__ and not __include_defaults__ :
317317 __include_defaults__ = True
318318elif __use_ini_file__ and not os .path .exists (__config_file__ ):
@@ -322,11 +322,10 @@ def decode_unicode_escape(value):
322322 __include_defaults__ = True
323323if (__include_defaults__ ):
324324 if ("ArchiveFile" not in __file_format_multi_dict__ ):
325- __file_format_multi_dict__ .update ( { 'ArchiveFile' : {'format_name' : "ArchiveFile" , 'format_magic' : "ArchiveFile" , 'format_lower' : "archivefile" , ' format_len' : 11 , 'format_hex' : "4172636869766546696c65" , 'format_delimiter' : "\x00 " , 'format_ver' : "001" , 'new_style' : True , 'use_advanced_list' : True , 'use_alt_inode' : False , 'format_extension' : ".arc" } } )
325+ __file_format_multi_dict__ .update ( { 'ArchiveFile' : {'format_name' : "ArchiveFile" , 'format_magic' : "ArchiveFile" , 'format_len' : 11 , 'format_hex' : "4172636869766546696c65" , 'format_delimiter' : "\x00 " , 'format_ver' : "001" , 'new_style' : True , 'use_advanced_list' : True , 'use_alt_inode' : False , 'format_extension' : ".arc" } } )
326326if (__file_format_default__ not in __file_format_multi_dict__ ):
327327 __file_format_default__ = next (iter (__file_format_multi_dict__ ))
328328__file_format_name__ = __file_format_multi_dict__ [__file_format_default__ ]['format_name' ]
329- __file_format_lower__ = __file_format_multi_dict__ [__file_format_default__ ]['format_lower' ]
330329__file_format_magic__ = __file_format_multi_dict__ [__file_format_default__ ]['format_magic' ]
331330__file_format_len__ = __file_format_multi_dict__ [__file_format_default__ ]['format_len' ]
332331__file_format_hex__ = __file_format_multi_dict__ [__file_format_default__ ]['format_hex' ]
0 commit comments