Skip to content

Commit

Permalink
check if file is not found on size check
Browse files Browse the repository at this point in the history
  • Loading branch information
Numerlor committed Jul 17, 2019
1 parent f86c015 commit 9304bf3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions MainWindows.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,11 +772,11 @@ def change_status(self, message):

def cs_submit_act(self, cpath):
self.cs_submit.setEnabled(False)
if os.stat(cpath).st_size > 2_097_152:
self.status.showMessage("File too large")
self.cs_submit.setEnabled(True)
else:
try:
try:
if os.stat(cpath).st_size > 2_097_152:
self.status.showMessage("File too large")
self.cs_submit.setEnabled(True)
else:
with open(cpath, encoding='utf-8') as f:
data = []
valid = True
Expand Down Expand Up @@ -804,8 +804,8 @@ def cs_submit_act(self, cpath):
self.status.showMessage("Error loading csv file")
self.cs_submit.setEnabled(True)

except FileNotFoundError:
self.status.showMessage("Invalid path to CSV file")
except FileNotFoundError:
self.status.showMessage("Invalid path to CSV file")

def last_submit_act(self):
self.last_submit.setEnabled(False)
Expand Down

0 comments on commit 9304bf3

Please sign in to comment.