Index: /create_distribution.py
===================================================================
--- /create_distribution.py	(revision 4530)
+++ /create_distribution.py	(revision 4531)
@@ -23,5 +23,5 @@
 from os import sep, system, remove
 from tempfile import mktemp
-from sys import platform
+from sys import platform, stdout
 from anuga.utilities.system_tools import get_user_name, get_host_name
 from anuga.abstract_2d_finite_volumes.util import get_revision_number
@@ -38,24 +38,9 @@
 major_revision = '1.0beta'
 
-
-# Refresh sandpit and retrieve svn revision number
-# from last line in svn update output
-#filename = mktemp() + '.txt'
-#s = 'svn update > %s' %filename
-#print s
-#system(s)
-#
-#fid = open(filename)
-#last_line = fid.readlines()[-1]
-#remove(filename)
-#if not (last_line.startswith('At revision') or\
-#        last_line.startswith('Updated to revision')):
-#    msg = 'Unexpected output from svn up: %s' %last_line
-#    raise Exception, msg    
-#
-#fields = last_line.split()
-#svn_revision = fields[-1][:-1]
-
-# Get revision number and create
+# line separator 
+lsep = '----------------------------------------------------------------------'
+
+
+# Get svn revision number and create
 # file with version info for release.
 # This will mean that the version currently checked out is
@@ -176,22 +161,28 @@
 
 #-----------------------------
-# Copy anuga_viewer
-s = '/bin/cp ./anuga_core/source/anuga_viewer/distros/anuga_viewer_1.0.tgz %s'\
-    %(distro_dir)
-print s
-system(s)
-
-# Move distro to release area
-s = '/bin/mv %s/*.tgz %s' %(distro_dir, release_dir) 
-print s
-system(s)
+# Copy and rename anuga_viewer
+s = '/bin/cp ./anuga_core/source/anuga_viewer/distros/anuga_viewer_1.0.tgz %s/anuga_viewer-%s.tgz' %(distro_dir, revision)
+print s
+system(s)
+
+
+# Move viewer to release area
+s = '/bin/mv %s/*.tgz %s' %(distro_dir, release_dir) 
+print s
+system(s)
+
+
 
 #-----------------------------
 # Hey, why not compile and bundle up the LaTeX documentation as well 
 
+print
+print lsep
+print 'Preparing User Manual (see update_anuga_user_manual.log)'
+print lsep
 s = 'cd anuga_core/documentation/user_manual;'
 s += 'python update_anuga_user_manual.py --no_html'
 print s
-system(s)
+system(s + ' 1>update_anuga_user_manual.log 2>/dev/null')
 
 release_name = 'anuga_user_manual-%s.pdf' %revision
@@ -201,5 +192,4 @@
 system(s)
 
-
 release_name = 'anuga_installation_guide-%s.pdf' %revision
 s = '/bin/mv anuga_core/documentation/user_manual/anuga_installation_guide.pdf %s/%s' %(release_dir, release_name)    
@@ -209,11 +199,58 @@
 
 
-
-#-----------------------------
+#-----------------------------
+
 print 'Done'
 print
 print
+print lsep
 print 'The release files are in %s:' %release_dir
 system('ls -la %s' %release_dir)
+print lsep
+print
+print
+
+answer = raw_input('Do you want to upload this to sourceforge? Y/N [Y]')
+if answer.lower() != 'n':
+    
+    #------------------------------
+    print 'Uploading to sourceforge'
+
+
+    import os, os.path
+    release_dir = os.path.expanduser(release_dir)
+    os.chdir(release_dir)
+    print 'Reading from', os.getcwd()
+
+
+    from ftplib import FTP
+    ftp = FTP('upload.sourceforge.net')
+    print ftp.login() # Anonymous
+    print ftp.cwd('incoming')
+
+
+    for filename in os.listdir('.'):
+        print 'Uploading %s... ' %filename,
+        stdout.flush()
+
+        fid=open(filename, 'rb')
+        print ftp.storbinary('STOR %s' %filename, fid)
+        fid.close()
+
+    print 'FTP done'
+    print ftp.quit()
+
+    print
+    print lsep
+    print '    ********************* NOTE *************************'
+    print lsep
+    print 'To complete this release you must log into'
+    print 'http://sourceforge.net/projects/anuga as ANUGA admin'
+    print 'and complete the process by selecting File Releases '
+    print 'in the admin menu there.'
+    print lsep
+    print
+    print
+    
 
 
@@ -225,4 +262,5 @@
 if get_user_name() == 'ole' and get_host_name() == 'nautilus':
 
+    print 'Attempt to rsync data to perlite and datamining'
     # Copy to RAMP
     s = 'rsync -avz %s/* onielsen@cyclone:/d/cit/1/cit/natural_hazard_impacts/downloads/ANUGA_install/%s' %(release_dir, 'anuga_%s' %revision)
@@ -235,8 +273,7 @@
     
     # Copy to the ANU
-
-    s = 'rsync -avz %s/* ole@datamining.anu.edu.au:public_html/software/anuga/%s' %(release_dir, 'anuga_%s' %revision)
-    print s
-    system(s)
-    
-    
+    #s = 'rsync -avz %s/* ole@datamining.anu.edu.au:public_html/software/anuga/%s' %(release_dir, 'anuga_%s' %revision)
+    #print s
+    #system(s)
+    
+    
