Moving to astor.codegen
This commit is contained in:
parent
cdffc9d9d1
commit
10b887bbc8
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from hy.importer import (import_file_to_ast, import_file_to_module,
|
from hy.importer import (import_file_to_ast, import_file_to_module,
|
||||||
import_file_to_hst)
|
import_file_to_hst)
|
||||||
import codegen
|
import astor.codegen
|
||||||
import sys
|
import sys
|
||||||
import ast
|
import ast
|
||||||
|
|
||||||
@ -17,6 +17,6 @@ print ""
|
|||||||
print ast.dump(_ast)
|
print ast.dump(_ast)
|
||||||
print ""
|
print ""
|
||||||
print ""
|
print ""
|
||||||
print codegen.to_source(_ast)
|
print astor.codegen.to_source(_ast)
|
||||||
|
|
||||||
import_file_to_module("<STDIN>", sys.argv[1])
|
import_file_to_module("<STDIN>", sys.argv[1])
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
tox
|
tox
|
||||||
nose
|
nose
|
||||||
|
astor
|
||||||
flake8
|
flake8
|
||||||
codegen
|
|
||||||
coverage
|
coverage
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
flask
|
flask
|
||||||
|
astor
|
||||||
pygments
|
pygments
|
||||||
codegen
|
|
||||||
autopep8
|
autopep8
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
(import-from hy.importer import_string_to_ast)
|
(import-from hy.importer import_string_to_ast)
|
||||||
|
|
||||||
(import autopep8)
|
(import autopep8)
|
||||||
(import codegen)
|
(import astor.codegen)
|
||||||
|
|
||||||
|
|
||||||
(def app (Flask "__main__")) ; long story, needed hack
|
(def app (Flask "__main__")) ; long story, needed hack
|
||||||
@ -19,7 +19,8 @@
|
|||||||
|
|
||||||
|
|
||||||
(defn hy-to-py [hython]
|
(defn hy-to-py [hython]
|
||||||
(.fix-string autopep8 (.to_source codegen (import-string-to-ast hython))))
|
(.fix-string autopep8
|
||||||
|
(.to_source astor.codegen (import-string-to-ast hython))))
|
||||||
|
|
||||||
(defn err [msg] (make-response msg 500))
|
(defn err [msg] (make-response msg 500))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user