<s> """<STR_LIT>""" <EOL> from __future__ import unicode_literals <EOL> from psycopg2 import Binary <EOL> from psycopg2 . extensions import ISQLQuote <EOL> class PostGISAdapter ( object ) : <EOL> def __init__ ( self , geom ) : <EOL> "<STR_LIT>" <EOL> self . ewkb = bytes ( geom . ewkb ) <EOL> self . srid = geom . srid <EOL> self . _adapter = Binary ( self . ewkb ) <EOL> def __conform__ ( self , proto ) : <EOL> if proto == ISQLQuote : <EOL> return self <EOL> else : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> def __eq__ ( self , other ) : <EOL> if not isinstance ( other , PostGISAdapter ) : <EOL> return False <EOL> return ( self . ewkb == other . ewkb ) and ( self . srid == other . srid ) <EOL> def __str__ ( self ) : <EOL> return self . getquoted ( ) <EOL> def prepare ( self , conn ) : <EOL> """<STR_LIT>""" <EOL> self . _adapter . prepare ( conn ) <EOL> def getquoted ( self ) : <EOL> "<STR_LIT>" <EOL> return str ( '<STR_LIT>' % self . _adapter . getquoted ( ) . decode ( ) ) <EOL> def prepare_database_save ( self , unused ) : <EOL> return self </s>
