Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhemvrot authored Dec 26, 2022
1 parent 6eed76f commit f308f8a
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions ZLib DC.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,12 @@ def Mdecompress(self):

if endi == "" or endi is None:
endi=".txt"
if endi.find(".")== -1:
if endi.find(".")== -1 and not endi.startswith("-"):
endi=".txt"

if endi.startswith("-"):
endel = True
endi = endi.replace("-", "")

ftypes = [('All files', '*')]
filename = fd.askopenfilenames(filetypes=ftypes)
Expand All @@ -134,7 +138,10 @@ def Mdecompress(self):
with open(fnz2, 'rb') as myfile:
f = myfile.read()
#ftypes = [('All files', '*')]
newfilename = fnz2+endi
if endel is not True:
newfilename = fnz2+endi
if endel is True:
newfilename = fnz2.replace(endi, "")
print(newfilename)
z = open(newfilename, "ab")
print("Decompressed String")
Expand All @@ -152,9 +159,13 @@ def Mcompress(self):
if endi == "" or endi is None:
endi=".zlib"

if endi.find(".")== -1:
if endi.find(".")== -1 and not endi.startswith("-"):
endi=".zlib"

if endi.startswith("-"):
endel = True
endi = endi.replace("-", "")

try:
levelc=int(self.T1.get(1.0, "end-1c"))
except:
Expand All @@ -178,7 +189,10 @@ def Mcompress(self):
with open(fnz2, 'rb') as myfile:
f = myfile.read()
#ftypes = [('All files', '*')]
newfilename = fnz2+endi
if endel is not True:
newfilename = fnz2+endi
if endel is True:
newfilename = fnz2.replace(endi, "")
print(newfilename)
z = open(newfilename, "ab")
print("Compressed String")
Expand All @@ -193,7 +207,7 @@ def About(self):
tk.messagebox.showinfo(title='About', message='''This is a program to compress and decompress files, using Z-Library.
Program authors: dzhemvrot; osaten
Program version: 3.0
Program version: 3.2
Program restributed using GPL-3.0 license''')

root = Tk()
Expand Down

0 comments on commit f308f8a

Please sign in to comment.