Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, nb_workers=multiprocessing.cpu_count()):
if (len(ALGORITHMS) % nb_workers) == 0: # for correct dispatch
nb_workers += 1
self.nb_workers = nb_workers
self.schedulers = [
JobScheduler("{}".format(nb)) for nb in range(0, self.nb_workers)
]
for scheduler in self.schedulers:
scheduler.warnings = False
self.last_scheduler = 0
def __init_schedulers(self):
return {
'main': JobScheduler("Main"),
'ocr': JobScheduler("OCR"),
'page_boxes_loader': JobScheduler("Page boxes loader"),
'progress': JobScheduler("Progress"),
'scan': JobScheduler("Scan"),
'index': JobScheduler("Index search / update"),
}
def __init_schedulers(self):
return {
'main': JobScheduler("Main"),
'ocr': JobScheduler("OCR"),
'page_boxes_loader': JobScheduler("Page boxes loader"),
'progress': JobScheduler("Progress"),
'scan': JobScheduler("Scan"),
'index': JobScheduler("Index search / update"),
}
def __init_schedulers(self):
return {
'main': JobScheduler("Main"),
'ocr': JobScheduler("OCR"),
'page_boxes_loader': JobScheduler("Page boxes loader"),
'progress': JobScheduler("Progress"),
'scan': JobScheduler("Scan"),
'index': JobScheduler("Index search / update"),
}
def __init_schedulers(self):
return {
'main': JobScheduler("Main"),
'ocr': JobScheduler("OCR"),
'page_boxes_loader': JobScheduler("Page boxes loader"),
'progress': JobScheduler("Progress"),
'scan': JobScheduler("Scan"),
'index': JobScheduler("Index search / update"),
}
def __init__(self, main_scheduler, mainwindow_gui, config):
super(SettingsWindow, self).__init__()
self.schedulers = {
'main': main_scheduler,
'progress': JobScheduler('progress'),
}
self.local_schedulers = [
self.schedulers['progress'],
]
widget_tree = load_uifile(
os.path.join("settingswindow", "settingswindow.glade"))
# self.widget_tree is for tests/screenshots ONLY
self.widget_tree = widget_tree
distrib = platform.dist()
if distrib:
distrib = distrib[0].lower()
logger.info("Distribution: [%s]" % distrib)
for widget in widget_tree.get_objects():
if type(widget) == Gtk.LinkButton:
def __init_schedulers(self):
return {
'main': JobScheduler("Main"),
'ocr': JobScheduler("OCR"),
'page_boxes_loader': JobScheduler("Page boxes loader"),
'progress': JobScheduler("Progress"),
'scan': JobScheduler("Scan"),
'index': JobScheduler("Index search / update"),
}
def __init_schedulers(self):
return {
'main': JobScheduler("Main"),
'ocr': JobScheduler("OCR"),
'page_boxes_loader': JobScheduler("Page boxes loader"),
'progress': JobScheduler("Progress"),
'scan': JobScheduler("Scan"),
'index': JobScheduler("Index search / update"),
}