comparison python/install_config.py @ 29:8344c7a9847c

install smartopen by default and some other cleanup (untested)
author Jeff Hammel <k0scist@gmail.com>
date Wed, 10 Mar 2010 14:12:41 -0500
parents 8da594377f18
children 4f07325e727a
comparison
equal deleted inserted replaced
28:4c9248b9498e 29:8344c7a9847c
12 os.chdir(HOME) 12 os.chdir(HOME)
13 13
14 # make the current directory a repository 14 # make the current directory a repository
15 import subprocess 15 import subprocess
16 16
17
18
17 commands = [ ['hg', 'init'], 19 commands = [ ['hg', 'init'],
18 ['hg', 'pull', SRC], 20 ['hg', 'pull', SRC],
19 ['hg', 'update', '-C'], 21 ['hg', 'update', '-C'],
22 ['hg', 'clone', 'http://bitbucket.org/ianb/virtualenv'],
20 23
21 # site-specific files 24 # site-specific files
22 ['mkdir', '-p', '.subversion'], 25 ['mkdir', '-p', '.subversion'],
23 ['rm', '-f', '.subversion/config'], 26 ['rm', '-f', '.subversion/config'],
24 ['ln', '-s', os.path.join(HOME, '.subversion_config/config'), os.path.join(HOME, '.subversion/config')], 27 ['ln', '-s', os.path.join(HOME, '.subversion_config/config'), os.path.join(HOME, '.subversion/config')],
25 ] 28 ]
26 29
27 for command in commands: 30 def execute(*commands):
28 code = subprocess.call(command) 31 for command in commands:
29 if code: 32 print ' '.join(command)
30 sys.exit(code) 33 code = subprocess.call(command)
34 if code:
35 sys.exit(code)
31 36
37 execute(*commands)
32 38
39 def install_develop(package):
40 src = 'http://k0s.org/hg/%s' % package
41 commands = [ ['virtualenv/virtualenv.py', package],
42 ['mkdir', '%s/src'],
43 ['hg', 'clone', src, '%s/src/%s' % (package, package)],
44 ['%s/bin/python', '%s/src/%s/setup.py', 'develop'] ]
45 execute(*commands)
33 46
47 # install some python
48 install_develop('smartopen')
49
50 postinstall_commands = [ ['ln', '-s', os.path.join(HOME, 'smartopen', 'bin', 'smartopen'), os.path.join(HOME, 'bin', 'smartopen')]