add cdecl, remove explain. fixes #108

This commit is contained in:
Ryan Hitchman 2014-05-09 21:35:33 -07:00
parent c14cc2d1b0
commit e2bcd6aea0
3 changed files with 7 additions and 15 deletions

7
plugins/cdecl.py Normal file
View File

@ -0,0 +1,7 @@
from util import hook, http
@hook.command
def cdecl(inp):
'''.cdecl <expr> -- translate between C declarations and English, using cdecl.org'''
return http.get("http://cdecl.org/query.php", q=inp)

View File

@ -1,14 +0,0 @@
from util import hook
from pycparser.cdecl import explain_c_declaration
@hook.command
def explain(inp):
".explain <c expression> -- gives an explanation of C expression"
inp = inp.encode('utf8', 'ignore')
try:
return explain_c_declaration(inp)
except Exception, e:
return 'error: %s' % e

View File

@ -1,2 +1 @@
lxml
pycparser