Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
160cae7
commit 7312518
Showing
6 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import asyncio | ||
from istsos.entity.rest.response import Response | ||
from istsos.actions.action import CompositeAction | ||
|
||
|
||
class PingApi(CompositeAction): | ||
|
||
@asyncio.coroutine | ||
def before(self, request): | ||
json = request.get_json() | ||
if 'message' in json: | ||
request['message'] = json['message'] | ||
yield from self.add_plugin("unit_conversion", "UnitConversionPost") | ||
|
||
@asyncio.coroutine | ||
def after(self, request): | ||
request['response'] = Response( | ||
json_source=Response.get_template({ | ||
"message": request["message"] | ||
}) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "unit_conversion", | ||
"version": "1.0.0", | ||
"author": "rahulworld", | ||
"author_email": "rahulnitsxr@gmail.com", | ||
"description": "This is an istSOS3 plugin", | ||
"license": "GPL3", | ||
"url": "http://example.com/unit_conversion/", | ||
"img": "http://example.com/unit_conversion/logo.png", | ||
"api": { | ||
"UNIT_CON_POST": [ | ||
"unit_conversion.action", "UNIT_CON_POSTApi" | ||
] | ||
} | ||
} |