Difficult to use for arbitrary URLs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
piston-mini-client |
Triaged
|
Undecided
|
Unassigned |
Bug Description
piston_mini_client is great for implementing multiple methods against a single service. However, there are cases where we want to do almost everything that piston_mini_client does, but without the service_root + '/' + path logic: we just want to hit a URL with some method and some data.
To do that at the moment, one has to write something like this::
class SingleURLAPI(
def __init__(self, url, auth=None, disable_
def _path2url(self, path, scheme):
# We don't want the service_root + '/' + path behaviour.
return self._service_root
def put(self, data):
return self._put(None, data)
I suggest that piston_mini_client extracts most of PistonAPI into a separate class, say PistonRequest, that implements public methods for each request method type and does what _put, _get, etc. do now. Then PistonAPI can be a class intended to be subclassed for API definitions.
Related branches
- software-store-developers: Pending requested
-
Diff: 347 lines (+209/-47) (has conflicts)1 file modifiedpiston_mini_client/__init__.py (+209/-47)
- Anthony Lenton: Approve
-
Diff: 778 lines (+444/-184)4 files modifiedpiston_mini_client/__init__.py (+427/-182)
piston_mini_client/tests/test_failhandlers.py (+15/-0)
piston_mini_client/tests/test_log_to_file.py (+1/-1)
setup.py (+1/-1)
Changed in piston-mini-client: | |
status: | New → In Progress |
assignee: | nobody → Jonathan Lange (jml) |
The linked branch is a rough sketch of what I mean.