##// END OF EJS Templates
sh profile uses 'cygwin in path' to determine ls --color=auto alias and whether to load ipy_fsops.py
vivainio -
Show More
@@ -36,7 +36,6 b' def main():'
36 import ipy_rehashdir
36 import ipy_rehashdir
37 import ipy_signals
37 import ipy_signals
38
38
39
40 ip.ex('import os')
39 ip.ex('import os')
41 ip.ex("def up(): os.chdir('..')")
40 ip.ex("def up(): os.chdir('..')")
42
41
@@ -52,14 +51,10 b' def main():'
52 # I like my banner minimal.
51 # I like my banner minimal.
53 o.banner = "IPython %s [on Py %s]\n" % (Release.version,sys.version.split(None,1)[0])
52 o.banner = "IPython %s [on Py %s]\n" % (Release.version,sys.version.split(None,1)[0])
54
53
55 # make 'd' an alias for ls -F
56
57 # ip.magic('alias d ls -F --color=auto')
58
54
59 ip.IP.default_option('cd','-q')
55 ip.IP.default_option('cd','-q')
60
56
61 # If you only rarely want to execute the things you %edit...
57 # If you only rarely want to execute the things you %edit...
62
63 #ip.IP.default_option('edit','-x')
58 #ip.IP.default_option('edit','-x')
64
59
65
60
@@ -83,7 +78,7 b' def main():'
83 ip.magic('rehashx')
78 ip.magic('rehashx')
84 syscmds = db.get("syscmdlist")
79 syscmds = db.get("syscmdlist")
85
80
86 # locase aliases on win#2 only
81 # lowcase aliases on win32 only
87 if os.name == 'posix':
82 if os.name == 'posix':
88 mapper = lambda s:s
83 mapper = lambda s:s
89 else:
84 else:
@@ -96,11 +91,20 b' def main():'
96 if key not in ip.IP.alias_table:
91 if key not in ip.IP.alias_table:
97 ip.defalias(key, cmd)
92 ip.defalias(key, cmd)
98
93
99 if 'ls' in syscmds:
100 # use the colors of cygwin ls (recommended)
101 ip.magic('alias d ls -F --color=auto')
102 # mglob combines 'find', recursion, exclusion... '%mglob?' to learn more
94 # mglob combines 'find', recursion, exclusion... '%mglob?' to learn more
103 ip.load("IPython.external.mglob")
95 ip.load("IPython.external.mglob")
96
97 # win32 is crippled w/o cygwin, try to help it a little bit
98 if sys.platform == 'win32':
99 if 'cygwin' in os.environ['PATH'].lower():
100 # use the colors of cygwin ls (recommended)
101 ip.defalias('d', 'ls -F --color=auto')
102 else:
103 # get icp, imv, imkdir, igrep, irm,...
104 ip.load('ipy_fsops')
105
106 # and the next best thing to real 'ls -F'
107 ip.defalias('d','dir /w /og /on')
104
108
105 extend_shell_behavior(ip)
109 extend_shell_behavior(ip)
106
110
@@ -4,12 +4,16 b''
4 of ['dirname/foo','dirname/bar', ...].
4 of ['dirname/foo','dirname/bar', ...].
5
5
6 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
6 * Extensions/ipy_fsops.py: added, has usefull shell utils for plain
7 win32 installations: icp, imv, imkdir, igrep, collect (collect
7 win32 installations: icp, imv, imkdir, igrep, irm, collect (collect
8 is useful for others as well).
8 is useful for others as well).
9
9
10 * iplib.py: on callable aliases (as opposed to old style aliases),
10 * iplib.py: on callable aliases (as opposed to old style aliases),
11 do var_expand() immediately, and use make_quoted_expr instead
11 do var_expand() immediately, and use make_quoted_expr instead
12 of hardcoded r"""
12 of hardcoded r"""
13
14 * Extensions/ipy_profile_sh.py: Try to detect cygwin on win32,
15 if not available load ipy_fsops.py for cp, mv, etc. replacements
16
13
17
14 2007-09-04 Ville Vainio <vivainio@gmail.com>
18 2007-09-04 Ville Vainio <vivainio@gmail.com>
15
19
General Comments 0
You need to be logged in to leave comments. Login now