<s> '''<STR_LIT>''' <EOL> '''<STR_LIT>''' <EOL> import os <EOL> import sys <EOL> from SBusPythonFacade . SBus import SBus <EOL> from SBusPythonFacade . SBusDatagram import SBusDatagram <EOL> from SBusPythonFacade . SBusStorletCommand import SBUS_CMD_HALT <EOL> '''<STR_LIT>''' <EOL> def print_usage ( argv ) : <EOL> print ( argv [ <NUM_LIT:0> ] + '<STR_LIT>' ) <EOL> print ( '<STR_LIT>' ) <EOL> sys . stdout . write ( argv [ <NUM_LIT:0> ] + '<STR_LIT:U+0020>' ) <EOL> print ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> '''<STR_LIT>''' <EOL> def main ( argv ) : <EOL> if <NUM_LIT:2> > len ( argv ) : <EOL> print_usage ( argv ) <EOL> return <EOL> daemon_factory_pipe_name = argv [ <NUM_LIT:1> ] <EOL> fi , fo = os . pipe ( ) <EOL> halt_dtg = SBusDatagram . create_service_datagram ( SBUS_CMD_HALT , fo ) <EOL> n_status = SBus . send ( daemon_factory_pipe_name , halt_dtg ) <EOL> if <NUM_LIT:0> > n_status : <EOL> print ( '<STR_LIT>' ) <EOL> else : <EOL> print ( '<STR_LIT>' ) <EOL> cmd_response = os . read ( fi , <NUM_LIT> ) <EOL> print ( cmd_response ) <EOL> os . close ( fi ) <EOL> os . close ( fo ) <EOL> '''<STR_LIT>''' <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( sys . argv ) <EOL> '''<STR_LIT>''' </s>
