diff options
author | Marcin Juszkiewicz <hrw@openedhand.com> | 2008-04-03 05:18:43 +0000 |
---|---|---|
committer | Marcin Juszkiewicz <hrw@openedhand.com> | 2008-04-03 05:18:43 +0000 |
commit | 27f3b8da5da091243683e63a1506438577184d0e (patch) | |
tree | aeaf53396b4ddf54a7768f8d261aa231a2b6c37b /meta-extras/packages/python/python-2.5.2/sitecustomize.py | |
parent | 4d10f010f4cf2049c43583afbd5fd85ac6df91a8 (diff) | |
download | poky-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.py | 44 |
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 | |||
10 | import os | ||
11 | |||
12 | def __exithandler(): | ||
13 | try: | ||
14 | readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) ) | ||
15 | except IOError: | ||
16 | pass | ||
17 | |||
18 | def __registerExitHandler(): | ||
19 | import atexit | ||
20 | atexit.register( __exithandler ) | ||
21 | |||
22 | def __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 | |||
29 | def __enableDefaultEncoding(): | ||
30 | import sys | ||
31 | try: | ||
32 | sys.setdefaultencoding('utf8') | ||
33 | except LookupError: | ||
34 | pass | ||
35 | |||
36 | import sys | ||
37 | try: | ||
38 | import rlcompleter, readline | ||
39 | except ImportError: | ||
40 | pass | ||
41 | else: | ||
42 | __enableDefaultEncoding() | ||
43 | __registerExitHandler() | ||
44 | __enableReadlineSupport() | ||