diff options
author | Nitin A Kamble <nitin.a.kamble@intel.com> | 2010-07-06 05:07:49 -0700 |
---|---|---|
committer | Saul Wold <Saul.Wold@intel.com> | 2010-07-08 22:05:20 -0700 |
commit | e18aba581c7f3f8518b8a9a850b6fe1eabc285ff (patch) | |
tree | 364264738a43168c79ba49402b0a7535e0a24ad8 /meta/packages/python/python/sitecustomize.py | |
parent | 936a73eae5fd5732c9dc5ae2a47d6196f7f69c0a (diff) | |
download | poky-e18aba581c7f3f8518b8a9a850b6fe1eabc285ff.tar.gz |
python: upgrade from 2.6.2 to 2.6.5
python-native: upgrade from 2.6.1 to 2.6.5
Also removed these older version files:
python_2.5.2
python-native_2.5.1
Rebased the patches to the newer code.
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Diffstat (limited to 'meta/packages/python/python/sitecustomize.py')
-rw-r--r-- | meta/packages/python/python/sitecustomize.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/packages/python/python/sitecustomize.py b/meta/packages/python/python/sitecustomize.py new file mode 100644 index 0000000000..273901898a --- /dev/null +++ b/meta/packages/python/python/sitecustomize.py | |||
@@ -0,0 +1,45 @@ | |||
1 | # OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de> | ||
2 | # GPLv2 or later | ||
3 | # Version: 20081123 | ||
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.set_history_length( 1000 ) | ||
24 | readline.parse_and_bind( "tab: complete" ) | ||
25 | try: | ||
26 | readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) ) | ||
27 | except IOError: | ||
28 | pass | ||
29 | |||
30 | def __enableDefaultEncoding(): | ||
31 | import sys | ||
32 | try: | ||
33 | sys.setdefaultencoding( "utf8" ) | ||
34 | except LookupError: | ||
35 | pass | ||
36 | |||
37 | import sys | ||
38 | try: | ||
39 | import rlcompleter, readline | ||
40 | except ImportError: | ||
41 | pass | ||
42 | else: | ||
43 | __enableDefaultEncoding() | ||
44 | __registerExitHandler() | ||
45 | __enableReadlineSupport() | ||