Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: recipe_engine/third_party/astunparse/__init__.py

Issue 2387763003: Add initial postprocess unit test thingy. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: recipe_engine/third_party/astunparse/__init__.py
diff --git a/recipe_engine/third_party/astunparse/__init__.py b/recipe_engine/third_party/astunparse/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..ddd64bed4c6ffb845df1084d5ccdb5fea483d7fa
--- /dev/null
+++ b/recipe_engine/third_party/astunparse/__init__.py
@@ -0,0 +1,20 @@
+# coding: utf-8
+from __future__ import absolute_import
+from six.moves import cStringIO
+from .unparser import Unparser
+from .printer import Printer
+
+
+__version__ = '1.4.0'
+
+
+def unparse(tree):
+ v = cStringIO()
+ Unparser(tree, file=v)
+ return v.getvalue()
+
+
+def dump(tree):
+ v = cStringIO()
+ Printer(file=v).visit(tree)
+ return v.getvalue()

Powered by Google App Engine
This is Rietveld 408576698