[csw-devel] SF.net SVN: gar:[13745] csw/mgar/pkg/lang-python/python/trunk

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sat Mar 12 11:49:03 CET 2011


Revision: 13745
          http://gar.svn.sourceforge.net/gar/?rev=13745&view=rev
Author:   wahwah
Date:     2011-03-12 10:49:03 +0000 (Sat, 12 Mar 2011)

Log Message:
-----------
python: Using system ffi and some more fixes

/usr/local fixes, among others.

Modified Paths:
--------------
    csw/mgar/pkg/lang-python/python/trunk/Makefile
    csw/mgar/pkg/lang-python/python/trunk/checksums

Added Paths:
-----------
    csw/mgar/pkg/lang-python/python/trunk/files/0010-Hardcoding-the-use-of-libffi.patch
    csw/mgar/pkg/lang-python/python/trunk/files/0011-OpenCSW-specific-libffi-include-dir.patch
    csw/mgar/pkg/lang-python/python/trunk/files/0013-Use-opt-csw-bin-python-in-cgi.py.patch
    csw/mgar/pkg/lang-python/python/trunk/files/0015-Adding-opt-csw-lib-to-dyld.py.patch
    csw/mgar/pkg/lang-python/python/trunk/files/0016-CSW-mimetypes.patch
    csw/mgar/pkg/lang-python/python/trunk/files/0017-Random-insignificant-removals-of-usr-local.patch
    csw/mgar/pkg/lang-python/python/trunk/files/0018-Removing-usr-local-from-mailcap.patch

Modified: csw/mgar/pkg/lang-python/python/trunk/Makefile
===================================================================
--- csw/mgar/pkg/lang-python/python/trunk/Makefile	2011-03-11 20:16:14 UTC (rev 13744)
+++ csw/mgar/pkg/lang-python/python/trunk/Makefile	2011-03-12 10:49:03 UTC (rev 13745)
@@ -3,6 +3,11 @@
 NAME = Python
 VERSION = 2.6.6
 CATEGORIES = lang
+VER = 2.6
+DVER = 2-6
+UVER = 2_6
+PVER = python$(VER)
+CVER =
 
 # Known issues:
 #
@@ -30,7 +35,6 @@
 
 DISTFILES  = $(DISTNAME).tar.bz2
 
-# We define upstream file regex so we can be notifed of new upstream software release
 UFILES_REGEX = $(NAME)-(\d+(?:\.\d+)*).tar.bz2
 
 # Patches
@@ -43,6 +47,14 @@
 PATCHFILES += python-config-in.diff
 PATCHFILES += setup.diff
 PATCHFILES += 0001-FFI_DEFAULT_ABI-to-use-__i386.patch
+# PATCHFILES += 0010-Hardcoding-the-use-of-libffi.patch
+# PATCHFILES += 0011-OpenCSW-specific-libffi-include-dir.patch
+# PATCHFILES += 0012-temporary-hack-to-compile-against-system-ffi.patch
+PATCHFILES += 0013-Use-opt-csw-bin-python-in-cgi.py.patch
+PATCHFILES += 0015-Adding-opt-csw-lib-to-dyld.py.patch
+PATCHFILES += 0016-CSW-mimetypes.patch
+PATCHFILES += 0017-Random-insignificant-removals-of-usr-local.patch
+PATCHFILES += 0018-Removing-usr-local-from-mailcap.patch
 
 # Test for sunaudiodev fails.
 SKIPTEST = 1
@@ -50,6 +62,14 @@
 EXTRA_INC += $(prefix)/bdb47/include
 EXTRA_LIB += $(prefix)/bdb47/lib
 
+# There is a file name conflict over libffi.so symlink between libffi package
+# and a gcc-java package.  While it will ultimately belong to libffi_dev, the
+# symlink is currently under a subdirectory.
+# pkgchk -L CSWlibffi-dev
+# (...)
+# /opt/csw/lib/ffi/libffi.so=../libffi.so.5.0.10 s none CSWlibffi-dev
+EXTRA_LIB += $(libdir)/ffi
+
 BASECFLAGS = $(CFLAGS)
 EXTRA_COMMON_EXPORTS = BASECFLAGS
 
@@ -69,92 +89,109 @@
 # use prototype filters to set the class 
 PROTOTYPE_FILTER = awk '$$$$3 ~/.*\.py$$$$/ { $$$$2 = "cswpycompile" } { print }'
 
-PACKAGES  = CSWidle
-PACKAGES += CSWpython
-PACKAGES += CSWpython-devel
-PACKAGES += CSWpython-test
-PACKAGES += CSWpython-tk
-PACKAGES += CSWlibpython2-6-1-0
+PACKAGES  = CSWidle$(CVER)
+PACKAGES += CSWpython$(CVER)
+PACKAGES += CSWpython$(CVER)-devel
+PACKAGES += CSWpython$(CVER)-test
+PACKAGES += CSWpython$(CVER)-tk
+PACKAGES += CSWlibpython$(DVER)-1-0
 
-INCOMPATIBLE_PKGS_CSWpython = CSWpydistutils
+INCOMPATIBLE_PKGS_CSWpython$(CVER) = CSWpydistutils
 
-PKGFILES_CSWidle  = $(libdir)/.*/idlelib/.*
-PKGFILES_CSWidle += $(bindir)/idle
-PKGFILES_CSWpython-devel  = $(includedir)/.*
-PKGFILES_CSWpython-devel += $(libdir)/.*/config/.*
-PKGFILES_CSWpython-devel += $(bindir)/.*config.*
-PKGFILES_CSWpython-devel += $(libdir)/libpython2.6.so
+PKGFILES_CSWidle$(CVER)  = $(libdir)/.*/idlelib/.*
+PKGFILES_CSWidle$(CVER) += $(bindir)/idle
+PKGFILES_CSWpython$(CVER)-devel  = $(includedir)/.*
+PKGFILES_CSWpython$(CVER)-devel += $(libdir)/.*/config/.*
+PKGFILES_CSWpython$(CVER)-devel += $(bindir)/.*config.*
+PKGFILES_CSWpython-devel += $(libdir)/libpython$(VER).so
 # No idea why would this be in CSWpython, and no good idea for a better package
 # to put it.
-PKGFILES_CSWpython-devel += $(bindir)/smtpd.py
-PKGFILES_CSWpython-tk  = $(libdir)/.*/lib-tk/.*
-PKGFILES_CSWpython-tk += $(libdir)/.*/lib-dynload/_tkinter.so.*
-PKGFILES_CSWpython-test  = $(libdir)/python/test/.*
-PKGFILES_CSWpython-test += $(libdir)/python/bsddb/test.*
-PKGFILES_CSWpython-test += $(libdir)/python/ctypes/test.*
-PKGFILES_CSWpython-test += $(libdir)/python/email/test.*
-PKGFILES_CSWpython-test += $(libdir)/python/distutils/tests.*
-PKGFILES_CSWpython-test += $(libdir)/python/json/tests.*
-PKGFILES_CSWpython-test += $(libdir)/python/lib2to3/tests.*
-PKGFILES_CSWpython-test += $(libdir)/python/sqlite3/test.*
-PKGFILES_CSWlibpython2-6-1-0 += $(libdir)/libpython2\.6\.so\..*
+PKGFILES_CSWpython$(CVER)-devel += $(bindir)/smtpd.py
+PKGFILES_CSWpython$(CVER)-tk  = $(libdir)/.*/lib-tk/.*
+PKGFILES_CSWpython$(CVER)-tk += $(libdir)/.*/lib-dynload/_tkinter.so.*
+PKGFILES_CSWpython$(CVER)-test  = $(libdir)/python/test/.*
+PKGFILES_CSWpython$(CVER)-test += $(libdir)/python/bsddb/test.*
+PKGFILES_CSWpython$(CVER)-test += $(libdir)/python/ctypes/test.*
+PKGFILES_CSWpython$(CVER)-test += $(libdir)/python/email/test.*
+PKGFILES_CSWpython$(CVER)-test += $(libdir)/python/distutils/tests.*
+PKGFILES_CSWpython$(CVER)-test += $(libdir)/python/json/tests.*
+PKGFILES_CSWpython$(CVER)-test += $(libdir)/python/lib2to3/tests.*
+PKGFILES_CSWpython$(CVER)-test += $(libdir)/python/sqlite3/test.*
+PKGFILES_CSWlibpython$(DVER)-1-0 += $(libdir)/libpython$(VER)\.so\.[0-9\.]+
 
-ARCHALL_CSWpython-test = 1
-ARCHALL_CSWidle        = 1
+ARCHALL_CSWpython$(CVER)-test = 1
+ARCHALL_CSWidle$(CVER)        = 1
 
-RUNTIME_DEP_PKGS_CSWidle         += CSWpython
-RUNTIME_DEP_PKGS_CSWidle         += CSWpython-tk
-RUNTIME_DEP_PKGS_CSWpython       += CSWbdb47
-RUNTIME_DEP_PKGS_CSWpython       += CSWbzip2
-RUNTIME_DEP_PKGS_CSWpython       += CSWgdbm
-RUNTIME_DEP_PKGS_CSWpython       += CSWggettextrt 
-RUNTIME_DEP_PKGS_CSWpython       += CSWlibpython2-6-1-0
-RUNTIME_DEP_PKGS_CSWpython       += CSWncurses
-RUNTIME_DEP_PKGS_CSWpython       += CSWosslrt
-RUNTIME_DEP_PKGS_CSWpython       += CSWreadline 
-RUNTIME_DEP_PKGS_CSWpython       += CSWsqlite3rt
-RUNTIME_DEP_PKGS_CSWpython       += CSWzlib
-RUNTIME_DEP_PKGS_CSWpython-tk    += CSWlibpython2-6-1-0
-RUNTIME_DEP_PKGS_CSWpython-tk    += CSWpython
-RUNTIME_DEP_PKGS_CSWpython-tk    += CSWtcl
-RUNTIME_DEP_PKGS_CSWpython-tk    += CSWtk 
-RUNTIME_DEP_PKGS_CSWpython-devel += CSWpython
-RUNTIME_DEP_PKGS_CSWpython-test  += CSWpython
+RUNTIME_DEP_PKGS_CSWidle$(CVER)   += CSWpython$(CVER)
+RUNTIME_DEP_PKGS_CSWidle$(CVER)   += CSWpython$(CVER)-tk
+RUNTIME_DEP_PKGS_CSWpython$(CVER) += CSWbdb47
+RUNTIME_DEP_PKGS_CSWpython$(CVER) += CSWbzip2
+RUNTIME_DEP_PKGS_CSWpython$(CVER) += CSWlibintl8
+RUNTIME_DEP_PKGS_CSWpython$(CVER) += CSWlibffi
+RUNTIME_DEP_PKGS_CSWpython$(CVER) += CSWlibgdbm3
+RUNTIME_DEP_PKGS_CSWpython$(CVER) += CSWlibpython$(DVER)-1-0
+RUNTIME_DEP_PKGS_CSWpython$(CVER) += CSWncurses
+RUNTIME_DEP_PKGS_CSWpython$(CVER) += CSWosslrt
+RUNTIME_DEP_PKGS_CSWpython$(CVER) += CSWreadline 
+RUNTIME_DEP_PKGS_CSWpython$(CVER) += CSWsqlite3rt
+RUNTIME_DEP_PKGS_CSWpython$(CVER) += CSWzlib
+RUNTIME_DEP_PKGS_CSWpython$(CVER)-devel += CSWlibpython$(DVER)-1-0
+RUNTIME_DEP_PKGS_CSWpython$(CVER)-devel += CSWpython$(CVER)
+RUNTIME_DEP_PKGS_CSWpython$(CVER)-test  += CSWpython$(CVER)
+RUNTIME_DEP_PKGS_CSWpython$(CVER)-tk    += CSWlibpython$(DVER)-1-0
+RUNTIME_DEP_PKGS_CSWpython$(CVER)-tk    += CSWpython$(CVER)
+RUNTIME_DEP_PKGS_CSWpython$(CVER)-tk    += CSWtcl
+RUNTIME_DEP_PKGS_CSWpython$(CVER)-tk    += CSWtk 
 
 # There are packages depending on libpython2.5, and listing CSWpython as the
 # dependency.
 RUNTIME_DEP_PKGS_CSWpython               += CSWlibpython2-5-1-0
