PEATSA/WebApp/JobSubmission.py
def _checkUploadedFiles(self):
	
		'''Checks all the uploaded files to see if they are within limits'''
	
		#If a PKA code wasn't provided a 
		#pdb file must be present - check the file size
		if not self.formData.isPKACodePresent():
			content = self.formData.pdbFileStream().read()
			if len(content) > self.uploadLimit:
				self.errorData = {"domain":"PDT.SubmissionDomain",
						"description":"Error with pdb.",
						"detailedDescription":"Filesize exceeds size limit (%.2lfMB)" % (self.uploadLimit/(1024.0*1024.0)),
						"recoverySuggestion":"Unfortunately we only can accept files under this limit."}			
			
			if len(content) == 0:
				self.errorData = {"domain":"PDT.SubmissionDomain",
						"description":"Error with pdb.",
						"detailedDescription":"No data in file",
						"recoverySuggestion":"Check that the correct file was provided."}
									
		if self.errorData is not None and self.formData.isLigandPresent():
			content = self.formData.ligandFileStream().read()
			if len(content) > self.uploadLimit:
				self.errorData = {"domain":"PDT.SubmissionDomain",
						"description":"Error with uploaded ligand.",
						"detailedDescription":"Filesize exceeds upload limit (%.2lfMB)" % (self.uploadLimit/(1024.0*1024.0)),
						"recoverySuggestion":"Unfortunately we only can accept files under this limit."}
						
		if self.errorData is not None and self.formData.isMutationList():
			content = self.formData. mutationListFileStream().read()
			if len(content) > self.uploadLimit:
				self.errorData = {"domain":"PDT.SubmissionDomain",
						"description":"Error with uploaded ligand.",
						"detailedDescription":"Filesize exceeds upload limit (%.2lfMB)" % (self.uploadLimit/(1024.0*1024.0)),
						"recoverySuggestion":"Unfortunately we only can accept files under this limit."}				
						
		if self.errorData is not None:
			return False
		else:
			return True
Checks all the uploaded files to see if they are within limits
Checks all the uploaded files to see if they are within limits
Checks all the uploaded files to see if they are within limits
def _checkUploadedFiles(self):
		if not self.formData.isPKACodePresent():
			content = self.formData.pdbFileStream().read()
			if len(content) > self.uploadLimit:
				self.errorData = {"domain":"PDT.SubmissionDomain",
						"description":"Error with pdb.",
						"detailedDescription":"Filesize exceeds size limit (%.2lfMB)" % (self.uploadLimit/(1024.0*1024.0)),
						"recoverySuggestion":"Unfortunately we only can accept files under this limit."}			
			if len(content) == 0:
				self.errorData = {"domain":"PDT.SubmissionDomain",
						"description":"Error with pdb.",
						"detailedDescription":"No data in file",
						"recoverySuggestion":"Check that the correct file was provided."}
		if self.errorData is not None and self.formData.isLigandPresent():
			content = self.formData.ligandFileStream().read()
			if len(content) > self.uploadLimit:
				self.errorData = {"domain":"PDT.SubmissionDomain",
						"description":"Error with uploaded ligand.",
						"detailedDescription":"Filesize exceeds upload limit (%.2lfMB)" % (self.uploadLimit/(1024.0*1024.0)),
						"recoverySuggestion":"Unfortunately we only can accept files under this limit."}
		if self.errorData is not None and self.formData.isMutationList():
			content = self.formData. mutationListFileStream().read()
			if len(content) > self.uploadLimit:
				self.errorData = {"domain":"PDT.SubmissionDomain",
						"description":"Error with uploaded ligand.",
						"detailedDescription":"Filesize exceeds upload limit (%.2lfMB)" % (self.uploadLimit/(1024.0*1024.0)),
						"recoverySuggestion":"Unfortunately we only can accept files under this limit."}				
		if self.errorData is not None:
			return False
		else:
			return True
def _checkUploadedFiles ( self ) : if not self . formData . isPKACodePresent ( ) : content = self . formData . pdbFileStream ( ) . read ( ) if len ( content ) > self . uploadLimit : self . errorData = { "domain" : "PDT.SubmissionDomain" , "description" : "Error with pdb." , "detailedDescription" : "Filesize exceeds size limit (%.2lfMB)" % ( self . uploadLimit / ( 1024.0 * 1024.0 ) ) , "recoverySuggestion" : "Unfortunately we only can accept files under this limit." } if len ( content ) == 0 : self . errorData = { "domain" : "PDT.SubmissionDomain" , "description" : "Error with pdb." , "detailedDescription" : "No data in file" , "recoverySuggestion" : "Check that the correct file was provided." } if self . errorData is not None and self . formData . isLigandPresent ( ) : content = self . formData . ligandFileStream ( ) . read ( ) if len ( content ) > self . uploadLimit : self . errorData = { "domain" : "PDT.SubmissionDomain" , "description" : "Error with uploaded ligand." , "detailedDescription" : "Filesize exceeds upload limit (%.2lfMB)" % ( self . uploadLimit / ( 1024.0 * 1024.0 ) ) , "recoverySuggestion" : "Unfortunately we only can accept files under this limit." } if self . errorData is not None and self . formData . isMutationList ( ) : content = self . formData . mutationListFileStream ( ) . read ( ) if len ( content ) > self . uploadLimit : self . errorData = { "domain" : "PDT.SubmissionDomain" , "description" : "Error with uploaded ligand." , "detailedDescription" : "Filesize exceeds upload limit (%.2lfMB)" % ( self . uploadLimit / ( 1024.0 * 1024.0 ) ) , "recoverySuggestion" : "Unfortunately we only can accept files under this limit." } if self . errorData is not None : return False else : return True
Checks all the uploaded files to see if they are within limits
Checks all the uploaded files to see if they are within limits
'''Checks all the uploaded files to see if they are within limits''' #If a PKA code wasn't provided a  #pdb file must be present - check the file size
self