"""
Contains UW Bookstore DAO implementations.
"""

from restclients.dao_implementation.live import get_con_pool, get_live_url
from restclients.dao_implementation.mock import get_mockdata_url

class File(object):
    """
    The File DAO implementation returns generally static content.  Use this
    DAO with this configuration:

    RESTCLIENTS_BOOK_DAO_CLASS = 'restclients.dao_implementation.book.File'
    """
    def getURL(self, url, headers):
        return get_mockdata_url("book", "file", url, headers)

class Live(object):
    """
    This DAO provides real data.
    Access is controlled by IP address.
    """
    pool = None

    def getURL(self, url, headers):
        if Live.pool == None:
            Live.pool = get_con_pool('http://www3.bookstore.washington.edu/',
                                     None, None)
        return get_live_url (Live.pool, 'GET', 
                             'http://www3.bookstore.washington.edu/', 
                             url, headers=headers)


@@ -681,67 +681,15 @@
     
-if Live.pool == None:%0A            Live.pool = get_con_pool(
+host = 
 'htt
@@ -723,17 +723,16 @@
 on.edu/'
-,
 %0A       
@@ -736,36 +736,72 @@
     
-                            
+if Live.pool == None:%0A            Live.pool = get_con_pool(host,
  Non
@@ -890,78 +890,13 @@
     
-'http://www3.bookstore.washington.edu/', %0A                            
+host,
  url

refactor getURL function.