+CHECKPKG_OVERRIDES_CSWpython       += surplus-dependency|CSWlibpython2-5-1-0
 
 # This could be handled by automatic dependency detection
-CHECKPKG_OVERRIDES_CSWidle += surplus-dependency|CSWpython-tk
+CHECKPKG_OVERRIDES_CSWidle$(CVER) += surplus-dependency|CSWpython$(CVER)-tk
 
-CATALOGNAME_CSWidle         = idle
-CATALOGNAME_CSWpython       = python
-CATALOGNAME_CSWpython-devel = python_devel
-CATALOGNAME_CSWpython-tk    = python_tk
-CATALOGNAME_CSWpython-test  = python_test
-CATALOGNAME_CSWlibpython2-6-1-0  = libpython2_6_1_0
+# This package is not meant to be released
+CHECKPKG_OVERRIDES_CSWpython-test += file-with-bad-content
 
-SPKG_DESC_CSWidle              = Python IDE
-SPKG_DESC_CSWpython            = A high-level scripting language.
-SPKG_DESC_CSWpython-devel      = Development Files for Python
-SPKG_DESC_CSWpython-tk         = Python Tk Interface (TkInter)
-SPKG_DESC_CSWpython-test       = Python Test modules
-SPKG_DESC_CSWlibpython2-6-1-0  = Python shared library (2.6)
+CATALOGNAME_CSWidle$(CVER)         = idle
+CATALOGNAME_CSWpython$(CVER)       = python
+CATALOGNAME_CSWpython$(CVER)-devel = python$(CVER)_devel
+CATALOGNAME_CSWpython$(CVER)-tk    = python$(CVER)_tk
+CATALOGNAME_CSWpython$(CVER)-test  = python$(CVER)_test
+CATALOGNAME_CSWlibpython$(DVER)-1-0  = libpython$(UVER)_1_0
 
+SPKG_DESC_CSWidle$(CVER)         = Python IDE
+SPKG_DESC_CSWpython$(CVER)       = A high-level scripting language, $(VER) series
+SPKG_DESC_CSWpython$(CVER)-devel = Development Files for Python
+SPKG_DESC_CSWpython$(CVER)-tk    = Python Tk Interface (TkInter)
+SPKG_DESC_CSWpython$(CVER)-test  = Python Test modules
+SPKG_DESC_CSWlibpython$(DVER)-1-0  = Python shared library ($(VER))
+
 LICENSE = LICENSE
 
 # This is an exception, since these are original Python packages.
-CHECKPKG_OVERRIDES_CSWpython-test  += pkgname-does-not-start-with-CSWpy-
-CHECKPKG_OVERRIDES_CSWpython-test  += catalogname-does-not-start-with-py_
-CHECKPKG_OVERRIDES_CSWpython-tk    += pkgname-does-not-start-with-CSWpy-
-CHECKPKG_OVERRIDES_CSWpython-tk    += catalogname-does-not-start-with-py_
-CHECKPKG_OVERRIDES_CSWidle         += pkgname-does-not-start-with-CSWpy-
-CHECKPKG_OVERRIDES_CSWidle         += catalogname-does-not-start-with-py_
-CHECKPKG_OVERRIDES_CSWpython-devel += pkgname-does-not-start-with-CSWpy-
-CHECKPKG_OVERRIDES_CSWpython-devel += catalogname-does-not-start-with-py_
-CHECKPKG_OVERRIDES_CSWpython       += pkgname-does-not-start-with-CSWpy-
-CHECKPKG_OVERRIDES_CSWpython       += catalogname-does-not-start-with-py_
-CHECKPKG_OVERRIDES_CSWpython       += surplus-dependency|CSWlibpython2-5-1-0
+CHECKPKG_OVERRIDES_CSWidle$(CVER)         += pkgname-does-not-start-with-CSWpy-
+CHECKPKG_OVERRIDES_CSWidle$(CVER)         += catalogname-does-not-start-with-py_
+CHECKPKG_OVERRIDES_CSWpython$(CVER)-test  += pkgname-does-not-start-with-CSWpy-
+CHECKPKG_OVERRIDES_CSWpython$(CVER)-test  += catalogname-does-not-start-with-py_
+CHECKPKG_OVERRIDES_CSWpython$(CVER)-devel += pkgname-does-not-start-with-CSWpy-
+CHECKPKG_OVERRIDES_CSWpython$(CVER)-devel += catalogname-does-not-start-with-py_
+CHECKPKG_OVERRIDES_CSWpython$(CVER)-tk    += pkgname-does-not-start-with-CSWpy-
+CHECKPKG_OVERRIDES_CSWpython$(CVER)-tk    += catalogname-does-not-start-with-py_
+CHECKPKG_OVERRIDES_CSWpython$(CVER) += pkgname-does-not-start-with-CSWpy-
+CHECKPKG_OVERRIDES_CSWpython$(CVER) += catalogname-does-not-start-with-py_
 
 include gar/category.mk
+
+post-configure-modulated:
+	for f in Modules/Setup \
+			Makefile \
+			Makefile.pre \
+			Lib/idlelib/EditorWindow.py \
+			Lib/idlelib/config-main.def \
+			; do \
+		gsed -i -e 's+/usr/local+/opt/csw+g' $(WORKSRC)/$${f}; \
+		gsed -i -e 's+/usr/share+/opt/csw/share+g' $(WORKSRC)/$${f}; \
+	done
+	@$(MAKECOOKIE)

Modified: csw/mgar/pkg/lang-python/python/trunk/checksums
===================================================================
--- csw/mgar/pkg/lang-python/python/trunk/checksums	2011-03-11 20:16:14 UTC (rev 13744)
+++ csw/mgar/pkg/lang-python/python/trunk/checksums	2011-03-12 10:49:03 UTC (rev 13745)
@@ -1,12 +1 @@
-62c1cbc3527d042195699edd2f4993b7  0001-FFI_DEFAULT_ABI-to-use-__i386.patch
 cf4e6881bb84a7ce6089e4a307f71f14  Python-2.6.6.tar.bz2
-42dd6523beb94a805d5764ae1276091c  faqwiz.diff
-5664b3970307d7d39d8d4061e7dccbb0  libpython2.5.so.1.0-isa-i386
-a87896c48b2f61b32053e6d02b07b022  libpython2.5.so.1.0-isa-sparcv8
-33f4094ee46ce865d3973a197f3fb4a0  makesetup.diff
-22c5f741b1744213eaef0818ab280ad5  modules.diff
-afcc79a94e2f8a576c7906a9700e35a0  multiprocess.diff
-05724da367b025ce525de2bb704af6e3  pyport.diff
-a1d114e8a20870675649aeef007a9cac  python-config-in.diff
-1d2763e140ff30a491b3ce11d1a44f97  setup.diff
-d6c86beae46033be70c44c8e0e4c1908  site.diff

Added: csw/mgar/pkg/lang-python/python/trunk/files/0010-Hardcoding-the-use-of-libffi.patch
===================================================================
--- csw/mgar/pkg/lang-python/python/trunk/files/0010-Hardcoding-the-use-of-libffi.patch	                        (rev 0)
+++ csw/mgar/pkg/lang-python/python/trunk/files/0010-Hardcoding-the-use-of-libffi.patch	2011-03-12 10:49:03 UTC (rev 13745)
@@ -0,0 +1,33 @@
+From 57e87768fd28a35e762ceb0b467f501933faf60d Mon Sep 17 00:00:00 2001
+From: Maciej Blizinski <maciej at opencsw.org>
+Date: Sun, 6 Feb 2011 00:19:42 +0100
+Subject: [PATCH] Hardcoding the use of libffi
+
+---
+ setup.py |    3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index f875e6f..86f112a 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1812,7 +1812,7 @@ class PyBuildExt(build_ext):
+         return True
+ 
+     def configure_ctypes(self, ext):
+-        if not self.use_system_libffi:
++        if not True:
+             if sys.platform == 'darwin':
+                 return self.configure_ctypes_darwin(ext)
+ 
+@@ -1904,6 +1904,7 @@ class PyBuildExt(build_ext):
+         ext_test = Extension('_ctypes_test',
+                              sources=['_ctypes/_ctypes_test.c'])
+         self.extensions.extend([ext, ext_test])
++        ext.libraries.append('ffi')
+ 
+         if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"):
+             return
+-- 
+1.7.3.2
+

