#NEWLINE# @ auth . s3_requires_membership ( 1 ) #NEWLINE# def sms_modem_channel( ) : #NEWLINE# #INDENT# '\n        RESTful CRUD controller for modem channels\n        - appears in the administration menu\n        Multiple Modems can be configured to receive Inbound Messages\n    ' #NEWLINE# try : #NEWLINE# #INDENT# import serial #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# session . error = T ( 'Python Serial module not available within the running Python - this needs installing to activate the Modem' ) #NEWLINE# redirect ( URL ( c = 'admin' , f = 'index' ) ) #NEWLINE# #UNINDENT# tablename = ( '%s_%s' % ( module , resourcename ) ) #NEWLINE# table = s3db [ tablename ] #NEWLINE# table . modem_port . label = T ( 'Port' ) #NEWLINE# table . modem_baud . label = T ( 'Baud' ) #NEWLINE# table . enabled . label = T ( 'Enabled' ) #NEWLINE# table . modem_port . comment = DIV ( _class = 'tooltip' , _title = ( '%s|%s' % ( T ( 'Port' ) , T ( 'The serial port at which the modem is connected - /dev/ttyUSB0, etc on linux and com1, com2, etc on Windows' ) ) ) ) #NEWLINE# table . modem_baud . comment = DIV ( _class = 'tooltip' , _title = ( '%s|%s' % ( T ( 'Baud' ) , T ( 'Baud rate to use for your modem - The default is safe for most cases' ) ) ) ) #NEWLINE# table . enabled . comment = DIV ( _class = 'tooltip' , _title = ( '%s|%s' % ( T ( 'Enabled' ) , T ( 'Unselect to disable the modem' ) ) ) ) #NEWLINE# s3 . crud_strings [ table ] = Storage ( label_create = T ( 'Add Modem Channel' ) , title_display = T ( 'Modem Channel Details' ) , title_list = T ( 'Modem Channels' ) , title_update = T ( 'Edit Modem Channel' ) , label_list_button = T ( 'View Modem Channels' ) , msg_record_created = T ( 'Modem Channel added' ) , msg_record_modified = T ( 'Modem Channel updated' ) , msg_record_deleted = T ( 'Modem Channel deleted' ) , msg_list_empty = T ( 'No Modem Channels currently defined' ) ) #NEWLINE# return s3_rest_controller ( )