<s> from django . conf import settings <EOL> from django . utils . encoding import filepath_to_uri <EOL> from restthumbnails . base import ThumbnailBase <EOL> import urlparse <EOL> class ThumbnailProxyBase ( ThumbnailBase ) : <EOL> @ property <EOL> def url ( self ) : <EOL> raise NotImplementedError <EOL> class ThumbnailProxy ( ThumbnailProxyBase ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , ** kwargs ) : <EOL> from restthumbnails import defaults <EOL> self . base_url = defaults . THUMBNAIL_PROXY_BASE_URL <EOL> super ( ThumbnailProxy , self ) . __init__ ( ** kwargs ) <EOL> @ property <EOL> def url ( self ) : <EOL> url = self . file_signature % { <EOL> '<STR_LIT:source>' : filepath_to_uri ( self . source ) , <EOL> '<STR_LIT:size>' : self . size_string , <EOL> '<STR_LIT>' : self . method , <EOL> '<STR_LIT>' : self . secret , <EOL> '<STR_LIT>' : self . extension } <EOL> return urlparse . urljoin ( self . base_url , url ) <EOL> class DummyImageProxy ( ThumbnailBase ) : <EOL> """<STR_LIT>""" <EOL> url_template = '<STR_LIT>' <EOL> @ property <EOL> def url ( self ) : <EOL> return self . url_template % { <EOL> '<STR_LIT:width>' : self . size [ <NUM_LIT:0> ] or self . size [ <NUM_LIT:1> ] , <EOL> '<STR_LIT>' : self . size [ <NUM_LIT:1> ] } </s>
