Moving to astor.codegen

This commit is contained in:
Paul R. Tagliamonte 2013-03-11 21:12:38 -04:00
parent cdffc9d9d1
commit 10b887bbc8
4 changed files with 7 additions and 6 deletions

View File

@ -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])

View File

@ -1,5 +1,5 @@
tox tox
nose nose
astor
flake8 flake8
codegen
coverage coverage

View File

@ -1,4 +1,4 @@
flask flask
astor
pygments pygments
codegen
autopep8 autopep8

View File

@ -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))