Skip to content

Commit 7df7e5b

Browse files
Merge pull request softlayer#1534 from ATGE/issues/1530-documentation-update
Fix code blocks formatting of The Solution section docs
2 parents 7c6fb21 + 3dcfff5 commit 7df7e5b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

docs/api/client.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,13 @@ The Solution
228228
Using the python dictionary's `.get() <https://docs.python.org/3/library/stdtypes.html#dict.get>`_ is great for non-nested items.
229229

230230
::
231+
231232
print("{}, {}".format(item.get('id'), item.get('hostName')))
232233

233234
Otherwise, this SDK provides a util function to do something similar. Each additional argument passed into `utils.lookup` will go one level deeper into the nested dictionary to find the item requested, returning `None` if a KeyError shows up.
234235

235236
::
237+
236238
itemId = SoftLayer.utils.lookup(item, 'id')
237239
itemHostname = SoftLayer.utils.lookup(item, 'hostName')
238240
print("{}, {}".format(itemId, itemHostname))

0 commit comments

Comments
 (0)