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

Side by Side Diff: third_party/google-endpoints/libpasteurize/fixes/fix_add_all_future_builtins.py

Issue 2666783008: Add google-endpoints to third_party/. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 """
2 For the ``future`` package.
3
4 Adds this import line::
5
6 from builtins import (ascii, bytes, chr, dict, filter, hex, input,
7 int, list, map, next, object, oct, open, pow,
8 range, round, str, super, zip)
9
10 to a module, irrespective of whether each definition is used.
11
12 Adds these imports after any other imports (in an initial block of them).
13 """
14
15 from __future__ import unicode_literals
16
17 from lib2to3 import fixer_base
18
19 from libfuturize.fixer_util import touch_import_top
20
21
22 class FixAddAllFutureBuiltins(fixer_base.BaseFix):
23 BM_compatible = True
24 PATTERN = "file_input"
25 run_order = 1
26
27 def transform(self, node, results):
28 # import_str = """(ascii, bytes, chr, dict, filter, hex, input,
29 # int, list, map, next, object, oct, open, pow,
30 # range, round, str, super, zip)"""
31 touch_import_top(u'builtins', '*', node)
32
33 # builtins = """ascii bytes chr dict filter hex input
34 # int list map next object oct open pow
35 # range round str super zip"""
36 # for builtin in sorted(builtins.split(), reverse=True):
37 # touch_import_top(u'builtins', builtin, node)
38
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698