mirror of
https://github.com/Kilian/Trimage.git
synced 2026-01-26 01:58:41 -05:00
abstract file checking to its own function
This commit is contained in:
parent
1d2d540455
commit
775d36310c
1 changed files with 5 additions and 2 deletions
|
|
@ -50,17 +50,20 @@ class StartQT4(QMainWindow):
|
|||
for image in imagedir:
|
||||
image = directory + "/" + image
|
||||
name = QFileInfo(image).fileName()
|
||||
if name.endsWith("png") or name.endsWith("jpg"):
|
||||
if self.checkname(name):
|
||||
self.compress_file(image)
|
||||
|
||||
def file_from_cmd(self, image):
|
||||
self.showapp = False
|
||||
if image.endsWith("png") or image.endsWith("jpg"):
|
||||
if self.checkname(name):
|
||||
self.compress_file(image)
|
||||
|
||||
def file_drop(self):
|
||||
print "booya"
|
||||
|
||||
def checkname(self, filename):
|
||||
if filename.endsWith("png") or filename.endsWith("jpg"):
|
||||
return True
|
||||
|
||||
def file_dialog(self):
|
||||
fd = QFileDialog(self)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue