def add_external_scan(self, scan):
     scan_id= self.scan_ID_counter
     self.scan_ID_counter += 1
     status = script_semaphore(scan_id, self.signals)
     self.running[scan_id] = running_script(scan, Deferred(), status , externally_launched = True)
     self.signals.on_running_new_script((scan_id, scan.name))
     return scan_id
示例#2
0
 def add_external_scan(self, scan):
     scan_id= self.scan_ID_counter
     self.scan_ID_counter += 1
     status = script_semaphore(scan_id, self.signals)
     self.running[scan_id] = running_script(scan, Deferred(), status , externally_launched = True)
     self.signals.on_running_new_script((scan_id, scan.name))
     return scan_id
示例#3
0
 def do_launch(self, ident, scan, priority, pause_running):
     d = Deferred()
     status = script_semaphore(ident, self.signals)
     self._add_to_running(ident, scan, d, status, priority)
     if pause_running:
         d.addCallback(self.pause_running, scan, ident)
     d.addCallback(self.launch_in_thread, scan, ident)
     if pause_running:
         d.addCallback(self.unpause_on_finish)
     d.addCallback(self.remove_from_running, running_id=ident)
     d.addCallback(self.launch_scripts)
     d.callback(True)
     self.signals.on_running_new_script((ident, scan.name))
示例#4
0
 def do_launch(self, ident, scan, priority, pause_running):
     print "pause_running: {}".format(pause_running)
     scan.update_params(self.parent.all_parameters())
     status = script_semaphore(ident, self.signals)
     self._add_to_running(ident, scan, status, priority)
     if pause_running:
         yield self.pause_running(scan, ident)
     yield scan.run(ident)
     if pause_running:
         yield self.unpause_on_finish()
     #d.addCallback(self.remove_from_running, running_id = ident)
     #d.addCallback(self.launch_scripts)
     self.signals.on_running_new_script((ident, scan.name))
 def do_launch(self, ident, scan, priority, pause_running_not_a_function):
            
     print "pause_running: {}",pause_running_not_a_function, "for scan ident:",ident
     
     d = Deferred()    
     scan.update_params(self.parent.all_parameters())
     status = script_semaphore(ident, self.signals)
     self._add_to_running(ident, scan, d, status, priority)
     if pause_running_not_a_function:
         d.addCallback(self.pause_running, scan, ident)
     d.addCallback(self.launch_in_thread, scan, ident)
     if pause_running_not_a_function:
         d.addCallback(self.unpause_on_finish) 
     d.addCallback(self.remove_from_running, running_id = ident)
     d.addCallback(self.launch_scripts)
     d.addErrback(self.failure)
     d.callback(True)
     self.signals.on_running_new_script((ident, scan.name))
示例#6
0
    def do_launch(self, ident, scan, priority, pause_running_not_a_function):

        print "pause_running: {}", pause_running_not_a_function, "for scan ident:", ident

        d = Deferred()
        scan.update_params(self.parent.all_parameters())
        status = script_semaphore(ident, self.signals)
        self._add_to_running(ident, scan, d, status, priority)
        if pause_running_not_a_function:
            d.addCallback(self.pause_running, scan, ident)
        d.addCallback(self.launch_in_thread, scan, ident)
        if pause_running_not_a_function:
            d.addCallback(self.unpause_on_finish)
        d.addCallback(self.remove_from_running, running_id=ident)
        d.addCallback(self.launch_scripts)
        d.addErrback(self.failure)
        d.callback(True)
        self.signals.on_running_new_script((ident, scan.name))