def send_data(self): contents = [ "The scan is done and the logged data is attached to this email. Please visit the experiment site and make sure that all light sources are switched off." ] contents.extend(self.datafiles) subject = "The scan data from the latest scan!" obj = type( "obj", (object, ), { "subject": subject, "contents": contents, "settings": self.emailset_str, "receivers": self.emailrec_str }) worker = Send_Email_Worker(obj) worker.signals.critical.connect(self.critical) worker.signals.warning.connect(self.warning) worker.signals.finished.connect(self.finished1) # Execute self.md = Indicator_dialog.Indicator_dialog( self, "...sending files...", "indicators/ajax-loader-ball.gif") self.threadpool.start(worker) self.isRunning = True
def send_notif(self): contents = [ "The scan is done. Please visit the experiment site and make sure that all light sources are switched off." ] subject = "The scan is done" obj = type( "obj", (object, ), { "subject": subject, "contents": contents, "settings": self.emailset_str, "receivers": self.emailrec_str }) worker = Send_Email_Worker(obj) worker.signals.critical.connect(self.critical) worker.signals.warning.connect(self.warning) worker.signals.finished.connect(self.finished1) # Execute self.md = Indicator_dialog.Indicator_dialog( self, "...sending notification...", "indicators/ajax-loader-ball.gif") self.threadpool.start(worker) self.isRunning = True
def btn_send_email(self): self.md = Indicator_dialog.Indicator_dialog(self, "...sending files...", "indicators/ajax-loader-ball.gif") obj = type('obj',(object,),{'emailset_str':self.emailset_str, 'emailrec_str':self.emailrec_str, 'all_files':self.all_files}) worker=Send_Worker(obj) worker.signals.critical.connect(self.critical) worker.signals.warning.connect(self.warning) worker.signals.finished.connect(self.finished) # Execute self.threadpool.start(worker)
def zip_folder(self): options = QFileDialog.Options() options |= QFileDialog.DontUseNativeDialog folder = QFileDialog.getExistingDirectory(self, 'Select directory to zip', options=options) if folder: self.md = Indicator_dialog.Indicator_dialog(self, "...zipping folder...", "indicators/ajax-loader-ball.gif") obj = type('obj',(object,),{'folder':folder}) worker=Zip_Worker(obj) worker.signals.critical.connect(self.critical) worker.signals.about.connect(self.about) worker.signals.finished.connect(self.finished) # Execute self.threadpool.start(worker)