Skip to content

Commit

Permalink
Update pycatfile.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KazukiPrzyborowski authored Mar 15, 2018
1 parent 2bd2a03 commit 97b4d4a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pycatfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,23 +360,22 @@ def PackCatFile(infiles, outfile, dirlistfromtxt=False, compression="auto", foll
fileheaderver = str(int(catver.replace(".", "")));
fileheader = AppendNullByte("CatFile" + fileheaderver);
catfp.write(fileheader.encode());
infilelist = []
if(infiles=="-"):
infilelist = [];
for line in sys.stdin:
infilelist.append(line.strip());
infilelist = list(filter(None, infilelist));
elif(infiles!="-" and dirlistfromtxt and os.path.exists(infiles) and os.path.isfile(infiles)):
with open(infiles, "r") as finfile:
infilelist = [];
for line in finfile:
infilelist.append(line.strip());
infilelist = list(filter(None, infilelist));
else:
if(isinstance(infiles, (list, tuple, ))):
infiles = list(filter(None, infiles));
infilelist = list(filter(None, infiles));
elif(isinstance(infiles, (str, ))):
infiles = list(filter(None, [infiles]));
GetDirList = ListDir(infiles, followlink, False);
infilelist = list(filter(None, [infiles]));
GetDirList = ListDir(infilelist, followlink, False);
if(not GetDirList):
return False;
for curfname in GetDirList:
Expand Down

0 comments on commit 97b4d4a

Please sign in to comment.