Added: csw/mgar/pkg/lang-python/python/trunk/files/0011-OpenCSW-specific-libffi-include-dir.patch
===================================================================
--- csw/mgar/pkg/lang-python/python/trunk/files/0011-OpenCSW-specific-libffi-include-dir.patch	                        (rev 0)
+++ csw/mgar/pkg/lang-python/python/trunk/files/0011-OpenCSW-specific-libffi-include-dir.patch	2011-03-12 10:49:03 UTC (rev 13745)
@@ -0,0 +1,25 @@
+From 3df52cf4b79e361ce963afb88fa4df8d6bbddcd7 Mon Sep 17 00:00:00 2001
+From: Maciej Blizinski <maciej at opencsw.org>
+Date: Sun, 6 Feb 2011 00:39:32 +0100
+Subject: [PATCH] OpenCSW-specific libffi include dir
+
+---
+ setup.py |    2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 86f112a..c6f9d5b 100644
+--- a/setup.py
++++ b/setup.py
+@@ -358,6 +358,8 @@ class PyBuildExt(build_ext):
+         # Ensure that /opt/csw is always used
+         add_dir_to_list(self.compiler.library_dirs, '/opt/csw/lib')
+         add_dir_to_list(self.compiler.include_dirs, '/opt/csw/include')
++        # OpenCSW-specific include dir for libffi.
++        add_dir_to_list(self.compiler.include_dirs, '/opt/csw/lib/libffi-3.0.8/include')
+ 
+         # Add paths specified in the environment variables LDFLAGS and
+         # CPPFLAGS for header and library files.
+-- 
+1.7.3.2
+

Added: csw/mgar/pkg/lang-python/python/trunk/files/0013-Use-opt-csw-bin-python-in-cgi.py.patch
===================================================================
--- csw/mgar/pkg/lang-python/python/trunk/files/0013-Use-opt-csw-bin-python-in-cgi.py.patch	                        (rev 0)
+++ csw/mgar/pkg/lang-python/python/trunk/files/0013-Use-opt-csw-bin-python-in-cgi.py.patch	2011-03-12 10:49:03 UTC (rev 13745)
@@ -0,0 +1,30 @@
+From aa2f27e4f0ccee85cad628807e4ae86f050eb32a Mon Sep 17 00:00:00 2001
+From: Maciej Blizinski <maciej at opencsw.org>
+Date: Sun, 6 Feb 2011 11:28:12 +0100
+Subject: [PATCH] Use /opt/csw/bin/python in cgi.py
+
+---
+ Lib/cgi.py |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/Lib/cgi.py b/Lib/cgi.py
+index db10a62..ec4c702 100755
+--- a/Lib/cgi.py
++++ b/Lib/cgi.py
+@@ -1,9 +1,9 @@
+-#! /usr/local/bin/python
++#! /opt/csw/bin/python
+ 
+-# NOTE: the above "/usr/local/bin/python" is NOT a mistake.  It is
++# NOTE: the above "/opt/csw/bin/python" is NOT a mistake.  It is
+ # intentionally NOT "/usr/bin/env python".  On many systems
+-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
+-# scripts, and /usr/local/bin is the default directory where Python is
++# (e.g. Solaris), /opt/csw/bin is not in $PATH as passed to CGI
++# scripts, and /opt/csw/bin is the default directory where Python is
+ # installed, so /usr/bin/env would be unable to find python.  Granted,
+ # binary installations by Linux vendors often install Python in
+ # /usr/bin.  So let those vendors patch cgi.py to match their choice
+-- 
+1.7.3.2
+

