<s> """<STR_LIT>""" <EOL> __copyright__ = "<STR_LIT>" <EOL> from Cura . util import profile <EOL> from Cura . util import version <EOL> from Cura . util . printerConnection import dummyConnection <EOL> from Cura . util . printerConnection import serialConnection <EOL> from Cura . util . printerConnection import doodle3dConnect <EOL> class PrinterConnectionManager ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . _groupList = [ ] <EOL> if version . isDevVersion ( ) : <EOL> self . _groupList . append ( dummyConnection . dummyConnectionGroup ( ) ) <EOL> self . _groupList . append ( serialConnection . serialConnectionGroup ( ) ) <EOL> self . _groupList . append ( doodle3dConnect . doodle3dConnectionGroup ( ) ) <EOL> self . _groupList . sort ( reverse = True ) <EOL> def getAvailableGroup ( self ) : <EOL> if profile . getMachineSetting ( '<STR_LIT>' ) == '<STR_LIT>' : <EOL> return None <EOL> for g in self . _groupList : <EOL> if len ( g . getAvailableConnections ( ) ) > <NUM_LIT:0> : <EOL> return g <EOL> return None <EOL> def getAvailableConnections ( self ) : <EOL> ret = [ ] <EOL> for e in self . _groupList : <EOL> ret += e . getAvailableConnections ( ) <EOL> return ret </s>
