Mercurial > p > roundup > code
diff roundup/rest.py @ 5556:d75aa88c2a99 REST-rebased
Added RestInstance and calling rest from client.py
committer: Ralf Schlatterbeck <rsc@runtux.com>
| author | Chau Nguyen <dangchau1991@yahoo.com> |
|---|---|
| date | Tue, 29 Jan 2019 15:27:37 +0100 |
| parents | |
| children | 213a56c91471 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/roundup/rest.py Tue Jan 29 15:27:37 2019 +0100 @@ -0,0 +1,24 @@ +# Restful API for Roundup +# +# This module is free software, you may redistribute it +# and/or modify under the same terms as Python. +# + +import json +import pprint + + +class RestfulInstance(object): + """Dummy Handler for REST + """ + + def __init__(self, db): + # TODO: database, translator and instance.actions + self.db = db + + def dispatch(self, method, uri, input): + print method + print uri + print type(input) + pprint.pprint(input) + return ' '.join([method, uri, pprint.pformat(input)])