Added: csw/mgar/pkg/lang-python/python/trunk/files/0015-Adding-opt-csw-lib-to-dyld.py.patch
===================================================================
--- csw/mgar/pkg/lang-python/python/trunk/files/0015-Adding-opt-csw-lib-to-dyld.py.patch	                        (rev 0)
+++ csw/mgar/pkg/lang-python/python/trunk/files/0015-Adding-opt-csw-lib-to-dyld.py.patch	2011-03-12 10:49:03 UTC (rev 13745)
@@ -0,0 +1,27 @@
+From e3772e5060312a6f925b9747713d9d523a804f5f Mon Sep 17 00:00:00 2001
+From: Maciej Blizinski <maciej at opencsw.org>
+Date: Sun, 6 Feb 2011 16:22:42 +0100
+Subject: [PATCH 15/15] Adding /opt/csw/lib to dyld.py
+
+---
+ Lib/ctypes/macholib/dyld.py |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/Lib/ctypes/macholib/dyld.py b/Lib/ctypes/macholib/dyld.py
+index 9714ec6..32cac3f 100644
+--- a/Lib/ctypes/macholib/dyld.py
++++ b/Lib/ctypes/macholib/dyld.py
+@@ -26,9 +26,9 @@ DEFAULT_FRAMEWORK_FALLBACK = [
+ 
+ DEFAULT_LIBRARY_FALLBACK = [
+     os.path.expanduser("~/lib"),
+-    "/usr/local/lib",
+     "/lib",
+     "/usr/lib",
++    "/opt/csw/lib",
+ ]
+ 
+ def ensure_utf8(s):
+-- 
+1.7.3.2
+

Added: csw/mgar/pkg/lang-python/python/trunk/files/0016-CSW-mimetypes.patch
===================================================================
--- csw/mgar/pkg/lang-python/python/trunk/files/0016-CSW-mimetypes.patch	                        (rev 0)
+++ csw/mgar/pkg/lang-python/python/trunk/files/0016-CSW-mimetypes.patch	2011-03-12 10:49:03 UTC (rev 13745)
@@ -0,0 +1,30 @@
+From ca1537af5fa31adaae862911f508abfe12083c3b Mon Sep 17 00:00:00 2001
+From: Maciej Blizinski <maciej at opencsw.org>
+Date: Sun, 6 Feb 2011 17:51:16 +0100
+Subject: [PATCH] CSW mimetypes
+
+---
+ Lib/mimetypes.py |    7 +++----
+ 1 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py
+index f0a5ecf..f9f31cc 100644
+--- a/Lib/mimetypes.py
++++ b/Lib/mimetypes.py
+@@ -37,10 +37,9 @@ knownfiles = [
+     "/etc/httpd/conf/mime.types",               # Apache
+     "/etc/apache/mime.types",                   # Apache 1
+     "/etc/apache2/mime.types",                  # Apache 2
+-    "/usr/local/etc/httpd/conf/mime.types",
+-    "/usr/local/lib/netscape/mime.types",
+-    "/usr/local/etc/httpd/conf/mime.types",     # Apache 1.2
+-    "/usr/local/etc/mime.types",                # Apache 1.3
++    "/opt/csw/apache2/etc/mime.types",          # .CSW CSWapache2c, CSWapache2
++    "/etc/opt/csw/nginx/mime.types",            # .CSW CSWnginx
++    "/etc/opt/csw/mime.types",                  # .CSW CSWmutt-base
+     ]
+ 
+ inited = False
+-- 
+1.7.3.2
+

Added: csw/mgar/pkg/lang-python/python/trunk/files/0017-Random-insignificant-removals-of-usr-local.patch
===================================================================
--- csw/mgar/pkg/lang-python/python/trunk/files/0017-Random-insignificant-removals-of-usr-local.patch	                        (rev 0)
+++ csw/mgar/pkg/lang-python/python/trunk/files/0017-Random-insignificant-removals-of-usr-local.patch	2011-03-12 10:49:03 UTC (rev 13745)
@@ -0,0 +1,117 @@
+From ea64a94a70a7d6714160d78be6c55c914a6a1980 Mon Sep 17 00:00:00 2001
+From: Maciej Blizinski <maciej at opencsw.org>
+Date: Sun, 6 Feb 2011 16:24:39 +0100
+Subject: [PATCH 17/17] Random insignificant removals of /usr/local
+
+---
+ Lib/distutils/unixccompiler.py |    2 +-
+ Lib/pydoc_topics.py            |    2 +-
+ Lib/site.py                    |    8 ++++----
+ Lib/trace.py                   |    8 ++++----
+ Misc/python.man                |    4 ++--
+ 5 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
+index 7330303..004ae5d 100644
+--- a/Lib/distutils/unixccompiler.py
++++ b/Lib/distutils/unixccompiler.py
+@@ -325,7 +325,7 @@ class UnixCCompiler(CCompiler):
+ 
+             if sys.platform == 'darwin' and (
+                 dir.startswith('/System/') or (
+-                dir.startswith('/usr/') and not dir.startswith('/usr/local/'))):
++                dir.startswith('/usr/') and not dir.startswith('/usr' '/local/'))):
+ 
+                 shared = os.path.join(sysroot, dir[1:], shared_f)
+                 dylib = os.path.join(sysroot, dir[1:], dylib_f)
+diff --git a/Lib/pydoc_topics.py b/Lib/pydoc_topics.py
+index 572879f..e5fdbf5 100644
+--- a/Lib/pydoc_topics.py
++++ b/Lib/pydoc_topics.py
+@@ -74,7 +74,7 @@ topics = {'assert': u'\nThe ``assert`` statement\n************************\n\nAs
+  'typesfunctions': u'\nFunctions\n*********\n\nFunction objects are created by function definitions.  The only\noperation on a function object is to call it: ``func(argument-list)``.\n\nThere are really two flavors of function objects: built-in functions\nand user-defined functions.  Both support the same operation (to call\nthe function), but the implementation is different, hence the\ndifferent object types.\n\nSee *Function definitions* for more information.\n',
+  'typesmapping': u'\nMapping Types --- ``dict``\n**************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects.  There is currently only one standard\nmapping type, the *dictionary*.  (For other containers see the built\nin ``list``, ``set``, and ``tuple`` classes, and the ``collections``\nmodule.)\n\nA dictionary\'s keys are *almost* arbitrary values.  Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys.  Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as ``1`` and ``1.0``) then they can be used interchangeably to\nindex the same dictionary entry.  (Note however, that since computers\nstore floating-point numbers as approximations it is usually unwise to\nuse them as dictionary keys.)\n\nDictionaries can be created 
 by placing a comma-separated list of\n``key: value`` pairs within braces, for example: ``{\'jack\': 4098,\n\'sjoerd\': 4127}`` or ``{4098: \'jack\', 4127: \'sjoerd\'}``, or by the\n``dict`` constructor.\n\nclass class dict([arg])\n\n   Return a new dictionary initialized from an optional positional\n   argument or from a set of keyword arguments. If no arguments are\n   given, return a new empty dictionary. If the positional argument\n   *arg* is a mapping object, return a dictionary mapping the same\n   keys to the same values as does the mapping object. Otherwise the\n   positional argument must be a sequence, a container that supports\n   iteration, or an iterator object.  The elements of the argument\n   must each also be of one of those kinds, and each must in turn\n   contain exactly two objects. The first is used as a key in the new\n   dictionary, and the second as the key\'s value.  If a given key is\n   seen more than once, the last value associated with it is reta
 ined\n   in the new dictionary.\n\n   If keyword arguments are given, the keywords themselves with their\n   associated values are added as items to the dictionary. If a key is\n   specified both in the positional argument and as a keyword\n   argument, the value associated with the keyword is retained in the\n   dictionary. For example, these all return a dictionary equal to\n   ``{"one": 2, "two": 3}``:\n\n   * ``dict(one=2, two=3)``\n\n   * ``dict({\'one\': 2, \'two\': 3})``\n\n   * ``dict(zip((\'one\', \'two\'), (2, 3)))``\n\n   * ``dict([[\'two\', 3], [\'one\', 2]])``\n\n   The first example only works for keys that are valid Python\n   identifiers; the others work with any valid keys.\n\n   New in version 2.2.\n\n   Changed in version 2.3: Support for building a dictionary from\n   keyword arguments added.\n\n   These are the operations that dictionaries support (and therefore,\n   custom mapping types should support too):\n\n   len(d)\n\n      Return the number of ite
 ms in the dictionary *d*.\n\n   d[key]\n\n      Return the item of *d* with key *key*.  Raises a ``KeyError`` if\n      *key* is not in the map.\n\n      New in version 2.5: If a subclass of dict defines a method\n      ``__missing__()``, if the key *key* is not present, the\n      ``d[key]`` operation calls that method with the key *key* as\n      argument.  The ``d[key]`` operation then returns or raises\n      whatever is returned or raised by the ``__missing__(key)`` call\n      if the key is not present. No other operations or methods invoke\n      ``__missing__()``. If ``__missing__()`` is not defined,\n      ``KeyError`` is raised.  ``__missing__()`` must be a method; it\n      cannot be an instance variable. For an example, see\n      ``collections.defaultdict``.\n\n   d[key] = value\n\n      Set ``d[key]`` to *value*.\n\n   del d[key]\n\n      Remove ``d[key]`` from *d*.  Raises a ``KeyError`` if *key* is\n      not in the map.\n\n   key in d\n\n      Return ``True`
 ` if *d* has a key *key*, else ``False``.\n\n      New in version 2.2.\n\n   key not in d\n\n      Equivalent to ``not key in d``.\n\n      New in version 2.2.\n\n   iter(d)\n\n      Return an iterator over the keys of the dictionary.  This is a\n      shortcut for ``iterkeys()``.\n\n   clear()\n\n      Remove all items from the dictionary.\n\n   copy()\n\n      Return a shallow copy of the dictionary.\n\n   fromkeys(seq[, value])\n\n      Create a new dictionary with keys from *seq* and values set to\n      *value*.\n\n      ``fromkeys()`` is a class method that returns a new dictionary.\n      *value* defaults to ``None``.\n\n      New in version 2.3.\n\n   get(key[, default])\n\n      Return the value for *key* if *key* is in the dictionary, else\n      *default*. If *default* is not given, it defaults to ``None``,\n      so that this method never raises a ``KeyError``.\n\n   has_key(key)\n\n      Test for the presence of *key* in the dictionary.  ``has_key()``\n      is 
 deprecated in favor of ``key in d``.\n\n   items()\n\n      Return a copy of the dictionary\'s list of ``(key, value)``\n      pairs.\n\n      **CPython implementation detail:** Keys and values are listed in\n      an arbitrary order which is non-random, varies across Python\n      implementations, and depends on the dictionary\'s history of\n      insertions and deletions.\n\n      If ``items()``, ``keys()``, ``values()``, ``iteritems()``,\n      ``iterkeys()``, and ``itervalues()`` are called with no\n      intervening modifications to the dictionary, the lists will\n      directly correspond.  This allows the creation of ``(value,\n      key)`` pairs using ``zip()``: ``pairs = zip(d.values(),\n      d.keys())``.  The same relationship holds for the ``iterkeys()``\n      and ``itervalues()`` methods: ``pairs = zip(d.itervalues(),\n      d.iterkeys())`` provides the same value for ``pairs``. Another\n      way to create the same list is ``pairs = [(v, k) for (k, v) in\n    
   d.iteritems()]``.\n\n   iteritems()\n\n      Return an iterator over the dictionary\'s ``(key, value)`` pairs.\n      See the note for ``dict.items()``.\n\n      Using ``iteritems()`` while adding or deleting entries in the\n      dictionary may raise a ``RuntimeError`` or fail to iterate over\n      all entries.\n\n      New in version 2.2.\n\n   iterkeys()\n\n      Return an iterator over the dictionary\'s keys.  See the note for\n      ``dict.items()``.\n\n      Using ``iterkeys()`` while adding or deleting entries in the\n      dictionary may raise a ``RuntimeError`` or fail to iterate over\n      all entries.\n\n      New in version 2.2.\n\n   itervalues()\n\n      Return an iterator over the dictionary\'s values.  See the note\n      for ``dict.items()``.\n\n      Using ``itervalues()`` while adding or deleting entries in the\n      dictionary may raise a ``RuntimeError`` or fail to iterate over\n      all entries.\n\n      New in version 2.2.\n\n   keys()\n\n      R
 eturn a copy of the dictionary\'s list of keys.  See the note\n      for ``dict.items()``.\n\n   pop(key[, default])\n\n      If *key* is in the dictionary, remove it and return its value,\n      else return *default*.  If *default* is not given and *key* is\n      not in the dictionary, a ``KeyError`` is raised.\n\n      New in version 2.3.\n\n   popitem()\n\n      Remove and return an arbitrary ``(key, value)`` pair from the\n      dictionary.\n\n      ``popitem()`` is useful to destructively iterate over a\n      dictionary, as often used in set algorithms.  If the dictionary\n      is empty, calling ``popitem()`` raises a ``KeyError``.\n\n   setdefault(key[, default])\n\n      If *key* is in the dictionary, return its value.  If not, insert\n      *key* with a value of *default* and return *default*.  *default*\n      defaults to ``None``.\n\n   update([other])\n\n      Update the dictionary with the key/value pairs from *other*,\n      overwriting existing keys.  Return
  ``None``.\n\n      ``update()`` accepts either another dictionary object or an\n      iterable of key/value pairs (as a tuple or other iterable of\n      length two).  If keyword arguments are specified, the dictionary\n      is then updated with those key/value pairs: ``d.update(red=1,\n      blue=2)``.\n\n      Changed in version 2.4: Allowed the argument to be an iterable\n      of key/value pairs and allowed keyword arguments.\n\n   values()\n\n      Return a copy of the dictionary\'s list of values.  See the note\n      for ``dict.items()``.\n',
+  'typesmethods': u"\nMethods\n*******\n\nMethods are functions that are called using the attribute notation.\nThere are two flavors: built-in methods (such as ``append()`` on\nlists) and class instance methods.  Built-in methods are described\nwith the types that support them.\n\nThe implementation adds two special read-only attributes to class\ninstance methods: ``m.im_self`` is the object on which the method\noperates, and ``m.im_func`` is the function implementing the method.\nCalling ``m(arg-1, arg-2, ..., arg-n)`` is completely equivalent to\ncalling ``m.im_func(m.im_self, arg-1, arg-2, ..., arg-n)``.\n\nClass instance methods are either *bound* or *unbound*, referring to\nwhether the method was accessed through an instance or a class,\nrespectively.  When a method is unbound, its ``im_self`` attribute\nwill be ``None`` and if called, an explicit ``self`` object must be\npassed as the first argument.  In this case, ``self`` must be an\ninstance of the unbound method's 
 class (or a subclass of that class),\notherwise a ``TypeError`` is raised.\n\nLike function objects, methods objects support getting arbitrary\nattributes. However, since method attributes are actually stored on\nthe underlying function object (``meth.im_func``), setting method\nattributes on either bound or unbound methods is disallowed.\nAttempting to set a method attribute results in a ``TypeError`` being\nraised.  In order to set a method attribute, you need to explicitly\nset it on the underlying function object:\n\n   class C:\n       def method(self):\n           pass\n\n   c = C()\n   c.method.im_func.whoami = 'my name is c'\n\nSee *The standard type hierarchy* for more information.\n",
+- 'typesmodules': u"\nModules\n*******\n\nThe only special operation on a module is attribute access:\n``m.name``, where *m* is a module and *name* accesses a name defined\nin *m*'s symbol table. Module attributes can be assigned to.  (Note\nthat the ``import`` statement is not, strictly speaking, an operation\non a module object; ``import foo`` does not require a module object\nnamed *foo* to exist, rather it requires an (external) *definition*\nfor a module named *foo* somewhere.)\n\nA special member of every module is ``__dict__``. This is the\ndictionary containing the module's symbol table. Modifying this\ndictionary will actually change the module's symbol table, but direct\nassignment to the ``__dict__`` attribute is not possible (you can\nwrite ``m.__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but\nyou can't write ``m.__dict__ = {}``).  Modifying ``__dict__`` directly\nis not recommended.\n\nModules built into the interpreter are written like this: ``<modul
 e\n'sys' (built-in)>``.  If loaded from a file, they are written as\n``<module 'os' from '/usr/local/lib/pythonX.Y/os.pyc'>``.\n",
++ 'typesmodules': u"\nModules\n*******\n\nThe only special operation on a module is attribute access:\n``m.name``, where *m* is a module and *name* accesses a name defined\nin *m*'s symbol table. Module attributes can be assigned to.  (Note\nthat the ``import`` statement is not, strictly speaking, an operation\non a module object; ``import foo`` does not require a module object\nnamed *foo* to exist, rather it requires an (external) *definition*\nfor a module named *foo* somewhere.)\n\nA special member of every module is ``__dict__``. This is the\ndictionary containing the module's symbol table. Modifying this\ndictionary will actually change the module's symbol table, but direct\nassignment to the ``__dict__`` attribute is not possible (you can\nwrite ``m.__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but\nyou can't write ``m.__dict__ = {}``).  Modifying ``__dict__`` directly\nis not recommended.\n\nModules built into the interpreter are written like this: ``<modul
 e\n'sys' (built-in)>``.  If loaded from a file, they are written as\n``<module 'os' from '/opt/csw/lib/pythonX.Y/os.pyc'>``.\n",
+  'typesseq': u'\nSequence Types --- ``str``, ``unicode``, ``list``, ``tuple``, ``buffer``, ``xrange``\n************************************************************************************\n\nThere are six sequence types: strings, Unicode strings, lists, tuples,\nbuffers, and xrange objects.\n\nFor other containers see the built in ``dict`` and ``set`` classes,\nand the ``collections`` module.\n\nString literals are written in single or double quotes: ``\'xyzzy\'``,\n``"frobozz"``.  See *String literals* for more about string literals.\nUnicode strings are much like strings, but are specified in the syntax\nusing a preceding ``\'u\'`` character: ``u\'abc\'``, ``u"def"``. In\naddition to the functionality described here, there are also string-\nspecific methods described in the *String Methods* section. Lists are\nconstructed with square brackets, separating items with commas: ``[a,\nb, c]``. Tuples are constructed by the comma operator (not within\nsquare brackets), with or 
 without enclosing parentheses, but an empty\ntuple must have the enclosing parentheses, such as ``a, b, c`` or\n``()``.  A single item tuple must have a trailing comma, such as\n``(d,)``.\n\nBuffer objects are not directly supported by Python syntax, but can be\ncreated by calling the built-in function ``buffer()``.  They don\'t\nsupport concatenation or repetition.\n\nObjects of type xrange are similar to buffers in that there is no\nspecific syntax to create them, but they are created using the\n``xrange()`` function.  They don\'t support slicing, concatenation or\nrepetition, and using ``in``, ``not in``, ``min()`` or ``max()`` on\nthem is inefficient.\n\nMost sequence types support the following operations.  The ``in`` and\n``not in`` operations have the same priorities as the comparison\noperations.  The ``+`` and ``*`` operations have the same priority as\nthe corresponding numeric operations. [3] Additional methods are\nprovided for *Mutable Sequence Types*.\n\nThis t
 able lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority).  In the table,\n*s* and *t* are sequences of the same type; *n*, *i* and *j* are\nintegers:\n\n+--------------------+----------------------------------+------------+\n| Operation          | Result                           | Notes      |\n+====================+==================================+============+\n| ``x in s``         | ``True`` if an item of *s* is    | (1)        |\n|                    | equal to *x*, else ``False``     |            |\n+--------------------+----------------------------------+------------+\n| ``x not in s``     | ``False`` if an item of *s* is   | (1)        |\n|                    | equal to *x*, else ``True``      |            |\n+--------------------+----------------------------------+------------+\n| ``s + t``          | the concatenation of *s* and *t* | (6)        |\n+--------------------+----------------------------------
 +------------+\n| ``s * n, n * s``   | *n* shallow copies of *s*        | (2)        |\n|                    | concatenated                     |            |\n+--------------------+----------------------------------+------------+\n| ``s[i]``           | *i*\'th item of *s*, origin 0     | (3)        |\n+--------------------+----------------------------------+------------+\n| ``s[i:j]``         | slice of *s* from *i* to *j*     | (3)(4)     |\n+--------------------+----------------------------------+------------+\n| ``s[i:j:k]``       | slice of *s* from *i* to *j*     | (3)(5)     |\n|                    | with step *k*                    |            |\n+--------------------+----------------------------------+------------+\n| ``len(s)``         | length of *s*                    |            |\n+--------------------+----------------------------------+------------+\n| ``min(s)``         | smallest item of *s*             |            |\n+--------------------+--------------
 --------------------+------------+\n| ``max(s)``         | largest item of *s*              |            |\n+--------------------+----------------------------------+------------+\n\nSequence types also support comparisons. In particular, tuples and\nlists are compared lexicographically by comparing corresponding\nelements. This means that to compare equal, every element must compare\nequal and the two sequences must be of the same type and have the same\nlength. (For full details see *Comparisons* in the language\nreference.)\n\nNotes:\n\n1. When *s* is a string or Unicode string object the ``in`` and ``not\n   in`` operations act like a substring test.  In Python versions\n   before 2.3, *x* had to be a string of length 1. In Python 2.3 and\n   beyond, *x* may be a string of any length.\n\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\n   empty sequence of the same type as *s*).  Note also that the copies\n   are shallow; nested structures are not c
 opied.  This often haunts\n   new Python programmers; consider:\n\n   >>> lists = [[]] * 3\n   >>> lists\n   [[], [], []]\n   >>> lists[0].append(3)\n   >>> lists\n   [[3], [3], [3]]\n\n   What has happened is that ``[[]]`` is a one-element list containing\n   an empty list, so all three elements of ``[[]] * 3`` are (pointers\n   to) this single empty list.  Modifying any of the elements of\n   ``lists`` modifies this single list. You can create a list of\n   different lists this way:\n\n   >>> lists = [[] for i in range(3)]\n   >>> lists[0].append(3)\n   >>> lists[1].append(5)\n   >>> lists[2].append(7)\n   >>> lists\n   [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of the\n   string: ``len(s) + i`` or ``len(s) + j`` is substituted.  But note\n   that ``-0`` is still ``0``.\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n   items with index *k* such that ``i <= k < j``.  If *i* or *j* is\n   greater than ``len(s)``, 
 use ``len(s)``.  If *i* is omitted or\n   ``None``, use ``0``.  If *j* is omitted or ``None``, use\n   ``len(s)``.  If *i* is greater than or equal to *j*, the slice is\n   empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n   sequence of items with index  ``x = i + n*k`` such that ``0 <= n <\n   (j-i)/k``.  In other words, the indices are ``i``, ``i+k``,\n   ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\n   never including *j*).  If *i* or *j* is greater than ``len(s)``,\n   use ``len(s)``.  If *i* or *j* are omitted or ``None``, they become\n   "end" values (which end depends on the sign of *k*).  Note, *k*\n   cannot be zero. If *k* is ``None``, it is treated like ``1``.\n\n6. **CPython implementation detail:** If *s* and *t* are both strings,\n   some Python implementations such as CPython can usually perform an\n   in-place optimization for assignments of the form ``s = s + t`` or\n   ``s += t``.  When applicable, this opt
 imization makes quadratic\n   run-time much less likely.  This optimization is both version and\n   implementation dependent.  For performance sensitive code, it is\n   preferable to use the ``str.join()`` method which assures\n   consistent linear concatenation performance across versions and\n   implementations.\n\n   Changed in version 2.4: Formerly, string concatenation never\n   occurred in-place.\n\n\nString Methods\n==============\n\nBelow are listed the string methods which both 8-bit strings and\nUnicode objects support. Note that none of these methods take keyword\narguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\nbuffer, xrange* section. To output formatted strings use template\nstrings or the ``%`` operator described in the *String Formatting\nOperations* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n   R
 eturn a copy of the string with its first character capitalized\n   and the rest lowercased.\n\n   For 8-bit strings, this method is locale-dependent.\n\nstr.center(width[, fillchar])\n\n   Return centered in a string of length *width*. Padding is done\n   using the specified *fillchar* (default is a space).\n\n   Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.count(sub[, start[, end]])\n\n   Return the number of non-overlapping occurrences of substring *sub*\n   in the range [*start*, *end*].  Optional arguments *start* and\n   *end* are interpreted as in slice notation.\n\nstr.decode([encoding[, errors]])\n\n   Decodes the string using the codec registered for *encoding*.\n   *encoding* defaults to the default string encoding.  *errors* may\n   be given to set a different error handling scheme.  The default is\n   ``\'strict\'``, meaning that encoding errors raise ``UnicodeError``.\n   Other possible values are ``\'ignore\'``, ``\'replace\'`` and any o
 ther\n   name registered via ``codecs.register_error()``, see section *Codec\n   Base Classes*.\n\n   New in version 2.2.\n\n   Changed in version 2.3: Support for other error handling schemes\n   added.\n\nstr.encode([encoding[, errors]])\n\n   Return an encoded version of the string.  Default encoding is the\n   current default string encoding.  *errors* may be given to set a\n   different error handling scheme.  The default for *errors* is\n   ``\'strict\'``, meaning that encoding errors raise a\n   ``UnicodeError``.  Other possible values are ``\'ignore\'``,\n   ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n   any other name registered via ``codecs.register_error()``, see\n   section *Codec Base Classes*. For a list of possible encodings, see\n   section *Standard Encodings*.\n\n   New in version 2.0.\n\n   Changed in version 2.3: Support for ``\'xmlcharrefreplace\'`` and\n   ``\'backslashreplace\'`` and other error handling schemes added.\n\n
 str.endswith(suffix[, start[, end]])\n\n   Return ``True`` if the string ends with the specified *suffix*,\n   otherwise return ``False``.  *suffix* can also be a tuple of\n   suffixes to look for.  With optional *start*, test beginning at\n   that position.  With optional *end*, stop comparing at that\n   position.\n\n   Changed in version 2.5: Accept tuples as *suffix*.\n\nstr.expandtabs([tabsize])\n\n   Return a copy of the string where all tab characters are replaced\n   by one or more spaces, depending on the current column and the\n   given tab size.  The column number is reset to zero after each\n   newline occurring in the string. If *tabsize* is not given, a tab\n   size of ``8`` characters is assumed.  This doesn\'t understand other\n   non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n   Return the lowest index in the string where substring *sub* is\n   found, such that *sub* is contained in the slice ``s[start:end]``.\n   Optional a
 rguments *start* and *end* are interpreted as in slice\n   notation.  Return ``-1`` if *sub* is not found.\n\nstr.format(*args, **kwargs)\n\n   Perform a string formatting operation.  The string on which this\n   method is called can contain literal text or replacement fields\n   delimited by braces ``{}``.  Each replacement field contains either\n   the numeric index of a positional argument, or the name of a\n   keyword argument.  Returns a copy of the string where each\n   replacement field is replaced with the string value of the\n   corresponding argument.\n\n   >>> "The sum of 1 + 2 is {0}".format(1+2)\n   \'The sum of 1 + 2 is 3\'\n\n   See *Format String Syntax* for a description of the various\n   formatting options that can be specified in format strings.\n\n   This method of string formatting is the new standard in Python 3.0,\n   and should be preferred to the ``%`` formatting described in\n   *String Formatting Operations* in new code.\n\n   New in version 2.6.\
 n\nstr.index(sub[, start[, end]])\n\n   Like ``find()``, but raise ``ValueError`` when the substring is not\n   found.\n\nstr.isalnum()\n\n   Return true if all characters in the string are alphanumeric and\n   there is at least one character, false otherwise.\n\n   For 8-bit strings, this method is locale-dependent.\n\nstr.isalpha()\n\n   Return true if all characters in the string are alphabetic and\n   there is at least one character, false otherwise.\n\n   For 8-bit strings, this method is locale-dependent.\n\nstr.isdigit()\n\n   Return true if all characters in the string are digits and there is\n   at least one character, false otherwise.\n\n   For 8-bit strings, this method is locale-dependent.\n\nstr.islower()\n\n   Return true if all cased characters in the string are lowercase and\n   there is at least one cased character, false otherwise.\n\n   For 8-bit strings, this method is locale-dependent.\n\nstr.isspace()\n\n   Return true if there are only whitespace chara
 cters in the string\n   and there is at least one character, false otherwise.\n\n   For 8-bit strings, this method is locale-dependent.\n\nstr.istitle()\n\n   Return true if the string is a titlecased string and there is at\n   least one character, for example uppercase characters may only\n   follow uncased characters and lowercase characters only cased ones.\n   Return false otherwise.\n\n   For 8-bit strings, this method is locale-dependent.\n\nstr.isupper()\n\n   Return true if all cased characters in the string are uppercase and\n   there is at least one cased character, false otherwise.\n\n   For 8-bit strings, this method is locale-dependent.\n\nstr.join(iterable)\n\n   Return a string which is the concatenation of the strings in the\n   *iterable* *iterable*.  The separator between elements is the\n   string providing this method.\n\nstr.ljust(width[, fillchar])\n\n   Return the string left justified in a string of length *width*.\n   Padding is done using the specif
 ied *fillchar* (default is a\n   space).  The original string is returned if *width* is less than\n   ``len(s)``.\n\n   Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.lower()\n\n   Return a copy of the string converted to lowercase.\n\n   For 8-bit strings, this method is locale-dependent.\n\nstr.lstrip([chars])\n\n   Return a copy of the string with leading characters removed.  The\n   *chars* argument is a string specifying the set of characters to be\n   removed.  If omitted or ``None``, the *chars* argument defaults to\n   removing whitespace.  The *chars* argument is not a prefix; rather,\n   all combinations of its values are stripped:\n\n   >>> \'   spacious   \'.lstrip()\n   \'spacious   \'\n   >>> \'www.example.com\'.lstrip(\'cmowz.\')\n   \'example.com\'\n\n   Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.partition(sep)\n\n   Split the string at the first occurrence of *sep*, and return a\n   3-tuple containing the part bef
 ore the separator, the separator\n   itself, and the part after the separator.  If the separator is not\n   found, return a 3-tuple containing the string itself, followed by\n   two empty strings.\n\n   New in version 2.5.\n\nstr.replace(old, new[, count])\n\n   Return a copy of the string with all occurrences of substring *old*\n   replaced by *new*.  If the optional argument *count* is given, only\n   the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n   Return the highest index in the string where substring *sub* is\n   found, such that *sub* is contained within ``s[start:end]``.\n   Optional arguments *start* and *end* are interpreted as in slice\n   notation.  Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n   Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n   is not found.\n\nstr.rjust(width[, fillchar])\n\n   Return the string right justified in a string of length *width*.\n   Padding is done using the
  specified *fillchar* (default is a\n   space). The original string is returned if *width* is less than\n   ``len(s)``.\n\n   Changed in version 2.4: Support for the *fillchar* argument.\n\nstr.rpartition(sep)\n\n   Split the string at the last occurrence of *sep*, and return a\n   3-tuple containing the part before the separator, the separator\n   itself, and the part after the separator.  If the separator is not\n   found, return a 3-tuple containing two empty strings, followed by\n   the string itself.\n\n   New in version 2.5.\n\nstr.rsplit([sep[, maxsplit]])\n\n   Return a list of the words in the string, using *sep* as the\n   delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n   are done, the *rightmost* ones.  If *sep* is not specified or\n   ``None``, any whitespace string is a separator.  Except for\n   splitting from the right, ``rsplit()`` behaves like ``split()``\n   which is described in detail below.\n\n   New in version 2.4.\n\nstr.rstrip([c
 hars])\n\n   Return a copy of the string with trailing characters removed.  The\n   *chars* argument is a string specifying the set of characters to be\n   removed.  If omitted or ``None``, the *chars* argument defaults to\n   removing whitespace.  The *chars* argument is not a suffix; rather,\n   all combinations of its values are stripped:\n\n   >>> \'   spacious   \'.rstrip()\n   \'   spacious\'\n   >>> \'mississippi\'.rstrip(\'ipz\')\n   \'mississ\'\n\n   Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.split([sep[, maxsplit]])\n\n   Return a list of the words in the string, using *sep* as the\n   delimiter string.  If *maxsplit* is given, at most *maxsplit*\n   splits are done (thus, the list will have at most ``maxsplit+1``\n   elements).  If *maxsplit* is not specified, then there is no limit\n   on the number of splits (all possible splits are made).\n\n   If *sep* is given, consecutive delimiters are not grouped together\n   and are deemed to delim
 it empty strings (for example,\n   ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``).  The *sep*\n   argument may consist of multiple characters (for example,\n   ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n   an empty string with a specified separator returns ``[\'\']``.\n\n   If *sep* is not specified or is ``None``, a different splitting\n   algorithm is applied: runs of consecutive whitespace are regarded\n   as a single separator, and the result will contain no empty strings\n   at the start or end if the string has leading or trailing\n   whitespace.  Consequently, splitting an empty string or a string\n   consisting of just whitespace with a ``None`` separator returns\n   ``[]``.\n\n   For example, ``\' 1  2   3  \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n   and ``\'  1  2   3  \'.split(None, 1)`` returns ``[\'1\', \'2   3  \']``.\n\nstr.splitlines([keepends])\n\n   Return a list of the lines in the string, breaking at 
 line\n   boundaries.  Line breaks are not included in the resulting list\n   unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n   Return ``True`` if string starts with the *prefix*, otherwise\n   return ``False``. *prefix* can also be a tuple of prefixes to look\n   for.  With optional *start*, test string beginning at that\n   position.  With optional *end*, stop comparing string at that\n   position.\n\n   Changed in version 2.5: Accept tuples as *prefix*.\n\nstr.strip([chars])\n\n   Return a copy of the string with the leading and trailing\n   characters removed. The *chars* argument is a string specifying the\n   set of characters to be removed. If omitted or ``None``, the\n   *chars* argument defaults to removing whitespace. The *chars*\n   argument is not a prefix or suffix; rather, all combinations of its\n   values are stripped:\n\n   >>> \'   spacious   \'.strip()\n   \'spacious\'\n   >>> \'www.example.com\'.strip(\'cmowz.\')\n   \'ex
 ample\'\n\n   Changed in version 2.2.2: Support for the *chars* argument.\n\nstr.swapcase()\n\n   Return a copy of the string with uppercase characters converted to\n   lowercase and vice versa.\n\n   For 8-bit strings, this method is locale-dependent.\n\nstr.title()\n\n   Return a titlecased version of the string where words start with an\n   uppercase character and the remaining characters are lowercase.\n\n   The algorithm uses a simple language-independent definition of a\n   word as groups of consecutive letters.  The definition works in\n   many contexts but it means that apostrophes in contractions and\n   possessives form word boundaries, which may not be the desired\n   result:\n\n      >>> "they\'re bill\'s friends from the UK".title()\n      "They\'Re Bill\'S Friends From The Uk"\n\n   A workaround for apostrophes can be constructed using regular\n   expressions:\n\n      >>> import re\n      >>> def titlecase(s):\n              return re.sub(r"[A-Za-z]+(\'[A-Za-z
 ]+)?",\n                            lambda mo: mo.group(0)[0].upper() +\n                                       mo.group(0)[1:].lower(),\n                            s)\n\n      >>> titlecase("they\'re bill\'s friends.")\n      "They\'re Bill\'s Friends."\n\n   For 8-bit strings, this method is locale-dependent.\n\nstr.translate(table[, deletechars])\n\n   Return a copy of the string where all characters occurring in the\n   optional argument *deletechars* are removed, and the remaining\n   characters have been mapped through the given translation table,\n   which must be a string of length 256.\n\n   You can use the ``maketrans()`` helper function in the ``string``\n   module to create a translation table. For string objects, set the\n   *table* argument to ``None`` for translations that only delete\n   characters:\n\n   >>> \'read this short text\'.translate(None, \'aeiou\')\n   \'rd ths shrt txt\'\n\n   New in version 2.6: Support for a ``None`` *table* argument.\n\n   Fo
 r Unicode objects, the ``translate()`` method does not accept the\n   optional *deletechars* argument.  Instead, it returns a copy of the\n   *s* where all characters have been mapped through the given\n   translation table which must be a mapping of Unicode ordinals to\n   Unicode ordinals, Unicode strings or ``None``. Unmapped characters\n   are left untouched. Characters mapped to ``None`` are deleted.\n   Note, a more flexible approach is to create a custom character\n   mapping codec using the ``codecs`` module (see ``encodings.cp1251``\n   for an example).\n\nstr.upper()\n\n   Return a copy of the string converted to uppercase.\n\n   For 8-bit strings, this method is locale-dependent.\n\nstr.zfill(width)\n\n   Return the numeric string left filled with zeros in a string of\n   length *width*.  A sign prefix is handled correctly.  The original\n   string is returned if *width* is less than ``len(s)``.\n\n   New in version 2.2.2.\n\nThe following methods are present only
  on unicode objects:\n\nunicode.isnumeric()\n\n   Return ``True`` if there are only numeric characters in S,\n   ``False`` otherwise. Numeric characters include digit characters,\n   and all characters that have the Unicode numeric value property,\n   e.g. U+2155, VULGAR FRACTION ONE FIFTH.\n\nunicode.isdecimal()\n\n   Return ``True`` if there are only decimal characters in S,\n   ``False`` otherwise. Decimal characters include digit characters,\n   and all characters that that can be used to form decimal-radix\n   numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\n\n\nString Formatting Operations\n============================\n\nString and Unicode objects have one unique built-in operation: the\n``%`` operator (modulo).  This is also known as the string\n*formatting* or *interpolation* operator.  Given ``format % values``\n(where *format* is a string or Unicode object), ``%`` conversion\nspecifications in *format* are replaced with zero or more elements of\n*values*.  The effe
 ct is similar to the using ``sprintf()`` in the C\nlanguage.  If *format* is a Unicode object, or if any of the objects\nbeing converted using the ``%s`` conversion are Unicode objects, the\nresult will also be a Unicode object.\n\nIf *format* requires a single argument, *values* may be a single non-\ntuple object. [4]  Otherwise, *values* must be a tuple with exactly\nthe number of items specified by the format string, or a single\nmapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the\nfollowing components, which must occur in this order:\n\n1. The ``\'%\'`` character, which marks the start of the specifier.\n\n2. Mapping key (optional), consisting of a parenthesised sequence of\n   characters (for example, ``(somename)``).\n\n3. Conversion flags (optional), which affect the result of some\n   conversion types.\n\n4. Minimum field width (optional).  If specified as an ``\'*\'``\n   (asterisk), the actual width is r
 ead from the next element of the\n   tuple in *values*, and the object to convert comes after the\n   minimum field width and optional precision.\n\n5. Precision (optional), given as a ``\'.\'`` (dot) followed by the\n   precision.  If specified as ``\'*\'`` (an asterisk), the actual width\n   is read from the next element of the tuple in *values*, and the\n   value to convert comes after the precision.\n\n6. Length modifier (optional).\n\n7. Conversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then\nthe formats in the string *must* include a parenthesised mapping key\ninto that dictionary inserted immediately after the ``\'%\'`` character.\nThe mapping key selects the value to be formatted from the mapping.\nFor example:\n\n>>> print \'%(language)s has %(#)03d quote types.\' % \\\n...       {\'language\': "Python", "#": 2}\nPython has 002 quote types.\n\nIn this case no ``*`` specifiers may occur in a format (since they\nrequire a sequential 
 parameter list).\n\nThe conversion flag characters are:\n\n+-----------+-----------------------------------------------------------------------+\n| Flag      | Meaning                                                               |\n+===========+=======================================================================+\n| ``\'#\'``   | The value conversion will use the "alternate form" (where defined     |\n|           | below).                                                               |\n+-----------+-----------------------------------------------------------------------+\n| ``\'0\'``   | The conversion will be zero padded for numeric values.                |\n+-----------+-----------------------------------------------------------------------+\n| ``\'-\'``   | The converted value is left adjusted (overrides the ``\'0\'``           |\n|           | conversion if both are given).                                        |\n+-----------+---------------------------------------
 --------------------------------+\n| ``\' \'``   | (a space) A blank should be left before a positive number (or empty   |\n|           | string) produced by a signed conversion.                              |\n+-----------+-----------------------------------------------------------------------+\n| ``\'+\'``   | A sign character (``\'+\'`` or ``\'-\'``) will precede the conversion     |\n|           | (overrides a "space" flag).                                           |\n+-----------+-----------------------------------------------------------------------+\n\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\nidentical to ``%d``.\n\nThe conversion types are:\n\n+--------------+-------------------------------------------------------+---------+\n| Conversion   | Meaning                                               | Notes   |\n+==============+=====================================================
 ==+=========+\n| ``\'d\'``      | Signed integer decimal.                               |         |\n+--------------+-------------------------------------------------------+---------+\n| ``\'i\'``      | Signed integer decimal.                               |         |\n+--------------+-------------------------------------------------------+---------+\n| ``\'o\'``      | Signed octal value.                                   | (1)     |\n+--------------+-------------------------------------------------------+---------+\n| ``\'u\'``      | Obsolete type -- it is identical to ``\'d\'``.          | (7)     |\n+--------------+-------------------------------------------------------+---------+\n| ``\'x\'``      | Signed hexadecimal (lowercase).                       | (2)     |\n+--------------+-------------------------------------------------------+---------+\n| ``\'X\'``      | Signed hexadecimal (uppercase).                       | (2)     |\n+--------------+--------------------
 -----------------------------------+---------+\n| ``\'e\'``      | Floating point exponential format (lowercase).        | (3)     |\n+--------------+-------------------------------------------------------+---------+\n| ``\'E\'``      | Floating point exponential format (uppercase).        | (3)     |\n+--------------+-------------------------------------------------------+---------+\n| ``\'f\'``      | Floating point decimal format.                        | (3)     |\n+--------------+-------------------------------------------------------+---------+\n| ``\'F\'``      | Floating point decimal format.                        | (3)     |\n+--------------+-------------------------------------------------------+---------+\n| ``\'g\'``      | Floating point format. Uses lowercase exponential     | (4)     |\n|              | format if exponent is less than -4 or not less than   |         |\n|              | precision, decimal format otherwise.                  |         |\n+------
 --------+-------------------------------------------------------+---------+\n| ``\'G\'``      | Floating point format. Uses uppercase exponential     | (4)     |\n|              | format if exponent is less than -4 or not less than   |         |\n|              | precision, decimal format otherwise.                  |         |\n+--------------+-------------------------------------------------------+---------+\n| ``\'c\'``      | Single character (accepts integer or single character |         |\n|              | string).                                              |         |\n+--------------+-------------------------------------------------------+---------+\n| ``\'r\'``      | String (converts any Python object using ``repr()``). | (5)     |\n+--------------+-------------------------------------------------------+---------+\n| ``\'s\'``      | String (converts any Python object using ``str()``).  | (6)     |\n+--------------+------------------------------------------------
 -------+---------+\n| ``\'%\'``      | No argument is converted, results in a ``\'%\'``        |         |\n|              | character in the result.                              |         |\n+--------------+-------------------------------------------------------+---------+\n\nNotes:\n\n1. The alternate form causes a leading zero (``\'0\'``) to be inserted\n   between left-hand padding and the formatting of the number if the\n   leading character of the result is not already a zero.\n\n2. The alternate form causes a leading ``\'0x\'`` or ``\'0X\'`` (depending\n   on whether the ``\'x\'`` or ``\'X\'`` format was used) to be inserted\n   between left-hand padding and the formatting of the number if the\n   leading character of the result is not already a zero.\n\n3. The alternate form causes the result to always contain a decimal\n   point, even if no digits follow it.\n\n   The precision determines the number of digits after the decimal\n   point and defaults to 6.\n\n4. The 
 alternate form causes the result to always contain a decimal\n   point, and trailing zeroes are not removed as they would otherwise\n   be.\n\n   The precision determines the number of significant digits before\n   and after the decimal point and defaults to 6.\n\n5. The ``%r`` conversion was added in Python 2.0.\n\n   The precision determines the maximal number of characters used.\n\n6. If the object or format provided is a ``unicode`` string, the\n   resulting string will also be ``unicode``.\n\n   The precision determines the maximal number of characters used.\n\n7. See **PEP 237**.\n\nSince Python strings have an explicit length, ``%s`` conversions do\nnot assume that ``\'\\0\'`` is the end of the string.\n\nFor safety reasons, floating point precisions are clipped to 50;\n``%f`` conversions for numbers whose absolute value is over 1e50 are\nreplaced by ``%g`` conversions. [5]  All other errors raise\nexceptions.\n\nAdditional string operations are defined in standard mo
 dules\n``string`` and ``re``.\n\n\nXRange Type\n===========\n\nThe ``xrange`` type is an immutable sequence which is commonly used\nfor looping.  The advantage of the ``xrange`` type is that an\n``xrange`` object will always take the same amount of memory, no\nmatter the size of the range it represents.  There are no consistent\nperformance advantages.\n\nXRange objects have very little behavior: they only support indexing,\niteration, and the ``len()`` function.\n\n\nMutable Sequence Types\n======================\n\nList objects support additional operations that allow in-place\nmodification of the object. Other mutable sequence types (when added\nto the language) should also support these operations. Strings and\ntuples are immutable sequence types: such objects cannot be modified\nonce created. The following operations are defined on mutable sequence\ntypes (where *x* is an arbitrary object):\n\n+--------------------------------+----------------------------------+--------
 ---------------+\n| Operation                      | Result                           | Notes                 |\n+================================+==================================+=======================+\n| ``s[i] = x``                   | item *i* of *s* is replaced by   |                       |\n|                                | *x*                              |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t``                 | slice of *s* from *i* to *j* is  |                       |\n|                                | replaced by the contents of the  |                       |\n|                                | iterable *t*                     |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]``                 | same as ``s[i:j] = []``          |                       |\n+--------------------
 ------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t``               | the elements of ``s[i:j:k]`` are | (1)                   |\n|                                | replaced by those of *t*         |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]``               | removes the elements of          |                       |\n|                                | ``s[i:j:k]`` from the list       |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)``                | same as ``s[len(s):len(s)] =     | (2)                   |\n|                                | [x]``                            |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)``                | same as ``s[len(s):len(s)
 ] = x`` | (3)                   |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)``                 | return number of *i*\'s for which |                       |\n|                                | ``s[i] == x``                    |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])``       | return smallest *k* such that    | (4)                   |\n|                                | ``s[k] == x`` and ``i <= k < j`` |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)``             | same as ``s[i:i] = [x]``         | (5)                   |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])``                 | same as ``x = s[i]; del s[i];    | (6)                   |\n|  
                               | return x``                       |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)``                | same as ``del s[s.index(x)]``    | (4)                   |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()``                | reverses the items of *s* in     | (7)                   |\n|                                | place                            |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([cmp[, key[,          | sort the items of *s* in place   | (7)(8)(9)(10)         |\n| reverse]]])``                  |                                  |                       |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same leng
 th as the slice it is  replacing.\n\n2. The C implementation of Python has historically accepted multiple\n   parameters and implicitly joined them into a tuple; this no longer\n   works in Python 2.0.  Use of this misfeature has been deprecated\n   since Python 1.4.\n\n3. *x* can be any iterable object.\n\n4. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n   index is passed as the second or third parameter to the ``index()``\n   method, the list length is added, as for slice indices.  If it is\n   still negative, it is truncated to zero, as for slice indices.\n\n   Changed in version 2.3: Previously, ``index()`` didn\'t have\n   arguments for specifying start and stop positions.\n\n5. When a negative index is passed as the first parameter to the\n   ``insert()`` method, the list length is added, as for slice\n   indices.  If it is still negative, it is truncated to zero, as for\n   slice indices.\n\n   Changed in version 2.3: Previously, all negative i
 ndices were\n   truncated to zero.\n\n6. The ``pop()`` method is only supported by the list and array types.\n   The optional argument *i* defaults to ``-1``, so that by default\n   the last item is removed and returned.\n\n7. The ``sort()`` and ``reverse()`` methods modify the list in place\n   for economy of space when sorting or reversing a large list.  To\n   remind you that they operate by side effect, they don\'t return the\n   sorted or reversed list.\n\n8. The ``sort()`` method takes optional arguments for controlling the\n   comparisons.\n\n   *cmp* specifies a custom comparison function of two arguments (list\n   items) which should return a negative, zero or positive number\n   depending on whether the first argument is considered smaller than,\n   equal to, or larger than the second argument: ``cmp=lambda x,y:\n   cmp(x.lower(), y.lower())``.  The default value is ``None``.\n\n   *key* specifies a function of one argument that is used to extract\n   a comparison 
 key from each list element: ``key=str.lower``.  The\n   default value is ``None``.\n\n   *reverse* is a boolean value.  If set to ``True``, then the list\n   elements are sorted as if each comparison were reversed.\n\n   In general, the *key* and *reverse* conversion processes are much\n   faster than specifying an equivalent *cmp* function.  This is\n   because *cmp* is called multiple times for each list element while\n   *key* and *reverse* touch each element only once.\n\n   Changed in version 2.3: Support for ``None`` as an equivalent to\n   omitting *cmp* was added.\n\n   Changed in version 2.4: Support for *key* and *reverse* was added.\n\n9. Starting with Python 2.3, the ``sort()`` method is guaranteed to be\n   stable.  A sort is stable if it guarantees not to change the\n   relative order of elements that compare equal --- this is helpful\n   for sorting in multiple passes (for example, sort by department,\n   then by salary grade).\n\n10. **CPython implementation 
 detail:** While a list is being sorted,\n    the effect of attempting to mutate, or even inspect, the list is\n    undefined.  The C implementation of Python 2.3 and newer makes the\n    list appear empty for the duration, and raises ``ValueError`` if\n    it can detect that the list has been mutated during a sort.\n',
