def __init__(self, config, local_config=None):
super(ConnectionFactory, self).__init__()<EOL>self.config = config<EOL>if local_config is None:<EOL><INDENT>local_config = config<EOL><DEDENT>self.dsn = (<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>% local_config<EOL>)<EOL>self.operational_exceptions = (<EOL>psycopg2.OperationalError,<EOL>psycopg2.InterfaceError,<EOL>socket.timeout<EOL>)<EOL>self.conditional_exceptions = (<EOL>psycopg2.ProgrammingError,<EOL>)<EOL>self.pool = {}<EOL>
Initialize the parts needed to start making database connections

        parameters:
            config - the complete config for the app.  If a real app, this
                     would be where a logger or other resources could be
                     found.
            local_config - this is the namespace within the complete config
                           where the actual database parameters are found