<s> """<STR_LIT>""" <EOL> import sys <EOL> import socket <EOL> import Bcfg2 . Options <EOL> from Bcfg2 . Client import Client <EOL> from Bcfg2 . Server . Core import Core <EOL> class LocalCore ( Core ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> Bcfg2 . Server . Core . BaseCore . __init__ ( self ) <EOL> self . load_plugins ( ) <EOL> self . block_for_fam_events ( handle_events = True ) <EOL> def _daemonize ( self ) : <EOL> return True <EOL> def _run ( self ) : <EOL> return True <EOL> def _block ( self ) : <EOL> pass <EOL> class LocalProxy ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , core ) : <EOL> self . core = core <EOL> self . hostname = socket . gethostname ( ) <EOL> self . ipaddr = socket . gethostbyname ( self . hostname ) <EOL> def __getattr__ ( self , attr ) : <EOL> if hasattr ( self . core , attr ) : <EOL> func = getattr ( self . core , attr ) <EOL> if func . exposed : <EOL> def inner ( * args , ** kwargs ) : <EOL> args = ( ( self . ipaddr , <NUM_LIT> ) , ) + args <EOL> return func ( * args , ** kwargs ) <EOL> return inner <EOL> raise AttributeError ( attr ) <EOL> class LocalClient ( Client ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , proxy ) : <EOL> Client . __init__ ( self ) <EOL> self . _proxy = proxy <EOL> def main ( ) : <EOL> parser = Bcfg2 . Options . Parser ( <EOL> description = "<STR_LIT>" <EOL> "<STR_LIT>" , <EOL> conflict_handler = "<STR_LIT>" , <EOL> components = [ LocalCore , LocalProxy , LocalClient ] ) <EOL> parser . parse ( ) <EOL> core = LocalCore ( ) <EOL> try : <EOL> LocalClient ( LocalProxy ( core ) ) . run ( ) <EOL> finally : <EOL> core . shutdown ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> sys . exit ( main ( ) ) </s>