+  'typesseq-mutable': u"\nMutable Sequence Types\n**********************\n\nList objects support additional operations that allow in-place\nmodification of the object. Other mutable sequence types (when added\nto the language) should also support these operations. Strings and\ntuples are immutable sequence types: such objects cannot be modified\nonce created. The following operations are defined on mutable sequence\ntypes (where *x* is an arbitrary object):\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation                      | Result                           | Notes                 |\n+================================+==================================+=======================+\n| ``s[i] = x``                   | item *i* of *s* is replaced by   |                       |\n|                                | *x*                              |                       |\n+--------------------------------+---------------
 -------------------+-----------------------+\n| ``s[i:j] = t``                 | slice of *s* from *i* to *j* is  |                       |\n|                                | replaced by the contents of the  |                       |\n|                                | iterable *t*                     |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]``                 | same as ``s[i:j] = []``          |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t``               | the elements of ``s[i:j:k]`` are | (1)                   |\n|                                | replaced by those of *t*         |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]``               | removes the elements of          |                   
     |\n|                                | ``s[i:j:k]`` from the list       |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)``                | same as ``s[len(s):len(s)] =     | (2)                   |\n|                                | [x]``                            |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)``                | same as ``s[len(s):len(s)] = x`` | (3)                   |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)``                 | return number of *i*'s for which |                       |\n|                                | ``s[i] == x``                    |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])``      
  | return smallest *k* such that    | (4)                   |\n|                                | ``s[k] == x`` and ``i <= k < j`` |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)``             | same as ``s[i:i] = [x]``         | (5)                   |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])``                 | same as ``x = s[i]; del s[i];    | (6)                   |\n|                                | return x``                       |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)``                | same as ``del s[s.index(x)]``    | (4)                   |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()``                | reverses the items of *s* in     | (
 7)                   |\n|                                | place                            |                       |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([cmp[, key[,          | sort the items of *s* in place   | (7)(8)(9)(10)         |\n| reverse]]])``                  |                                  |                       |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is  replacing.\n\n2. The C implementation of Python has historically accepted multiple\n   parameters and implicitly joined them into a tuple; this no longer\n   works in Python 2.0.  Use of this misfeature has been deprecated\n   since Python 1.4.\n\n3. *x* can be any iterable object.\n\n4. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n   index is passed as the second or third parameter to the ``index(
 )``\n   method, the list length is added, as for slice indices.  If it is\n   still negative, it is truncated to zero, as for slice indices.\n\n   Changed in version 2.3: Previously, ``index()`` didn't have\n   arguments for specifying start and stop positions.\n\n5. When a negative index is passed as the first parameter to the\n   ``insert()`` method, the list length is added, as for slice\n   indices.  If it is still negative, it is truncated to zero, as for\n   slice indices.\n\n   Changed in version 2.3: Previously, all negative indices were\n   truncated to zero.\n\n6. The ``pop()`` method is only supported by the list and array types.\n   The optional argument *i* defaults to ``-1``, so that by default\n   the last item is removed and returned.\n\n7. The ``sort()`` and ``reverse()`` methods modify the list in place\n   for economy of space when sorting or reversing a large list.  To\n   remind you that they operate by side effect, they don't return the\n   sorted or re
 versed list.\n\n8. The ``sort()`` method takes optional arguments for controlling the\n   comparisons.\n\n   *cmp* specifies a custom comparison function of two arguments (list\n   items) which should return a negative, zero or positive number\n   depending on whether the first argument is considered smaller than,\n   equal to, or larger than the second argument: ``cmp=lambda x,y:\n   cmp(x.lower(), y.lower())``.  The default value is ``None``.\n\n   *key* specifies a function of one argument that is used to extract\n   a comparison key from each list element: ``key=str.lower``.  The\n   default value is ``None``.\n\n   *reverse* is a boolean value.  If set to ``True``, then the list\n   elements are sorted as if each comparison were reversed.\n\n   In general, the *key* and *reverse* conversion processes are much\n   faster than specifying an equivalent *cmp* function.  This is\n   because *cmp* is called multiple times for each list element while\n   *key* and *reverse* to
 uch each element only once.\n\n   Changed in version 2.3: Support for ``None`` as an equivalent to\n   omitting *cmp* was added.\n\n   Changed in version 2.4: Support for *key* and *reverse* was added.\n\n9. Starting with Python 2.3, the ``sort()`` method is guaranteed to be\n   stable.  A sort is stable if it guarantees not to change the\n   relative order of elements that compare equal --- this is helpful\n   for sorting in multiple passes (for example, sort by department,\n   then by salary grade).\n\n10. **CPython implementation detail:** While a list is being sorted,\n    the effect of attempting to mutate, or even inspect, the list is\n    undefined.  The C implementation of Python 2.3 and newer makes the\n    list appear empty for the duration, and raises ``ValueError`` if\n    it can detect that the list has been mutated during a sort.\n",
