pep8
This commit is contained in:
parent
bcbec29653
commit
d32059f301
16 changed files with 59 additions and 58 deletions
|
|
@ -20,28 +20,29 @@ class Table(object):
|
|||
|
||||
@property
|
||||
def describe(self):
|
||||
return {"Table": {
|
||||
"CreationDateTime": unix_time(self.created_at),
|
||||
"KeySchema": {
|
||||
"HashKeyElement": {
|
||||
"AttributeName": self.hash_key_attr,
|
||||
"AttributeType": self.hash_key_type
|
||||
return {
|
||||
"Table": {
|
||||
"CreationDateTime": unix_time(self.created_at),
|
||||
"KeySchema": {
|
||||
"HashKeyElement": {
|
||||
"AttributeName": self.hash_key_attr,
|
||||
"AttributeType": self.hash_key_type
|
||||
},
|
||||
"RangeKeyElement": {
|
||||
"AttributeName": self.range_key_attr,
|
||||
"AttributeType": self.range_key_type
|
||||
}
|
||||
},
|
||||
"RangeKeyElement": {
|
||||
"AttributeName": self.range_key_attr,
|
||||
"AttributeType": self.range_key_type
|
||||
}
|
||||
},
|
||||
"ProvisionedThroughput": {
|
||||
"ReadCapacityUnits": self.read_capacity,
|
||||
"WriteCapacityUnits": self.write_capacity
|
||||
},
|
||||
"TableName": self.name,
|
||||
"TableStatus": "ACTIVE",
|
||||
"ItemCount": 0,
|
||||
"TableSizeBytes": 0,
|
||||
"ProvisionedThroughput": {
|
||||
"ReadCapacityUnits": self.read_capacity,
|
||||
"WriteCapacityUnits": self.write_capacity
|
||||
},
|
||||
"TableName": self.name,
|
||||
"TableStatus": "ACTIVE",
|
||||
"ItemCount": 0,
|
||||
"TableSizeBytes": 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class DynamoDBBackend(BaseBackend):
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@ from .responses import handler
|
|||
|
||||
urls = {
|
||||
"https://dynamodb.us-east-1.amazonaws.com/": handler,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import datetime
|
||||
|
||||
|
||||
def unix_time(dt):
|
||||
epoch = datetime.datetime.utcfromtimestamp(0)
|
||||
delta = dt - epoch
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue