Remember your abc :)

  from collections import Mapping

  if isinstance(thing, Mapping):
      # Treat it like a dict.
      ...
  else:
      # Assume it's an iterable of (name, value) tuples.
      ...

Also, maascli.utils.urlencode is a less stupid version of
urllib.urlencode. It probably ought to move to apiclient.utils. Or the
standard library ;)

-- 
https://code.launchpad.net/~jameinel/maas/maasclient-multipart/+merge/128176
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~jameinel/maas/maasclient-multipart into lp:maas.

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to