+  'unary': u'\nUnary arithmetic and bitwise operations\n***************************************\n\nAll unary arithmetic and bitwise operations have the same priority:\n\n   u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr\n\nThe unary ``-`` (minus) operator yields the negation of its numeric\nargument.\n\nThe unary ``+`` (plus) operator yields its numeric argument unchanged.\n\nThe unary ``~`` (invert) operator yields the bitwise inversion of its\nplain or long integer argument.  The bitwise inversion of ``x`` is\ndefined as ``-(x+1)``.  It only applies to integral numbers.\n\nIn all three cases, if the argument does not have the proper type, a\n``TypeError`` exception is raised.\n',
+diff --git a/Lib/site.py b/Lib/site.py
+index ff41408..c4ebfe2 100644
+--- a/Lib/site.py
++++ b/Lib/site.py
+@@ -27,7 +27,7 @@ sys.path more than once.  Blank lines and lines beginning with
+ '#' are skipped. Lines starting with 'import' are executed.
+ 
+ For example, suppose sys.prefix and sys.exec_prefix are set to
+-/usr/local and there is a directory /usr/local/lib/python2.5/site-packages
++/opt/csw and there is a directory /opt/csw/lib/python2.5/site-packages
+ with three subdirectories, foo, bar and spam, and two path
+ configuration files, foo.pth and bar.pth.  Assume foo.pth contains the
+ following:
+@@ -44,8 +44,8 @@ and bar.pth contains:
+ 
+ Then the following directories are added to sys.path, in this order:
+ 
+-  /usr/local/lib/python2.5/site-packages/bar
+-  /usr/local/lib/python2.5/site-packages/foo
++  /opt/csw/lib/python2.5/site-packages/bar
++  /opt/csw/lib/python2.5/site-packages/foo
+ 
+ Note that bletch is omitted because it doesn't exist; bar precedes foo
+ because bar.pth comes alphabetically before foo.pth; and spam is
+@@ -62,7 +62,7 @@ import sys
+ import os
+ import __builtin__
+ 
+-# Prefixes for site-packages; add additional prefixes like /usr/local here
++# Prefixes for site-packages; add additional prefixes like /opt/csw here
+ PREFIXES = [sys.prefix, sys.exec_prefix]
+ # Enable per user site-packages directory
+ # set it to False to disable the feature or True to force the feature
+diff --git a/Lib/trace.py b/Lib/trace.py
+index 3611f88..93eaf11 100644
+--- a/Lib/trace.py
++++ b/Lib/trace.py
+@@ -155,11 +155,11 @@ class Ignore:
+         for d in self._dirs:
+             # The '+ os.sep' is to ensure that d is a parent directory,
+             # as compared to cases like:
+-            #  d = "/usr/local"
+-            #  filename = "/usr/local.py"
++            #  d = "/opt/csw"
++            #  filename = "/opt/csw.py"
+             # or
+-            #  d = "/usr/local.py"
+-            #  filename = "/usr/local.py"
++            #  d = "/opt/csw.py"
++            #  filename = "/opt/csw.py"
+             if filename.startswith(d + os.sep):
+                 self._ignore[modulename] = 1
+                 return 1
+diff --git a/Misc/python.man b/Misc/python.man
+index b9aa72f..ae719ff 100644
+--- a/Misc/python.man
++++ b/Misc/python.man
+@@ -323,7 +323,7 @@ exception).  Error messages are written to stderr.
+ These are subject to difference depending on local installation
+ conventions; ${prefix} and ${exec_prefix} are installation-dependent
+ and should be interpreted as for GNU software; they may be the same.
+-The default for both is \fI/usr/local\fP.
++The default for both is \fI/opt/csw\fP.
+ .IP \fI${exec_prefix}/bin/python\fP
+ Recommended location of the interpreter.
+ .PP
+@@ -352,7 +352,7 @@ Change the location of the standard Python libraries.  By default, the
+ libraries are searched in ${prefix}/lib/python<version> and
+ ${exec_prefix}/lib/python<version>, where ${prefix} and ${exec_prefix}
+ are installation-dependent directories, both defaulting to
+-\fI/usr/local\fP.  When $PYTHONHOME is set to a single directory, its value
++\fI/opt/csw\fP.  When $PYTHONHOME is set to a single directory, its value
+ replaces both ${prefix} and ${exec_prefix}.  To specify different values
+ for these, set $PYTHONHOME to ${prefix}:${exec_prefix}.
+ .IP PYTHONPATH
+-- 
+1.7.3.2
+

