diff --git a/plugins/cdecl.py b/plugins/cdecl.py new file mode 100644 index 0000000..b04b9c9 --- /dev/null +++ b/plugins/cdecl.py @@ -0,0 +1,7 @@ +from util import hook, http + + +@hook.command +def cdecl(inp): + '''.cdecl -- translate between C declarations and English, using cdecl.org''' + return http.get("http://cdecl.org/query.php", q=inp) diff --git a/plugins/explain.py b/plugins/explain.py deleted file mode 100644 index 364605a..0000000 --- a/plugins/explain.py +++ /dev/null @@ -1,14 +0,0 @@ -from util import hook -from pycparser.cdecl import explain_c_declaration - - -@hook.command -def explain(inp): - ".explain -- gives an explanation of C expression" - - inp = inp.encode('utf8', 'ignore') - - try: - return explain_c_declaration(inp) - except Exception, e: - return 'error: %s' % e diff --git a/requirements.txt b/requirements.txt index 2ea4d03..ab90481 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ lxml -pycparser