1
2
3
4
5
6
7
8 import os
9 import glob
10 import shutil
11 import time
12
13
14 TEMP='.tmp_SloppyCell'
15
16
17 home = os.getenv('HOME')
18 os.chdir(home)
19
20
21 os.system('rm -rf %s' % TEMP)
22 os.mkdir(TEMP)
23 os.chdir(TEMP)
24
25
26 os.system('cvs -d:pserver:anonymous@sloppycell.cvs.sourceforge.net:/cvsroot/sloppycell login')
27 os.system('cvs -z3 -d:pserver:anonymous@sloppycell.cvs.sourceforge.net:/cvsroot/sloppycell co -P SloppyCell')
28
29
30 old_python_path = os.getenv('PYTHONPATH')
31 new_python_path = '%s:%s' % (os.path.abspath(os.curdir), old_python_path)
32 os.putenv('PYTHONPATH', new_python_path)
33
34
35 os.chdir('SloppyCell')
36
37
38 build_failure = os.system('python setup.py build >& build.output')
39 if build_failure:
40 os.sys.exit()
41 os.system('python setup.py install --install-lib=..')
42
43
44 os.chdir('Testing')
45 test_failure = os.system('python test.py --debugSC=test.ouput')
46 if test_failure:
47 os.sys.exit()
48
49 os.chdir('..')
50
51
52 os.putenv('PYTHONPATH', old_python_path)
53
54
55
56
57
58
59 os.system(r"""cat __init__.py | sed "s/CVS/%s/g" > __temp_dork.py"""
60 % time.asctime().strip())
61 shutil.move('__temp_dork.py', '__init__.py')
62
63 os.system(r"""cat Doc/index.html | sed "s/CVS_GEN_DATE/%s/g" > Doc/.tmp1"""
64 % time.asctime())
65 os.system(r"""cat Doc/.tmp1 | sed "s/API_DOC_GEN_DATE/%s/g" > Doc/.tmp2"""
66 % time.asctime())
67 shutil.move('Doc/.tmp2', 'Doc/index.html')
68
69
70 os.system('python setup.py sdist --formats=gztar,zip')
71
72 os.mkdir('htdocs')
73 shutil.move('dist/SloppyCell-CVS.tar.gz', 'htdocs/SloppyCell-CVS.tar.gz')
74 shutil.move('dist/SloppyCell-CVS.zip', 'htdocs/SloppyCell-CVS.zip')
75
76 os.chdir('..')
77 os.system('epydoc SloppyCell/ -v -o SloppyCell/htdocs/api --html --no-frames --url=http://sloppycell.sf.net --name=SloppyCell --docformat=plaintext --parse-only --exclude=Testing* --exclude=Example* --show-imports --include-log')
78
79 os.chdir('SloppyCell/Doc/devel')
80 os.system('latex devel')
81 os.system('bibtex devel')
82 os.system('latex devel')
83 os.system('latex devel')
84 os.system('dvipdf devel')
85
86 os.chdir('../user')
87 os.system('latex user')
88 os.system('bibtex user')
89 os.system('latex user')
90 os.system('latex user')
91 os.system('dvipdf user')
92
93 os.chdir('../..')
94 os.system('cp Doc/index.html Doc/user/user.pdf Doc/devel/devel.pdf htdocs/.')
95
96 os.system('chmod -R a+rx htdocs')
97
98
99 upload_command = 'scp -r $HOME/%s/SloppyCell/htdocs jepetto@shell.sf.net:/home/groups/s/sl/sloppycell/.' % TEMP
100 print 'To upload the site to SourceForge, use scp like: %s' % upload_command
101 print 'Use your username in place of jepetto.'
102