<s> from imapfw import runtime <EOL> from . manager import Manager <EOL> from . . constants import DRV <EOL> from . . types . repository import RepositoryInterface <EOL> class DriverManager ( Manager ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , workerName ) : <EOL> super ( DriverManager , self ) . __init__ ( ) <EOL> self . _workerName = workerName <EOL> self . ui = runtime . ui <EOL> self . rascal = runtime . rascal <EOL> self . _driver = None <EOL> self . _folders = None <EOL> self . ui . debugC ( DRV , "<STR_LIT>" % workerName ) <EOL> def connect ( self , repositoryName ) : <EOL> """<STR_LIT>""" <EOL> repository = self . rascal . get ( repositoryName , [ RepositoryInterface ] ) <EOL> repository . fw_init ( ) <EOL> driver = repository . fw_chainControllers ( ) <EOL> driver . fw_init ( repository . conf , repositoryName ) <EOL> driver . fw_sanityChecks ( driver ) <EOL> self . ui . debugC ( DRV , "<STR_LIT>" , <EOL> driver . getName ( ) , repositoryName ) <EOL> self . ui . debugC ( DRV , "<STR_LIT>" , repositoryName , driver . conf ) <EOL> if driver . isLocal : <EOL> self . ui . debugC ( DRV , '<STR_LIT>' , driver . getOwnerName ( ) , <EOL> driver . conf . get ( '<STR_LIT:path>' ) ) <EOL> else : <EOL> self . ui . debugC ( DRV , '<STR_LIT>' , <EOL> driver . getOwnerName ( ) , driver . conf . get ( '<STR_LIT:host>' ) , <EOL> driver . conf . get ( '<STR_LIT:port>' ) ) <EOL> connected = driver . connect ( ) <EOL> self . ui . debugC ( DRV , "<STR_LIT>" , driver . getOwnerName ( ) ) <EOL> if connected : <EOL> self . _driver = driver <EOL> else : <EOL> raise Exception ( "<STR_LIT>" % self . _workerName ) <EOL> def ex_account_connect ( self ) : <EOL> self . connect ( ) <EOL> def ex_account_fetchFolders ( self ) : <EOL> self . ui . debugC ( DRV , "<STR_LIT>" , <EOL> self . _driver . getOwnerName ( ) ) <EOL> self . _folders = self . _driver . getFolders ( ) <EOL> def ex_account_getFolders ( self ) : <EOL> self . ui . debugC ( DRV , "<STR_LIT>" , <EOL> self . _driver . getOwnerName ( ) , self . _folders ) <EOL> return self . _folders <EOL> def ex_account_logout ( self ) : <EOL> self . _driver . logout ( ) <EOL> self . ui . debugC ( DRV , "<STR_LIT>" , self . _driver . getOwnerName ( ) ) <EOL> self . _driver = None <EOL> def ex_architect_stopServing ( self ) : <EOL> self . stopServing ( ) </s>
