Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
KazukiPrzyborowski authored Apr 11, 2024
1 parent f9b0f0e commit 3271228
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
6 changes: 5 additions & 1 deletion catfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
__file_format_delimiter__ = pycatfile.__file_format_delimiter__;
__file_format_list__ = pycatfile.__file_format_list__;
__use_new_style__ = pycatfile.__use_new_style__;
__use_advanced_list__ = pycatfile.__use_advanced_list__;
__use_alt_inode__ = pycatfile.__use_alt_inode__;
__project_url__ = pycatfile.__project_url__;
__version_info__ = pycatfile.__version_info__;
__version_date_info__ = pycatfile.__version_date_info__;
Expand Down Expand Up @@ -70,7 +72,9 @@
fnamehex = binascii.hexlify(fname.encode("UTF-8")).decode("UTF-8");
fnamever = getargs.formatver;
fnamesty = __use_new_style__;
fnamelist = [fname, fnamemagic, fnamelower, fnamelen, fnamehex, getargs.delimiter, fnamever, fnamesty];
fnamelst = __use_advanced_list__;
fnameino = __use_alt_inode__;
fnamelist = [fname, fnamemagic, fnamelower, fnamelen, fnamehex, getargs.delimiter, fnamever, fnamesty, fnamelst, fnameino];

# Determine actions based on user input
should_create = getargs.create and not getargs.extract and not getargs.list;
Expand Down
16 changes: 8 additions & 8 deletions pycatfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@
__file_format_delimiter__ = "\x00";
__file_format_ver__ = "001";
__use_new_style__ = True;
__file_format_list__ = [__file_format_name__, __file_format_magic__, __file_format_lower__, __file_format_len__, __file_format_hex__, __file_format_delimiter__, __file_format_ver__, __use_new_style__];
__project__ = __program_name__;
__use_advanced_list__ = True;
__use_alt_inode__ = False;
__file_format_list__ = [__file_format_name__, __file_format_magic__, __file_format_lower__, __file_format_len__, __file_format_hex__, __file_format_delimiter__, __file_format_ver__, __use_new_style__, __use_advanced_list__, __use_alt_inode__];
__project__ = __program_name__;
__project_url__ = "https://github.com/GameMaker2k/PyCatFile";
__version_info__ = (0, 7, 4, "RC 1", 1);
__version_date_info__ = (2024, 4, 1, "RC 1", 1);
Expand Down Expand Up @@ -1229,8 +1229,8 @@ def AppendFileHeaderWithContent(fp, filevalues=[], extradata=[], filecontent="",
return fp;

def AppendFilesWithContent(infiles, fp, dirlistfromtxt=False, filevalues=[], extradata=[], followlink=False, checksumtype="crc32", formatspecs=__file_format_list__, verbose=False):
advancedlist = __use_advanced_list__;
altinode = __use_alt_inode__;
advancedlist = formatspecs[8];
altinode = formatspecs[9];
if(verbose):
logging.basicConfig(format="%(message)s", stream=sys.stdout, level=logging.DEBUG);
if(infiles=="-"):
Expand Down Expand Up @@ -2245,8 +2245,8 @@ def CheckSumSupportAlt(checkfor, guaranteed=True):
return False;

def PackArchiveFile(infiles, outfile, dirlistfromtxt=False, compression="auto", compressionlevel=None, followlink=False, checksumtype="crc32", extradata=[], formatspecs=__file_format_list__, verbose=False, returnfp=False):
advancedlist = __use_advanced_list__;
altinode = __use_alt_inode__;
advancedlist = formatspecs[8];
altinode = formatspecs[9];
if(outfile!="-" and not hasattr(outfile, "read") and not hasattr(outfile, "write")):
outfile = RemoveWindowsPath(outfile);
checksumtype = checksumtype.lower();
Expand Down Expand Up @@ -4701,8 +4701,8 @@ def ListDirToArrayAlt(infiles, dirlistfromtxt=False, followlink=False, listonly=
catver = formatspecs[6];
fileheaderver = str(int(catver.replace(".", "")));
fileheader = AppendNullByte(formatspecs[1] + fileheaderver, formatspecs[5]);
advancedlist = __use_advanced_list__;
altinode = __use_alt_inode__;
advancedlist = formatspecs[8];
altinode = formatspecs[9];
infilelist = [];
if(infiles=="-"):
for line in sys.stdin:
Expand Down

0 comments on commit 3271228

Please sign in to comment.