##// END OF EJS Templates
Added platutils modules, now only needed for %cd to ...
vivainio -
Show More
@@ -0,0 +1,35 b''
1 # -*- coding: utf-8 -*-
2 """ Proxy module for accessing platform specific utility functions.
3
4 Importing this module should give you the implementations that are correct
5 for your operation system, from platutils_PLATFORMNAME module.
6
7 $Id: ipstruct.py 1005 2006-01-12 08:39:26Z fperez $
8
9
10 """
11
12
13 #*****************************************************************************
14 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
15 #
16 # Distributed under the terms of the BSD License. The full license is in
17 # the file COPYING, distributed as part of this software.
18 #*****************************************************************************
19
20 from IPython import Release
21 __author__ = '%s <%s>' % Release.authors['Ville']
22 __license__ = Release.license
23
24 import os
25
26 if os.name == 'posix':
27 from platutils_posix import *
28 elif os.name == 'win32':
29 from platutils_win32 import *
30 else:
31 from platutils_dummy import *
32 import warnings
33 warnings.warn("Platutils not available for platform '%s', some features may be missing" %
34 os.name)
35 del warnings
@@ -0,0 +1,29 b''
1 # -*- coding: utf-8 -*-
2 """ Platform specific utility functions, dummy version
3
4 This has empty implementation of the platutils functions, used for
5 unsupported operating systems.
6
7 $Id: ipstruct.py 1005 2006-01-12 08:39:26Z fperez $
8
9
10 """
11
12
13 #*****************************************************************************
14 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
15 #
16 # Distributed under the terms of the BSD License. The full license is in
17 # the file COPYING, distributed as part of this software.
18 #*****************************************************************************
19
20 from IPython import Release
21 __author__ = '%s <%s>' % Release.authors['Ville']
22 __license__ = Release.license
23
24
25 def _dummy(*args,**kw):
26 pass
27
28 set_term_title = _dummy
29
@@ -0,0 +1,26 b''
1 # -*- coding: utf-8 -*-
2 """ Platform specific utility functions, posix version
3
4 Importing this module directly is not portable - rather, import platutils
5 to use these functions in platform agnostic fashion.
6
7 $Id: ipstruct.py 1005 2006-01-12 08:39:26Z fperez $
8
9 """
10
11
12 #*****************************************************************************
13 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
14 #
15 # Distributed under the terms of the BSD License. The full license is in
16 # the file COPYING, distributed as part of this software.
17 #*****************************************************************************
18
19 from IPython import Release
20 __author__ = '%s <%s>' % Release.authors['Ville']
21 __license__ = Release.license
22
23 import sys
24
25 def set_term_title(title):
26 sys.stdout.write('\033]%d;%s\007' % (0,title))
@@ -0,0 +1,25 b''
1 # -*- coding: utf-8 -*-
2 """ Platform specific utility functions, win32 version
3
4 Importing this module directly is not portable - rather, import platutils
5 to use these functions in platform agnostic fashion.
6
7 $Id: ipstruct.py 1005 2006-01-12 08:39:26Z fperez $
8
9 """
10
11
12 #*****************************************************************************
13 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
14 #
15 # Distributed under the terms of the BSD License. The full license is in
16 # the file COPYING, distributed as part of this software.
17 #*****************************************************************************
18
19 from IPython import Release
20 __author__ = '%s <%s>' % Release.authors['Ville']
21 __license__ = Release.license
22
23
24 def set_term_title(title):
25 """ TBD """
@@ -1,7 +1,7 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Magic functions for InteractiveShell.
2 """Magic functions for InteractiveShell.
3
3
4 $Id: Magic.py 1005 2006-01-12 08:39:26Z fperez $"""
4 $Id: Magic.py 1014 2006-01-13 19:16:41Z vivainio $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
7 # Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
@@ -49,7 +49,7 b' from IPython.PyColorize import Parser'
49 from IPython.ipstruct import Struct
49 from IPython.ipstruct import Struct
50 from IPython.macro import Macro
50 from IPython.macro import Macro
51 from IPython.genutils import *
51 from IPython.genutils import *
52
52 from IPython import platutils
53 #***************************************************************************
53 #***************************************************************************
54 # Utility functions
54 # Utility functions
55 def on_off(tag):
55 def on_off(tag):
@@ -2329,12 +2329,16 b' Defaulting color scheme to \'NoColor\'"""'
2329 if ps:
2329 if ps:
2330 try:
2330 try:
2331 os.chdir(os.path.expanduser(ps))
2331 os.chdir(os.path.expanduser(ps))
2332 ttitle = ("IPy:" + (
2333 os.getcwd() == '/' and '/' or os.path.basename(os.getcwd())))
2334 platutils.set_term_title(ttitle)
2332 except OSError:
2335 except OSError:
2333 print sys.exc_info()[1]
2336 print sys.exc_info()[1]
2334 else:
2337 else:
2335 self.shell.user_ns['_dh'].append(os.getcwd())
2338 self.shell.user_ns['_dh'].append(os.getcwd())
2336 else:
2339 else:
2337 os.chdir(self.shell.home_dir)
2340 os.chdir(self.shell.home_dir)
2341 platutils.set_term_title("IPy:~")
2338 self.shell.user_ns['_dh'].append(os.getcwd())
2342 self.shell.user_ns['_dh'].append(os.getcwd())
2339 if not 'q' in opts:
2343 if not 'q' in opts:
2340 print self.shell.user_ns['_dh'][-1]
2344 print self.shell.user_ns['_dh'][-1]
@@ -1,7 +1,7 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Release data for the IPython project.
2 """Release data for the IPython project.
3
3
4 $Id: Release.py 1002 2006-01-11 22:18:29Z fperez $"""
4 $Id: Release.py 1014 2006-01-13 19:16:41Z vivainio $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
7 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
@@ -24,7 +24,7 b" name = 'ipython'"
24
24
25 version = '0.7.1.svn'
25 version = '0.7.1.svn'
26
26
27 revision = '$Revision: 1002 $'
27 revision = '$Revision: 1014 $'
28
28
29 description = "An enhanced interactive Python shell."
29 description = "An enhanced interactive Python shell."
30
30
@@ -64,7 +64,8 b" license = 'BSD'"
64
64
65 authors = {'Fernando' : ('Fernando Perez','fperez@colorado.edu'),
65 authors = {'Fernando' : ('Fernando Perez','fperez@colorado.edu'),
66 'Janko' : ('Janko Hauser','jhauser@zscout.de'),
66 'Janko' : ('Janko Hauser','jhauser@zscout.de'),
67 'Nathan' : ('Nathaniel Gray','n8gray@caltech.edu')
67 'Nathan' : ('Nathaniel Gray','n8gray@caltech.edu'),
68 'Ville' : ('Ville Vainio','vivainio@gmail.com')
68 }
69 }
69
70
70 url = 'http://ipython.scipy.org'
71 url = 'http://ipython.scipy.org'
@@ -27,7 +27,7 b' IPython tries to:'
27
27
28 IPython requires Python 2.2 or newer.
28 IPython requires Python 2.2 or newer.
29
29
30 $Id: __init__.py 1005 2006-01-12 08:39:26Z fperez $"""
30 $Id: __init__.py 1014 2006-01-13 19:16:41Z vivainio $"""
31
31
32 #*****************************************************************************
32 #*****************************************************************************
33 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
33 # Copyright (C) 2001-2004 Fernando Perez. <fperez@colorado.edu>
@@ -43,7 +43,8 b" if sys.version[0:3] < '2.3':"
43
43
44 # Define what gets imported with a 'from IPython import *'
44 # Define what gets imported with a 'from IPython import *'
45 __all__ = ['deep_reload','genutils','ipstruct','ultraTB','DPyGetOpt',
45 __all__ = ['deep_reload','genutils','ipstruct','ultraTB','DPyGetOpt',
46 'Itpl','hooks','ConfigLoader','OutputTrap','Release','Shell']
46 'Itpl','hooks','ConfigLoader','OutputTrap','Release','Shell',
47 'platutils','platutils_win32','platutils_posix','platutils_dummy']
47
48
48 # Load __all__ in IPython namespace so that a simple 'import IPython' gives
49 # Load __all__ in IPython namespace so that a simple 'import IPython' gives
49 # access to them via IPython.<name>
50 # access to them via IPython.<name>
@@ -1,3 +1,12 b''
1 2006-01-13 Ville Vainio <vivainio@gmail.com>
2
3 * IPython/platutils*.py: platform specific utility functions,
4 so far only set_term_title is implemented (change terminal
5 label in windowing systems). %cd now changes the title to
6 current dir.
7
8 * Added myself to "authors" list, had to create new files.
9
1 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
10 2006-01-13 Fernando Perez <Fernando.Perez@colorado.edu>
2
11
3 * IPython/iplib.py (raw_input): temporarily deactivate all
12 * IPython/iplib.py (raw_input): temporarily deactivate all
General Comments 0
You need to be logged in to leave comments. Login now