<s> import sys <EOL> import logging <EOL> import tornado . log <EOL> from tornado . options import options , define <EOL> from tornado . ioloop import IOLoop <EOL> from tornado . httpserver import HTTPServer <EOL> from crawl . application import Application <EOL> define ( '<STR_LIT:port>' , default = <NUM_LIT> , help = '<STR_LIT>' , type = int ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> logger = logging . getLogger ( ) <EOL> logger . setLevel ( logging . DEBUG ) <EOL> channel = logging . StreamHandler ( sys . stdout ) <EOL> options . parse_command_line ( ) <EOL> channel . setFormatter ( tornado . log . LogFormatter ( ) ) <EOL> logger . addHandler ( channel ) <EOL> http_server = HTTPServer ( Application ( ) ) <EOL> http_server . bind ( options . port ) <EOL> http_server . start ( ) <EOL> IOLoop . instance ( ) . start ( ) </s>
