<s> from circuits import handler , Component <EOL> from circuits . web . errors import Forbidden <EOL> from circuits . web import Server , Controller <EOL> class ACL ( Component ) : <EOL> allowed = [ "<STR_LIT:127.0.0.1>" ] <EOL> @ handler ( "<STR_LIT>" , priority = <NUM_LIT:1.0> ) <EOL> def on_request ( self , event , request , response ) : <EOL> """<STR_LIT>""" <EOL> if not request . remote . ip in self . allowed : <EOL> event . stop ( ) <EOL> return Forbidden ( request , response ) <EOL> class Root ( Controller ) : <EOL> def index ( self ) : <EOL> return "<STR_LIT>" <EOL> app = Server ( ( "<STR_LIT>" , <NUM_LIT> ) ) <EOL> ACL ( ) . register ( app ) <EOL> Root ( ) . register ( app ) <EOL> app . run ( ) </s>
