annotate buttercup/checkout.py @ 7:fa1dfcb2ec6a

add bitsytweet to software bitsyblog should have
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 08 Jul 2010 11:32:37 -0700
parents e6e80bf0476f
children ac44aa18da38
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
1 #!/usr/bin/env python
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
2
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
3 """
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
4 checks out the source as associated with the buttercup package
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
5 """
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
6
6
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
7 # XXX could/should use e.g.
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
8 # pip install --editable hg+https://slinkp@bitbucket.org/slinkp/purplevoter#egg=purplevoter
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
9 # -or -
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
10 # pip install -r foo.txt
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
11
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
12 import os
2
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
13 import sys
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
14 import subprocess
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
15 from optparse import OptionParser
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
16
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
17 HG='http://k0s.org/hg'
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
18 PACKAGES=['bitsyauth',
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
19 'bitsyblog',
7
fa1dfcb2ec6a add bitsytweet to software bitsyblog should have
Jeff Hammel <jhammel@mozilla.com>
parents: 6
diff changeset
20 'bitsytweet',
2
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
21 'buttercup',
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
22 'clwapp',
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
23 'commentator',
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
24 'contenttransformer',
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
25 'cropresize',
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
26 'decoupage',
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
27 'emaildispatcher',
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
28 'genshi_view',
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
29 'hgpaste',
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
30 'lxmlmiddleware',
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
31 'montage',
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
32 'webob_view',
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
33 'wordstream']
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
34
6
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
35 def sources():
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
36 return [(package, '%s/%s' % (HG, package))
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
37 for package in PACKAGES ]
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
38
2
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
39 def main(args=sys.argv[1:]):
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
40 parser = OptionParser()
6
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
41 parser.add_option('--install', action="store_true", default=False,
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
42 help="install the packages")
2
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
43 parser.add_option('--list', action="store_true", default=False,
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
44 help="list the source to be installed")
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
45 options, args = parser.parse_args(args)
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
46
6
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
47 sources = globals()['sources']()
2
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
48 if options.list:
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
49 for source in sources:
6
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
50 print source[0], source[1]
2
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
51 sys.exit(0)
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
52
6
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
53 assert 'VIRTUAL_ENV' in os.environ
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
54 src = os.path.join(os.environ['VIRTUAL_ENV'], 'src')
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
55 if not os.path.exists(src):
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
56 os.mkdir(src)
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
57 os.chdir(src)
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
58
2
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
59 for source in sources:
6
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
60 subprocess.call(['hg', 'clone', source[1]])
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
61
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
62 if options.install:
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
63 for source in sources:
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
64 os.chdir(source[0])
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
65 subprocess.call(['python', 'setup.py', 'develop'])
e6e80bf0476f update the way checkout works; maybe should move to pip at some point
Jeff Hammel <k0scist@gmail.com>
parents: 2
diff changeset
66 os.chdir('..')
2
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
67
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
68 if __name__ == '__main__':
d5c80480b967 adding script to checkout source packages; should make this more unified in the future
k0s <k0scist@gmail.com>
parents:
diff changeset
69 main()