Skip to content

Commit 9c26355

Browse files
committed
Small update
1 parent f6c07e2 commit 9c26355

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

pyfoxfile/foxfile.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ magic = KitsuneFile
3131
delimiter = \x00
3232
extension = .kitsune
3333

34+
[UwUFile]
35+
len = 7
36+
hex = 55775546696c65
37+
ver = 001
38+
name = UwUFile
39+
magic = UwUFile
40+
delimiter = \x00
41+
extension = .UwU
42+
3443
[\u30ad\u30c4\u30cd\u30d5\u30a1\u30a4\u30eb]
3544
len = 21
3645
hex = e382ade38384e3838de38395e382a1e382a4e383ab

pyfoxfile/foxfile.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@
3030
"delimiter": "\u0000",
3131
"extension": ".kitsune"
3232
},
33+
"UwUFile": {
34+
"len": 7,
35+
"hex": "55775546696c65",
36+
"ver": "001",
37+
"name": "UwUFile",
38+
"magic": "UwUFile",
39+
"delimiter": "\u0000",
40+
"extension": ".UwU"
41+
},
3342
"キツネファイル": {
3443
"len": 21,
3544
"hex": "e382ade38384e3838de38395e382a1e382a4e383ab",

pyfoxfile/pyfoxfile.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
shared_memory = None
117117

118118
def running_interactively():
119+
import sys
119120
main = sys.modules.get("__main__")
120121
return (
121122
hasattr(sys, "ps1") or
@@ -579,8 +580,8 @@ def resource_dir(package_name, filenames):
579580
__use_json_name__ = os.path.join(filecfgpath, "foxfile.json")
580581
if(__use_ini_file__ and __use_json_file__):
581582
__use_json_file__ = False
582-
if('PYFOXFILE_CONFIG_FILE' in os.environ and os.path.exists(os.environ['PYFOXFILE_CONFIG_FILE']) and __use_env_file__):
583-
scriptconf = os.environ['PYFOXFILE_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']
584585
else:
585586
prescriptpath = get_importing_script_path()
586587
if(prescriptpath is not None):
@@ -768,6 +769,7 @@ def _get(section_dict, key, default=None):
768769
# Fox / Kitsune
769770
add_format(__file_format_multi_dict__, "FoxFile", "FoxFile", ".fox", "FoxFile")
770771
add_format(__file_format_multi_dict__, "KitsuneFile", "KitsuneFile", ".kitsune", "KitsuneFile")
772+
add_format(__file_format_multi_dict__, "UwUFile", "UwUFile", ".UwU", "UwUFile")
771773
add_format(__file_format_multi_dict__, "キツネファイル", "キツネファイル", ".キツネ", "KitsuneFairu")
772774
add_format(__file_format_multi_dict__, "きつねファイル", "きつねファイル", ".きつね", "KitsuneFairu")
773775
add_format(__file_format_multi_dict__, "狐ファイル", "狐ファイル", ".狐", "KitsuneFairu")
@@ -5893,7 +5895,7 @@ def MakeEmptyFilePointer(fp, fmttype=__file_format_default__, checksumtype=["md5
58935895
return fp
58945896

58955897

5896-
def MakeEmptyArchiveFilePointer(fp, fmttype=__file_format_default__, checksumtype=["md5", "md5"], formatspecs=__file_format_multi_dict__, saltkey=None):
5898+
def MakeEmptyFoxFilePointer(fp, fmttype=__file_format_default__, checksumtype=["md5", "md5"], formatspecs=__file_format_multi_dict__, saltkey=None):
58975899
return MakeEmptyFilePointer(fp, fmttype, checksumtype, formatspecs, saltkey)
58985900

58995901

@@ -5970,7 +5972,7 @@ def MakeEmptyFile(outfile, fmttype="auto", compression="auto", compresswholefile
59705972
return True
59715973

59725974

5973-
def MakeEmptyArchiveFile(outfile, compression="auto", compresswholefile=True, compressionlevel=None, compressionuselist=compressionlistalt, checksumtype=["md5", "md5"], formatspecs=__file_format_dict__, saltkey=None, returnfp=False):
5975+
def MakeEmptyFoxFile(outfile, compression="auto", compresswholefile=True, compressionlevel=None, compressionuselist=compressionlistalt, checksumtype=["md5", "md5"], formatspecs=__file_format_dict__, saltkey=None, returnfp=False):
59745976
return MakeEmptyFile(outfile, "auto", compression, compresswholefile, compressionlevel, compressionuselist, checksumtype, formatspecs, saltkey, returnfp)
59755977

59765978

@@ -8594,7 +8596,7 @@ def TarFileToArray(infile, fmttype=__file_format_default__, seekstart=0, seekend
85948596

85958597

85968598
if(not libarchive_support):
8597-
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):
8599+
def BSDTarFileToArray(infile, seekstart=0, seekend=0, listonly=False, contentasfile=True, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, returnfp=False):
85988600
return False
85998601

86008602
if(libarchive_support):
@@ -9726,6 +9728,7 @@ def TarFileListFiles(infile, formatspecs=__file_format_multi_dict__, verbose=Fal
97269728
def TarFileListFile(infile, formatspecs=__file_format_multi_dict__, verbose=False, returnfp=False):
97279729
return TarFileListFiles(infile, formatspecs, verbose, returnfp)
97289730

9731+
97299732
if(not libarchive_support):
97309733
def BSDTarFileListFiles(infile, formatspecs=__file_format_multi_dict__, verbose=False, returnfp=False):
97319734
return False
@@ -10274,7 +10277,7 @@ def InFileListFiles(infile, fmttype="auto", filestart=0, seekstart=0, seekend=0,
1027410277
elif(py7zr_support and checkcompressfile == "7zipfile" and py7zr.is_7zfile(infile)):
1027510278
return SevenZipFileListFiles(infile, verbose, returnfp)
1027610279
elif('format_magic' in ckformatspecs and checkcompressfile == ckformatspecs['format_magic']):
10277-
return ArchiveFileListFiles(infile, fmttype, filestart, seekstart, seekend, skipchecksum, formatspecs, saltkey, seektoend, verbose, newstyle, returnfp)
10280+
return FoxFileListFiles(infile, fmttype, filestart, seekstart, seekend, skipchecksum, formatspecs, saltkey, seektoend, verbose, newstyle, returnfp)
1027810281
else:
1027910282
return BSDTarFileListFiles(infile, formatspecs, verbose, returnfp)
1028010283
return False

0 commit comments

Comments
 (0)