Added: csw/mgar/pkg/lang-python/python/trunk/files/0018-Removing-usr-local-from-mailcap.patch
===================================================================
--- csw/mgar/pkg/lang-python/python/trunk/files/0018-Removing-usr-local-from-mailcap.patch	                        (rev 0)
+++ csw/mgar/pkg/lang-python/python/trunk/files/0018-Removing-usr-local-from-mailcap.patch	2011-03-12 10:49:03 UTC (rev 13745)
@@ -0,0 +1,25 @@
+From 212f5d4caf3a89b375688e907b42d833cd8b1a8c Mon Sep 17 00:00:00 2001
+From: Maciej Blizinski <maciej at opencsw.org>
+Date: Sun, 6 Feb 2011 17:56:46 +0100
+Subject: [PATCH 18/18] Removing /usr/local from mailcap
+
+---
+ Lib/mailcap.py |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/Lib/mailcap.py b/Lib/mailcap.py
+index b2ddacd..299ea35 100644
+--- a/Lib/mailcap.py
++++ b/Lib/mailcap.py
+@@ -44,7 +44,7 @@ def listmailcapfiles():
+             # Don't bother with getpwuid()
+             home = '.' # Last resort
+         mailcaps = [home + '/.mailcap', '/etc/mailcap',
+-                '/usr/etc/mailcap', '/usr/local/etc/mailcap']
++                '/usr/etc/mailcap']
+     return mailcaps
+ 
+ 
+-- 
+1.7.3.2
+


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list