<s> from __future__ import unicode_literals <EOL> import signal <EOL> import logging <EOL> import sys <EOL> from os import environ <EOL> from leapcast . environment import parse_cmd , Environment <EOL> from leapcast . services . leap import LEAPserver <EOL> from leapcast . services . ssdp import SSDPserver <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> def main ( ) : <EOL> parse_cmd ( ) <EOL> if sys . platform == '<STR_LIT>' and environ . get ( '<STR_LIT>' ) is not None : <EOL> logger . error ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> def shutdown ( signum , frame ) : <EOL> ssdp_server . shutdown ( ) <EOL> leap_server . sig_handler ( signum , frame ) <EOL> signal . signal ( signal . SIGTERM , shutdown ) <EOL> signal . signal ( signal . SIGINT , shutdown ) <EOL> ssdp_server = SSDPserver ( ) <EOL> ssdp_server . start ( Environment . interfaces ) <EOL> leap_server = LEAPserver ( ) <EOL> leap_server . start ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
