add cdecl, remove explain. fixes #108
This commit is contained in:
parent
c14cc2d1b0
commit
e2bcd6aea0
|
@ -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)
|
|
@ -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
|
|
|
@ -1,2 +1 @@
|
||||||
lxml
|
lxml
|
||||||
pycparser
|
|
||||||
|
|
Loading…
Reference in New Issue