mirror of
https://github.com/python/cpython.git
synced 2024-12-15 04:44:47 +08:00
a79e33e039
svn+ssh://pythondev@svn.python.org/python/trunk ........ r62954 | martin.v.loewis | 2008-05-09 16:11:37 -0400 (Fri, 09 May 2008) | 1 line Port to VS 2008. Drop W9x support. ........ r62957 | benjamin.peterson | 2008-05-09 17:30:26 -0400 (Fri, 09 May 2008) | 2 lines In stdtypes.rst, move methods under class directives where applicable ........ r62958 | brett.cannon | 2008-05-09 17:30:36 -0400 (Fri, 09 May 2008) | 2 lines Add a todo list to the module deletion command. ........ r62963 | brett.cannon | 2008-05-09 18:52:28 -0400 (Fri, 09 May 2008) | 2 lines Add support for extension modules in 3.0 deprection command. ........ r62967 | brett.cannon | 2008-05-09 22:25:00 -0400 (Fri, 09 May 2008) | 2 lines Fix some errors in the deprecation warnings for new and user. ........ r62975 | brett.cannon | 2008-05-09 22:54:52 -0400 (Fri, 09 May 2008) | 3 lines Suppress deprecations for packages as well when using test.test_support.import_module(). ........ r62976 | brett.cannon | 2008-05-09 22:57:03 -0400 (Fri, 09 May 2008) | 2 lines Also ignore package deprecations. ........ r62982 | benjamin.peterson | 2008-05-09 23:08:17 -0400 (Fri, 09 May 2008) | 2 lines Add the examples in the json module docstring as a doctest ........ r62992 | martin.v.loewis | 2008-05-10 09:24:09 -0400 (Sat, 10 May 2008) | 2 lines Explicitly refer to current hhp file (2.6a3) ........ r62993 | skip.montanaro | 2008-05-10 10:48:49 -0400 (Sat, 10 May 2008) | 2 lines Note the PyPI-edness of bsddb185 for people who might still need it. ........ r62994 | andrew.kuchling | 2008-05-10 13:36:24 -0400 (Sat, 10 May 2008) | 1 line Docstring typo ........ r62995 | andrew.kuchling | 2008-05-10 13:37:05 -0400 (Sat, 10 May 2008) | 1 line Document the 'line' argument ........ r62996 | andrew.kuchling | 2008-05-10 13:48:45 -0400 (Sat, 10 May 2008) | 1 line #1625509: describe behaviour of import lock ........
65 lines
1.9 KiB
Plaintext
65 lines
1.9 KiB
Plaintext
<?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
|
|
"""Generate code to warn about a module's removal in Python 3.0.
|
|
|
|
XXX Not supported:
|
|
- Module's in a package do not have their full name generated.
|
|
- Package's __init__ module; should detect and use the package's name instead.
|
|
|
|
"""
|
|
py_template = """from warnings import warnpy3k
|
|
warnpy3k("the ${1:%s} module has been removed in Python 3.0", stacklevel=2)
|
|
del warnpy3k$0"""
|
|
|
|
c_template = """
|
|
if (PyErr_WarnPy3k("the ${1:%s} module has been removed in "
|
|
"Python 3.0", 2) < 0)
|
|
return;$0"""
|
|
|
|
|
|
import imp
|
|
import os
|
|
|
|
file_name = os.path.split(os.environ['TM_FILEPATH'])[1]
|
|
|
|
py_suffixes = reversed(sorted((suffix[0] for suffix in imp.get_suffixes() if suffix[2] == imp.PY_SOURCE), key=len))
|
|
c_suffixes = reversed(sorted((os.path.splitext(suffix[0])[0] + '.c'
|
|
for suffix in imp.get_suffixes() if suffix[2] == imp.C_EXTENSION), key=len))
|
|
|
|
pairings = ((py_suffixes, py_template), (c_suffixes, c_template))
|
|
|
|
def create_template(suffixes, template):
|
|
for suffix in suffixes:
|
|
if not file_name.endswith(suffix):
|
|
continue
|
|
module_name = file_name[:-len(suffix)]
|
|
return template % module_name
|
|
else:
|
|
return None
|
|
|
|
for template in (create_template(*pair) for pair in pairings):
|
|
if not template:
|
|
continue
|
|
print template,
|
|
break
|
|
else:
|
|
print 'XXX Could not generate code.'</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>
|