summaryrefslogtreecommitdiff
path: root/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers
diff options
context:
space:
mode:
authordarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2012-04-16 22:12:42 +0000
committerdarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>2012-04-16 22:12:42 +0000
commit4710c53dcad1ebf3755f3efb9e80ac24bd72a9b2 (patch)
tree2d17d2388a78082e32f6a97120d707328143543b /AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers
parentcbc6b5e54599c7391ece99ad3c5313f4dd4ddda6 (diff)
downloadedk2-platforms-4710c53dcad1ebf3755f3efb9e80ac24bd72a9b2.tar.xz
AppPkg/Applications/Python: Add Python 2.7.2 sources since the release of Python 2.7.3 made them unavailable from the python.org web site.
These files are a subset of the python-2.7.2.tgz distribution from python.org. Changed files from PyMod-2.7.2 have been copied into the corresponding directories of this tree, replacing the original files in the distribution. Signed-off-by: daryl.mcdaniel@intel.com git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13197 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers')
-rw-r--r--AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/bad_order.py5
-rw-r--r--AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/__init__.py0
-rw-r--r--AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_explicit.py6
-rw-r--r--AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_first.py6
-rw-r--r--AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_last.py7
-rw-r--r--AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_parrot.py13
-rw-r--r--AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_preorder.py6
-rw-r--r--AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/no_fixer_cls.py1
-rw-r--r--AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/parrot_example.py2
9 files changed, 46 insertions, 0 deletions
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/bad_order.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/bad_order.py
new file mode 100644
index 0000000000..5b4d0b5daa
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/bad_order.py
@@ -0,0 +1,5 @@
+from lib2to3.fixer_base import BaseFix
+
+class FixBadOrder(BaseFix):
+
+ order = "crazy"
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/__init__.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/__init__.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_explicit.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_explicit.py
new file mode 100644
index 0000000000..06c3a9779b
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_explicit.py
@@ -0,0 +1,6 @@
+from lib2to3.fixer_base import BaseFix
+
+class FixExplicit(BaseFix):
+ explicit = True
+
+ def match(self): return False
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_first.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_first.py
new file mode 100644
index 0000000000..84d545b0b0
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_first.py
@@ -0,0 +1,6 @@
+from lib2to3.fixer_base import BaseFix
+
+class FixFirst(BaseFix):
+ run_order = 1
+
+ def match(self, node): return False
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_last.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_last.py
new file mode 100644
index 0000000000..ddf8618eb1
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_last.py
@@ -0,0 +1,7 @@
+from lib2to3.fixer_base import BaseFix
+
+class FixLast(BaseFix):
+
+ run_order = 10
+
+ def match(self, node): return False
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_parrot.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_parrot.py
new file mode 100644
index 0000000000..b6d7c20bfe
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_parrot.py
@@ -0,0 +1,13 @@
+from lib2to3.fixer_base import BaseFix
+from lib2to3.fixer_util import Name
+
+class FixParrot(BaseFix):
+ """
+ Change functions named 'parrot' to 'cheese'.
+ """
+
+ PATTERN = """funcdef < 'def' name='parrot' any* >"""
+
+ def transform(self, node, results):
+ name = results["name"]
+ name.replace(Name("cheese", name.prefix))
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_preorder.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_preorder.py
new file mode 100644
index 0000000000..198c41f48b
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/myfixes/fix_preorder.py
@@ -0,0 +1,6 @@
+from lib2to3.fixer_base import BaseFix
+
+class FixPreorder(BaseFix):
+ order = "pre"
+
+ def match(self, node): return False
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/no_fixer_cls.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/no_fixer_cls.py
new file mode 100644
index 0000000000..3742803442
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/no_fixer_cls.py
@@ -0,0 +1 @@
+# This is empty so trying to fetch the fixer class gives an AttributeError
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/parrot_example.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/parrot_example.py
new file mode 100644
index 0000000000..2ebdf89dfd
--- /dev/null
+++ b/AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/tests/data/fixers/parrot_example.py
@@ -0,0 +1,2 @@
+def parrot():
+ pass