From 10b887bbc805a38298dcdea1ac469d2d197a4bac Mon Sep 17 00:00:00 2001 From: "Paul R. Tagliamonte" Date: Mon, 11 Mar 2013 21:12:38 -0400 Subject: [PATCH] Moving to astor.codegen --- bin/hy2py | 4 ++-- requirements-dev.txt | 2 +- requirements-site.txt | 2 +- site/app.hy | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/hy2py b/bin/hy2py index bc7a787..9894ec5 100755 --- a/bin/hy2py +++ b/bin/hy2py @@ -2,7 +2,7 @@ from hy.importer import (import_file_to_ast, import_file_to_module, import_file_to_hst) -import codegen +import astor.codegen import sys import ast @@ -17,6 +17,6 @@ print "" print ast.dump(_ast) print "" print "" -print codegen.to_source(_ast) +print astor.codegen.to_source(_ast) import_file_to_module("", sys.argv[1]) diff --git a/requirements-dev.txt b/requirements-dev.txt index 38feca4..4a413a4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ tox nose +astor flake8 -codegen coverage diff --git a/requirements-site.txt b/requirements-site.txt index 9a970d1..9e82a3d 100644 --- a/requirements-site.txt +++ b/requirements-site.txt @@ -1,4 +1,4 @@ flask +astor pygments -codegen autopep8 diff --git a/site/app.hy b/site/app.hy index 3377b08..130dd49 100644 --- a/site/app.hy +++ b/site/app.hy @@ -11,7 +11,7 @@ (import-from hy.importer import_string_to_ast) (import autopep8) -(import codegen) +(import astor.codegen) (def app (Flask "__main__")) ; long story, needed hack @@ -19,7 +19,8 @@ (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))