@@ -0,0 +1,1589 @@
+%0Aimport sinon%0A%0A# ------------------------------------------------------------------------------%0A#%0APLUGIN_DESCRIPTION = %7B%0A    'name'        : 'direct-submission', %0A    'version'     : '0.1',%0A    'type'        : 'unit_scheduler', %0A    'description' : 'makes sure that units end up on a unique pilot.'%0A  %7D%0A%0A# ------------------------------------------------------------------------------%0A#%0Aclass PLUGIN_CLASS (object) :%0A    %22%22%22%0A    This class implements the (trivial) direct-submission scheduler for Sinon.%0A    %22%22%22%0A%0A    # --------------------------------------------------------------------------%0A    #%0A    def __init__ (self) :%0A%0A        print %22loading the direct_submission unit plugin%22%0A        self._manager    = None%0A        self._last_pilot = -1%0A%0A%0A    # --------------------------------------------------------------------------%0A    #%0A    def init (self, manager) :%0A%0A        self._manager = manager%0A%0A%0A    # --------------------------------------------------------------------------%0A    #%0A    def schedule (self, unit_descr) :%0A%0A        print %22direct submission of %25s%22 %25 unit_descr%0A%0A        if  not self._manager :%0A            print %22WARNING: unit scheduler is not initialized%22%0A            return None%0A%0A        pilots = self._manager.pilots%0A%0A        if len (pilots) %3E 1:%0A            raise sinon.IncorrectState ('Direct Submission only works for a single pilot!')%0A%0A        %0A        print %22direct submission to %25s%22 %25 pilots%5B0%5D%0A        return pilots%5B0%5D%0A%0A%0A# ------------------------------------------------------------------------------%0A#%0A# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4%0A%0A

add direct submission scheduler for sinon