summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python-native
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python-native')
-rw-r--r--meta/recipes-devtools/python/python-native/sitecustomize.py45
1 files changed, 0 insertions, 45 deletions
diff --git a/meta/recipes-devtools/python/python-native/sitecustomize.py b/meta/recipes-devtools/python/python-native/sitecustomize.py
deleted file mode 100644
index 273901898a..0000000000
--- a/meta/recipes-devtools/python/python-native/sitecustomize.py
+++ /dev/null
@@ -1,45 +0,0 @@
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
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.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
30def __enableDefaultEncoding():
31 import sys
32 try:
33 sys.setdefaultencoding( "utf8" )
34 except LookupError:
35 pass
36
37import sys
38try:
39 import rlcompleter, readline
40except ImportError:
41 pass
42else:
43 __enableDefaultEncoding()
44 __registerExitHandler()
45 __enableReadlineSupport()