Skip to content

Commit d10d727

Browse files
committed
Small update
1 parent 3a22fb9 commit d10d727

3 files changed

Lines changed: 27 additions & 8 deletions

File tree

pyneofile/neofile.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,12 @@ name = ArchiveFile
3030
magic = ArchiveFile
3131
delimiter = \x00
3232
extension = .arc
33+
34+
[UwUFile]
35+
len = 7
36+
hex = 55775546696c65
37+
ver = 001
38+
name = UwUFile
39+
magic = UwUFile
40+
delimiter = \x00
41+
extension = .UwU

pyneofile/neofile.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,14 @@
2929
"magic": "ArchiveFile",
3030
"delimiter": "\u0000",
3131
"extension": ".arc"
32+
},
33+
"UwUFile": {
34+
"len": 7,
35+
"hex": "55775546696c65",
36+
"ver": "001",
37+
"name": "UwUFile",
38+
"magic": "UwUFile",
39+
"delimiter": "\u0000",
40+
"extension": ".UwU"
3241
}
3342
}

pyneofile/pyneofile.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,8 @@ def resource_dir(package_name, filenames):
580580
__use_json_name__ = os.path.join(filecfgpath, "neofile.json")
581581
if(__use_ini_file__ and __use_json_file__):
582582
__use_json_file__ = False
583-
if('PYNEOFILE_CONFIG_FILE' in os.environ and os.path.exists(os.environ['PYNEOFILE_CONFIG_FILE']) and __use_env_file__):
584-
scriptconf = os.environ['PYNEOFILE_CONFIG_FILE']
583+
if('PYARCHIVEFILE_CONFIG_FILE' in os.environ and os.path.exists(os.environ['PYARCHIVEFILE_CONFIG_FILE']) and __use_env_file__):
584+
scriptconf = os.environ['PYARCHIVEFILE_CONFIG_FILE']
585585
else:
586586
prescriptpath = get_importing_script_path()
587587
if(prescriptpath is not None):
@@ -768,7 +768,8 @@ def _get(section_dict, key, default=None):
768768
if __include_defaults__:
769769
# Neo / Arc
770770
add_format(__file_format_multi_dict__, "NeoFile", "NeoFile", ".neo", "NeoFile")
771-
add_format(__file_format_multi_dict__, "NeoFile", "NeoFile", ".arc", "NeoFile")
771+
add_format(__file_format_multi_dict__, "ArchiveFile", "ArchiveFile", ".arc", "ArchiveFile")
772+
add_format(__file_format_multi_dict__, "UwUFile", "UwUFile", ".UwU", "UwUFile")
772773

773774
# Pick a default if current default key is not present
774775
if __file_format_default__ not in __file_format_multi_dict__:
@@ -5887,7 +5888,7 @@ def MakeEmptyFilePointer(fp, fmttype=__file_format_default__, checksumtype=["md5
58875888
return fp
58885889

58895890

5890-
def MakeEmptyArchiveFilePointer(fp, fmttype=__file_format_default__, checksumtype=["md5", "md5"], formatspecs=__file_format_multi_dict__, saltkey=None):
5891+
def MakeEmptyNeoFilePointer(fp, fmttype=__file_format_default__, checksumtype=["md5", "md5"], formatspecs=__file_format_multi_dict__, saltkey=None):
58915892
return MakeEmptyFilePointer(fp, fmttype, checksumtype, formatspecs, saltkey)
58925893

58935894

@@ -5964,7 +5965,7 @@ def MakeEmptyFile(outfile, fmttype="auto", compression="auto", compresswholefile
59645965
return True
59655966

59665967

5967-
def MakeEmptyArchiveFile(outfile, compression="auto", compresswholefile=True, compressionlevel=None, compressionuselist=compressionlistalt, checksumtype=["md5", "md5"], formatspecs=__file_format_dict__, saltkey=None, returnfp=False):
5968+
def MakeEmptyNeoFile(outfile, compression="auto", compresswholefile=True, compressionlevel=None, compressionuselist=compressionlistalt, checksumtype=["md5", "md5"], formatspecs=__file_format_dict__, saltkey=None, returnfp=False):
59685969
return MakeEmptyFile(outfile, "auto", compression, compresswholefile, compressionlevel, compressionuselist, checksumtype, formatspecs, saltkey, returnfp)
59695970

59705971

@@ -8588,7 +8589,7 @@ def TarFileToArray(infile, fmttype=__file_format_default__, seekstart=0, seekend
85888589

85898590

85908591
if(not libarchive_support):
8591-
def BSDTarFileToArray(infile, fmttype=__file_format_default__, seekstart=0, seekend=0, listonly=False, contentasfile=True, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, returnfp=False):
8592+
def BSDTarFileToArray(infile, seekstart=0, seekend=0, listonly=False, contentasfile=True, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, returnfp=False):
85928593
return False
85938594

85948595
if(libarchive_support):
@@ -9595,7 +9596,7 @@ def MultipleStackedNeoFileListFiles(infile, fmttype="auto", filestart=0, seeksta
95959596
infile = [infile]
95969597
outretval = {}
95979598
for curfname in infile:
9598-
outretval[curfname] = StackedFoxFileListFiles(curfname, fmttype, filestart, seekstart, seekend, skipchecksum, formatspecs, saltkey, seektoend, verbose, newstyle, returnfp)
9599+
outretval[curfname] = StackedNeoFileListFiles(curfname, fmttype, filestart, seekstart, seekend, skipchecksum, formatspecs, saltkey, seektoend, verbose, newstyle, returnfp)
95999600
return outretval
96009601

96019602

@@ -10269,7 +10270,7 @@ def InFileListFiles(infile, fmttype="auto", filestart=0, seekstart=0, seekend=0,
1026910270
elif(py7zr_support and checkcompressfile == "7zipfile" and py7zr.is_7zfile(infile)):
1027010271
return SevenZipFileListFiles(infile, verbose, returnfp)
1027110272
elif('format_magic' in ckformatspecs and checkcompressfile == ckformatspecs['format_magic']):
10272-
return ArchiveFileListFiles(infile, fmttype, filestart, seekstart, seekend, skipchecksum, formatspecs, saltkey, seektoend, verbose, newstyle, returnfp)
10273+
return NeoFileListFiles(infile, fmttype, filestart, seekstart, seekend, skipchecksum, formatspecs, saltkey, seektoend, verbose, newstyle, returnfp)
1027310274
else:
1027410275
return BSDTarFileListFiles(infile, formatspecs, verbose, returnfp)
1027510276
return False

0 commit comments

Comments
 (0)