Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Updated listing for specifying resource #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pyonep/onep.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,14 @@ def info(self, auth, resource, options={}, defer=False):

def listing(self, auth, types, options=None, resource=None, defer=False):
"""This provides backward compatibility with two
previous variants of listing. To use the non-deprecated
API, pass both options and resource."""
if options is None:
# This variant is deprecated
previous variants of listing.
"""
if options is None and resource is None:
# this variant is deprecated
return self._call('listing', auth, [types], defer)
else:
if options is None:
options = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be

options = {}

if resource is None:
# This variant is deprecated, too
return self._call('listing',
Expand Down