def generate_reports(self, filename=None, label=None): """Generates the report files by calling the generate_report method from Reports""" if filename is None: filename = tkFileDialog.askdirectory() if label is None: label = self.fluor_path.split("/") label = label[len(label) - 1].split(".") if len(label) > 2: label = label[len(label) - 3] + "." + label[len(label) - 2] else: label = label[len(label) - 2] if len(self.linescan_manager.lines.keys()) > 0: self.linescan_manager.measure_fluorescence( self.image_manager.fluor_image) self.report_manager = ReportManager(self.parameters) self.report_manager.generate_report(filename, label, self.cell_manager, self.linescan_manager, self.parameters) if self.get_cell_images: self.report_manager.get_cell_images(filename, label, self.image_manager, self.cell_manager, self.parameters) print "Reports Generated"
def run(self, args): # First try to authenticate if self.passboltServer.api.authenticate( self.keyringManager.keyring, self.configManager.user()['fingerprint'], self.configManager.server()['fingerprint']): resources = self.__fetchResources(args) reportManager = ReportManager(self.configManager, args) # Initialize a map that will contain the statistics of the renewal renewalStats = { 'foundItems': 0, 'renewableItems': 0, 'items': { 'success': [], # Successfully renewed, no problem 'failures': [], # The service did not accept the renewal 'rollback': [], # The password was renewed but not committed to passbolt, so it has been rollbacked 'errors': [ ] # Everything failed, including the rollback of the password } } # In the case where we are renewing resources that belong to a group, we will need # to filter which resources are shared with edit rights, and which resources are not shared with # this right if not args.personal: self.logger.info('Found [{}] resources available'.format( len(resources))) renewalStats['foundItems'] = len(resources) resources = self.passboltServer.filterUpdatableResources( resources) self.logger.info('Found [{}] resources that can be renewed'.format( len(resources))) if args.limit != 0 and len(resources) >= args.limit: self.logger.info( 'Limiting renewal to the first [{}] resources'.format( args.limit)) resources = resources[:len(resources) - args.limit] renewalStats['renewableItems'] = len(resources) try: for resource in resources: self.__renewResource(resource, args, renewalStats) except KeyboardInterrupt: self.logger.info('Interrupted, sending report and exiting ...') # At the end of the process, show and / or send a report reportManager.sendReports(renewalStats) else: self.logger.error('Failed to authenticate to the Passbolt server.')