示例#1
0
	def export_button_click(self):
		def message_box():
				os_command = 'notepad.exe' + output_file
				os.system(os_command)
		
		global input_file
		if input_file:
			file_type = input_file[len(input_file) - 3: len(input_file)]
			if file_type == 'jpg' or file_type == 'png':
				dialog = QFileDialog.getSaveFileName(self, 'Text Files', './', 'Text Files(*.txt)')
				if dialog:
					output_file = dialog[0]
					if main.convert_image(input_file, output_file):
						msg_box = QMessageBox()
						msg_box.setIcon(QMessageBox.Information)
						msg_box.setText('Click OK to open the file.')
						msg_box.setWindowTitle('Convert Succsesful')
						msg_box.buttonClicked.connect(message_box)
						msg_box.exec_()
示例#2
0
 def test_none(self):
     result = main.convert_image(['PokeDex',None])
     self.assertEqual(result,None)
示例#3
0
 def test_number(self):
     result = main.convert_image([1,2])
     self.assertEqual(result,None)
示例#4
0
 def test_bool(self):
     result = main.convert_image(['PokeDex',True])
     self.assertEqual(result,None)