diff options
| author | Richard Purdie <richard@openedhand.com> | 2008-08-25 20:33:55 +0000 |
|---|---|---|
| committer | Richard Purdie <richard@openedhand.com> | 2008-08-25 20:33:55 +0000 |
| commit | 16e6877c4ce53fd3be88dd77263a03e7d88c3163 (patch) | |
| tree | 831004ca391e04c8deaace28b15cb602c0848c77 /meta/packages/python/python-2.5.2/sitecustomize.py | |
| parent | 07eeb6a8b6d671db7566f839ab22a26b6f118077 (diff) | |
| download | poky-16e6877c4ce53fd3be88dd77263a03e7d88c3163.tar.gz | |
python: Promote from meta-extras to meta
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5092 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/python/python-2.5.2/sitecustomize.py')
| -rw-r--r-- | meta/packages/python/python-2.5.2/sitecustomize.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/meta/packages/python/python-2.5.2/sitecustomize.py b/meta/packages/python/python-2.5.2/sitecustomize.py new file mode 100644 index 0000000000..ec626b4b63 --- /dev/null +++ b/meta/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() | ||
