Skip to content

Commit d28a861

Browse files
author
Oleh Bahinskyi
committed
pep8
1 parent 65f6670 commit d28a861

File tree

2 files changed

+44
-44
lines changed

2 files changed

+44
-44
lines changed

examples/number_purchase.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,30 @@
1414
args = vars(parser.parse_args())
1515

1616
try:
17-
# Create a MessageBird client with the specified accessKey.
18-
client = messagebird.Client(args['accessKey'])
19-
20-
# Purchase number
21-
number = client.purchase_number('3197010240126', 'NL', 3)
22-
23-
# Print the object information.
24-
print('\nThe following information was returned as a Number object:\n')
25-
print(' number : %s' % number.number)
26-
print(' country : %s' % number.country)
27-
print(' region : %s' % number.region)
28-
print(' locality : %s' % number.locality)
29-
print(' features : %s' % number.features)
30-
print(' tags : %s' % number.tags)
31-
print(' type : %s' % number.type)
32-
print(' status : %s' % number.status)
17+
# Create a MessageBird client with the specified accessKey.
18+
client = messagebird.Client(args['accessKey'])
19+
20+
# Purchase number
21+
number = client.purchase_number('3197010240126', 'NL', 3)
22+
23+
# Print the object information.
24+
print('\nThe following information was returned as a Number object:\n')
25+
print(' number : %s' % number.number)
26+
print(' country : %s' % number.country)
27+
print(' region : %s' % number.region)
28+
print(' locality : %s' % number.locality)
29+
print(' features : %s' % number.features)
30+
print(' tags : %s' % number.tags)
31+
print(' type : %s' % number.type)
32+
print(' status : %s' % number.status)
3333

3434
except messagebird.client.ErrorException as e:
35-
print('\nAn error occured while requesting a NumberList object:\n')
35+
print('\nAn error occured while requesting a NumberList object:\n')
3636

37-
for error in e.errors:
38-
print(' code : %d' % error.code)
39-
print(' description : %s' % error.description)
40-
print(' parameter : %s\n' % error.parameter)
37+
for error in e.errors:
38+
print(' code : %d' % error.code)
39+
print(' description : %s' % error.description)
40+
print(' parameter : %s\n' % error.parameter)
4141

4242
except requests.exceptions.HTTPError as e:
4343
print('\nAn HTTP exception occurred while fetching all purchased phone numbers:')

examples/number_update.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,32 @@
1414
args = vars(parser.parse_args())
1515

1616
try:
17-
# Create a MessageBird client with the specified accessKey.
18-
client = messagebird.Client(args['accessKey'])
19-
20-
# Update number
21-
# Note: at the moment, we only support updating tags that can be used to group or label numbers
22-
tags = ['tag1']
23-
number = client.update_number('3197010240126', tags)
24-
25-
# Print the object information.
26-
print('\nThe following information was returned as a Number object:\n')
27-
print(' number : %s' % number.number)
28-
print(' country : %s' % number.country)
29-
print(' region : %s' % number.region)
30-
print(' locality : %s' % number.locality)
31-
print(' features : %s' % number.features)
32-
print(' tags : %s' % number.tags)
33-
print(' type : %s' % number.type)
34-
print(' status : %s' % number.status)
17+
# Create a MessageBird client with the specified accessKey.
18+
client = messagebird.Client(args['accessKey'])
19+
20+
# Update number
21+
# Note: at the moment, we only support updating tags that can be used to group or label numbers
22+
tags = ['tag1']
23+
number = client.update_number('3197010240126', tags)
24+
25+
# Print the object information.
26+
print('\nThe following information was returned as a Number object:\n')
27+
print(' number : %s' % number.number)
28+
print(' country : %s' % number.country)
29+
print(' region : %s' % number.region)
30+
print(' locality : %s' % number.locality)
31+
print(' features : %s' % number.features)
32+
print(' tags : %s' % number.tags)
33+
print(' type : %s' % number.type)
34+
print(' status : %s' % number.status)
3535

3636
except messagebird.client.ErrorException as e:
37-
print('\nAn error occured while requesting a NumberList object:\n')
37+
print('\nAn error occured while requesting a NumberList object:\n')
3838

39-
for error in e.errors:
40-
print(' code : %d' % error.code)
41-
print(' description : %s' % error.description)
42-
print(' parameter : %s\n' % error.parameter)
39+
for error in e.errors:
40+
print(' code : %d' % error.code)
41+
print(' description : %s' % error.description)
42+
print(' parameter : %s\n' % error.parameter)
4343

4444
except requests.exceptions.HTTPError as e:
4545
print('\nAn HTTP exception occurred while fetching all purchased phone numbers:')

0 commit comments

Comments
 (0)