<s> from traits . api import HasTraits , Int , Str , Tuple , Array , Range <EOL> from traitsui . api import View , Label <EOL> class CameraError ( Exception ) : <EOL> def __init__ ( self , msg , cam ) : <EOL> self . msg = msg <EOL> self . camera_number = cam <EOL> def __str__ ( self ) : <EOL> return '<STR_LIT>' . format ( self . msg , self . camera_number ) <EOL> class Camera ( HasTraits ) : <EOL> camera_number = Int ( - <NUM_LIT:1> ) <EOL> id_string = Str ( ) <EOL> resolution = Tuple ( Int ( ) , Int ( ) ) <EOL> roi = Tuple ( Int ( ) , Int ( ) , Int ( ) , Int ( ) ) <EOL> frame_rate = Range ( <NUM_LIT:1> , <NUM_LIT> , <NUM_LIT:30> ) <EOL> frame = Array ( ) <EOL> view = View ( Label ( '<STR_LIT>' ) ) <EOL> def __enter__ ( self ) : <EOL> self . open ( ) <EOL> return self <EOL> def __exit__ ( self , * args ) : <EOL> self . close ( ) <EOL> return False <EOL> def open ( self ) : <EOL> raise NotImplementedError ( ) <EOL> def close ( self ) : <EOL> raise NotImplementedError ( ) <EOL> def query_frame ( self ) : <EOL> raise NotImplementedError ( ) <EOL> def find_resolutions ( self ) : <EOL> '''<STR_LIT>''' <EOL> return [ self . resolution ] <EOL> def configure ( self ) : <EOL> """<STR_LIT>""" <EOL> pass </s>
