Skip to content

Commit

Permalink
Fix indentation and linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
deyk committed Oct 20, 2016
1 parent 3a5ffdd commit 4d8305a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions duo.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ def __init__(cls, name, bases, attrs):
setattr(cls.__class__, cls.__name__, cls)
cls.key = cls.__name__

### MAGIC METHODS: These magic methods are on the *type*, and
### because a class is an instantiation of a type, they're usable
### on classes of this type. Yes, that's right, you can cast your
### subclass to an integer.
# MAGIC METHODS: These magic methods are on the *type*, and
# because a class is an instantiation of a type, they're usable
# on classes of this type. Yes, that's right, you can cast your
# subclass to an integer.
def __iter__(cls):
return iter(cls.members)

Expand Down Expand Up @@ -192,7 +192,7 @@ def connection(self):
self._connection = boto.connect_dynamodb(
aws_access_key_id=self.key,
aws_secret_access_key=self.secret
)
)
return self._connection

def reset(self):
Expand Down Expand Up @@ -426,7 +426,7 @@ def create(self, hash_key, range_key=None, **kwargs):
range_key = range_key,
attrs = kwargs,
item_class = Item._table_types[self.table_name],
)
)
return self._extend(item, is_new=True)

def _extend(self, item, is_new=False):
Expand Down Expand Up @@ -472,7 +472,7 @@ def _get_cache(self, hash_key, range_key=None):
hash_key = hash_key,
range_key = range_key,
attrs = dict(cached)
))
))
return cached

def get_item(self, hash_key, range_key=None, **params):
Expand All @@ -482,8 +482,8 @@ def get_item(self, hash_key, range_key=None, **params):
range_key = range_key,
item_class = Item._table_types[self.table_name],
**params
)
)
)
item._set_cache()
return item

Expand Down Expand Up @@ -719,4 +719,4 @@ def from_python(self, obj, value):
return json.dumps({
'table': value.table_name,
'key': value.dynamo_key
})
})
6 changes: 3 additions & 3 deletions test_duo.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DynamoDBTests(unittest.TestCase):
item_attrs = {},
key = 'foo',
secret = 'bar',
)
)

def setUp(self):
super(DynamoDBTests, self).setUp()
Expand Down Expand Up @@ -70,9 +70,9 @@ def mock_item_data(self):
"Item": {
self.hash_key_name: self.hash_key_value,
self.range_key_name: self.range_key_value
},
},
"ConsumedCapacityUnits": 1
}
}
data['Item'].update(self.item_attrs)
return data

Expand Down

0 comments on commit 4d8305a

Please sign in to comment.