<s> import os <EOL> from waterbutler . core import metadata <EOL> class S3Metadata ( metadata . BaseMetadata ) : <EOL> @ property <EOL> def provider ( self ) : <EOL> return '<STR_LIT>' <EOL> @ property <EOL> def name ( self ) : <EOL> return os . path . split ( self . path ) [ <NUM_LIT:1> ] <EOL> class S3FileMetadataHeaders ( S3Metadata , metadata . BaseFileMetadata ) : <EOL> def __init__ ( self , path , headers ) : <EOL> self . _path = path <EOL> super ( ) . __init__ ( dict ( headers ) ) <EOL> @ property <EOL> def path ( self ) : <EOL> return '<STR_LIT:/>' + self . _path <EOL> @ property <EOL> def size ( self ) : <EOL> return self . raw [ '<STR_LIT>' ] <EOL> @ property <EOL> def content_type ( self ) : <EOL> return self . raw [ '<STR_LIT>' ] <EOL> @ property <EOL> def modified ( self ) : <EOL> return self . raw [ '<STR_LIT>' ] <EOL> @ property <EOL> def etag ( self ) : <EOL> return self . raw [ '<STR_LIT>' ] . replace ( '<STR_LIT:">' , '<STR_LIT>' ) <EOL> @ property <EOL> def extra ( self ) : <EOL> return { <EOL> '<STR_LIT>' : self . raw [ '<STR_LIT>' ] . replace ( '<STR_LIT:">' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' : self . raw . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> } <EOL> class S3FileMetadata ( S3Metadata , metadata . BaseFileMetadata ) : <EOL> @ property <EOL> def path ( self ) : <EOL> return '<STR_LIT:/>' + self . raw [ '<STR_LIT>' ] <EOL> @ property <EOL> def size ( self ) : <EOL> return int ( self . raw [ '<STR_LIT>' ] ) <EOL> @ property <EOL> def modified ( self ) : <EOL> return self . raw [ '<STR_LIT>' ] <EOL> @ property <EOL> def content_type ( self ) : <EOL> return None <EOL> @ property <EOL> def etag ( self ) : <EOL> return self . raw [ '<STR_LIT>' ] . replace ( '<STR_LIT:">' , '<STR_LIT>' ) <EOL> @ property <EOL> def extra ( self ) : <EOL> return { <EOL> '<STR_LIT>' : self . raw [ '<STR_LIT>' ] . replace ( '<STR_LIT:">' , '<STR_LIT>' ) <EOL> } <EOL> class S3FolderKeyMetadata ( S3Metadata , metadata . BaseFolderMetadata ) : <EOL> @ property <EOL> def name ( self ) : <EOL> return self . raw [ '<STR_LIT>' ] . split ( '<STR_LIT:/>' ) [ - <NUM_LIT:2> ] <EOL> @ property <EOL> def path ( self ) : <EOL> return '<STR_LIT:/>' + self . raw [ '<STR_LIT>' ] <EOL> class S3FolderMetadata ( S3Metadata , metadata . BaseFolderMetadata ) : <EOL> @ property <EOL> def name ( self ) : <EOL> return self . raw [ '<STR_LIT>' ] . split ( '<STR_LIT:/>' ) [ - <NUM_LIT:2> ] <EOL> @ property <EOL> def path ( self ) : <EOL> return '<STR_LIT:/>' + self . raw [ '<STR_LIT>' ] <EOL> class S3Revision ( metadata . BaseFileRevisionMetadata ) : <EOL> @ property <EOL> def version_identifier ( self ) : <EOL> return '<STR_LIT:version>' <EOL> @ property <EOL> def version ( self ) : <EOL> if self . raw [ '<STR_LIT>' ] == '<STR_LIT:true>' : <EOL> return '<STR_LIT>' <EOL> return self . raw [ '<STR_LIT>' ] <EOL> @ property <EOL> def modified ( self ) : <EOL> return self . raw [ '<STR_LIT>' ] <EOL> @ property <EOL> def extra ( self ) : <EOL> return { <EOL> '<STR_LIT>' : self . raw [ '<STR_LIT>' ] . replace ( '<STR_LIT:">' , '<STR_LIT>' ) <EOL> } </s>
