diff options
author | Christian Heimes <christian@cheimes.de> | 2008-05-06 23:48:04 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-05-06 23:48:04 (GMT) |
commit | 75ca4ea6e1416d87745298ca7b57bb3cbd95376a (patch) | |
tree | 628374d630b8f33adf0a4483e5762abddb07ffaa /Misc/TextMate/Python-Dev.tmbundle/Commands/2 to 3 - Module Deletion.tmCommand | |
parent | 4833b3c37fc0d33f8f3f37a9b7526150a7c64b8c (diff) | |
download | cpython-75ca4ea6e1416d87745298ca7b57bb3cbd95376a.zip cpython-75ca4ea6e1416d87745298ca7b57bb3cbd95376a.tar.gz cpython-75ca4ea6e1416d87745298ca7b57bb3cbd95376a.tar.bz2 |
Merged revisions 62792,62799-62800 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r62792 | brett.cannon | 2008-05-07 01:22:02 +0200 (Wed, 07 May 2008) | 2 lines
When testing a module's __all__, we really don't care if it is deprecated.
........
r62799 | christian.heimes | 2008-05-07 01:42:58 +0200 (Wed, 07 May 2008) | 1 line
Disabled some unit tests for the upcoming release. See #2777
........
r62800 | brett.cannon | 2008-05-07 01:44:04 +0200 (Wed, 07 May 2008) | 2 lines
Create a TextMate directory in Misc to house a Python-Dev bundle.
........
Diffstat (limited to 'Misc/TextMate/Python-Dev.tmbundle/Commands/2 to 3 - Module Deletion.tmCommand')
-rw-r--r-- | Misc/TextMate/Python-Dev.tmbundle/Commands/2 to 3 - Module Deletion.tmCommand | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Misc/TextMate/Python-Dev.tmbundle/Commands/2 to 3 - Module Deletion.tmCommand b/Misc/TextMate/Python-Dev.tmbundle/Commands/2 to 3 - Module Deletion.tmCommand new file mode 100644 index 0000000..31b8837 --- /dev/null +++ b/Misc/TextMate/Python-Dev.tmbundle/Commands/2 to 3 - Module Deletion.tmCommand @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>beforeRunningCommand</key> + <string>nop</string> + <key>command</key> + <string>#!/usr/bin/python + +template = """from warnings import warnpy3k +warnpy3k("the ${1:%s} module has been removed in Python 3.0", stacklevel=2) +del warnpy3k +$0""" + +import imp +import os + +file_name = os.path.split(os.environ['TM_FILEPATH'])[1] +for suffix in (tuple_[0] for tuple_ in imp.get_suffixes()): + if not file_name.endswith(suffix): + continue + module_name = file_name[:-len(suffix)] + print (template % module_name), + break +else: + print (template % "XXX"),</string> + <key>input</key> + <string>none</string> + <key>name</key> + <string>2 to 3 - Module Deletion</string> + <key>output</key> + <string>insertAsSnippet</string> + <key>tabTrigger</key> + <string>2to3moddel</string> + <key>uuid</key> + <string>9519C22B-6AB8-41A1-94F6-079E0B45C147</string> +</dict> +</plist> |