summaryrefslogtreecommitdiffstats
path: root/meta-extras/packages/python/python-2.5.2/sitecustomize.py
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <hrw@openedhand.com>2008-04-03 05:18:43 +0000
committerMarcin Juszkiewicz <hrw@openedhand.com>2008-04-03 05:18:43 +0000
commit27f3b8da5da091243683e63a1506438577184d0e (patch)
treeaeaf53396b4ddf54a7768f8d261aa231a2b6c37b /meta-extras/packages/python/python-2.5.2/sitecustomize.py
parent4d10f010f4cf2049c43583afbd5fd85ac6df91a8 (diff)
downloadpoky-27f3b8da5da091243683e63a1506438577184d0e.tar.gz
python: upgraded to 2.5.2 (merged from OE)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4163 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta-extras/packages/python/python-2.5.2/sitecustomize.py')
-rw-r--r--meta-extras/packages/python/python-2.5.2/sitecustomize.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/meta-extras/packages/python/python-2.5.2/sitecustomize.py b/meta-extras/packages/python/python-2.5.2/sitecustomize.py
new file mode 100644
index 0000000000..ec626b4b63
--- /dev/null
+++ b/meta-extras/packages/python/python-2.5.2/sitecustomize.py
@@ -0,0 +1,44 @@
1# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
2# GPLv2 or later
3# Version: 20082201
4# Features:
5# * set proper default encoding
6# * enable readline completion in the interactive interpreter
7# * load command line history on startup
8# * save command line history on exit
9
10import os
11
12def __exithandler():
13 try:
14 readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
15 except IOError:
16 pass
17
18def __registerExitHandler():
19 import atexit
20 atexit.register( __exithandler )
21
22def __enableReadlineSupport():
23 readline.parse_and_bind("tab: complete")
24 try:
25 readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
26 except IOError:
27 pass
28
29def __enableDefaultEncoding():
30 import sys
31 try:
32 sys.setdefaultencoding('utf8')
33 except LookupError:
34 pass
35
36import sys
37try:
38 import rlcompleter, readline
39except ImportError:
40 pass
41else:
42 __enableDefaultEncoding()
43 __registerExitHandler()
44 __enableReadlineSupport()