Skip to content

Commit

Permalink
Better style in the code ( space = readability! )
Browse files Browse the repository at this point in the history
  • Loading branch information
koalalorenzo committed Aug 11, 2014
1 parent 54c5d3f commit f57a632
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions digitalocean/Domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,22 @@ def get_records(self):
# URL https://api.digitalocean.com/v2/domains/[NAME]/records/
records = []
data = self.get_data(
"domains/%s/records/" % self.name,,
"domains/%s/records/" % self.name,
type="GET",
params=data
)

for record_data in data['domain_records']:
record = Record(domain_name=self.name,
id=record_data.pop('id'))

record = Record(
domain_name=self.name,
id=record_data.pop('id')
)

for key, value in record_data.iteritems():
setattr(record, key, value)

record.token = self.token
records.append(record)

return records

0 comments on commit f57a632

Please sign in to comment.