Index: prview/MANIFEST.IN
===================================================================
--- prview/MANIFEST.IN	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
+++ prview/MANIFEST.IN	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
@@ -0,0 +1,4 @@
+
+
+
+
Index: prview/PrView.py
===================================================================
--- prview/PrView.py	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
+++ prview/PrView.py	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
@@ -0,0 +1,54 @@
+
+#!/usr/bin/env python
+import os
+import sys
+import imp
+import wx
+#import gui_manager
+from sans.guiframe import gui_manager
+from sans.guiframe.gui_manager import _find_local_config
+
+# For py2exe, import config here
+
+
+path = os.getcwd()
+local_config = _find_local_config('local_config', path)
+if local_config is None:
+    path, _ = os.path.split(os.getcwd())
+    local_config = _find_local_config('local_config', path)
+if local_config is None:
+    raise RuntimeError, "PrView cannot located local_config.py"
+
+
+class PrApp(gui_manager.ViewApp):
+    """
+    """
+   
+class PrView():
+    """
+    """
+    def __init__(self):
+        """
+        """
+        #from gui_manager import ViewApp
+        #self.gui = gui_manager.ViewApp(0) 
+        self.gui = PrApp(0)
+        # Add perspectives to the basic application
+        # Additional perspectives can still be loaded
+        # dynamically
+        import sans.perspectives.pr as module
+        self.pr_plug = module.Plugin(standalone=True)
+        self.gui.add_perspective(self.pr_plug)
+            
+        # Build the GUI
+        self.gui.build_gui()
+        
+        # Set the application manager for the GUI
+        self.gui.set_manager(self)
+        
+        # Start the main loop
+        self.gui.MainLoop()  
+        
+
+if __name__ == "__main__": 
+    sansview = PrView()
Index: prview/build_prview.py
===================================================================
--- prview/build_prview.py	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
+++ prview/build_prview.py	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
@@ -0,0 +1,284 @@
+# 
+# Script to get source from SVN and build PrView
+#
+# Read the release notes to make ensure that the required software is installed.
+#
+# SVN must be installed:
+# http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91
+#
+#
+# On Windows:
+#   - Make sure svn.exe in on the path. You might need to log out and log back in again after installing SVN.
+#   - Inno Setup must be installed
+#   - py2exe must be installed 
+#   - mingw must be installed
+#
+# In Mac:
+#   - py2app must be installed
+#   - macholib must be installed to use py2app
+#   - modulegraph must be installed to use py2app
+#
+# Usage:
+# python build_prview [command]
+# [command] can be any of the following:
+#   -h: lists the command line options
+#   -r: Builds a PrView using the released modules.
+#   -t: Builds PrView from the trunk.
+#   -i: Builds an installer from the release version.
+#   -n: Print out the dependencies for the release notes
+
+import os
+import sys
+import shutil
+import logging
+
+# Installation folder
+import time
+timestamp = int(time.time())
+CWD = os.getcwd()
+INSTALL_FOLDER = "install_%s" % str(timestamp)
+
+# On Windows, the python executable is not always on the path.
+# Use its most frequent location as the default.
+if sys.platform == 'win32':
+    PYTHON = "c:\python25\python"
+    LIB_FOLDER = "%s/%s" % (CWD, INSTALL_FOLDER)
+else:
+    PYTHON = 'python'
+
+logging.basicConfig(level=logging.INFO,
+                    format='%(asctime)s %(levelname)s %(message)s',
+                    filename='build_%s.log' % str(timestamp),
+                    filemode='w')
+
+SVN    = "svn"
+INNO   = "\"c:\Program Files\Inno Setup 5\ISCC\""
+
+# Release version 0.3.3
+DATALOADER = "0.2.7"
+GUICOMM    = "0.1.5"
+GUIFRAME   = "0.2.0"
+PRVIEW     = "0.3.3"
+PLOTTOOLS  = "0.1.9"
+UTIL       = "0.1.5"
+PR_INV = "0.2.5"
+
+# URLs for SVN repos
+DATALOADER_URL = "svn://danse.us/sans/releases/DataLoader-%s" % DATALOADER
+GUICOMM_URL = "svn://danse.us/sans/releases/guicomm-%s" % GUICOMM
+GUIFRAME_URL = "svn://danse.us/sans/releases/guiframe-%s" % GUIFRAME
+PLOTTOOLS_URL = "svn://danse.us/common/releases/plottools-%s/trunk" % PLOTTOOLS
+UTIL_URL = "svn://danse.us/common/releases/util-%s" % UTIL
+PRVIEW_URL = "svn://danse.us/sans/releases/prview-%s" % PRVIEW
+PR_INV_URL = "svn://danse.us/sans/releases/pr_inversion-%s" % PR_INV
+
+
+def check_system():
+    """
+        Checks that the system has the necessary modules.
+    """
+    try:
+        import wx
+    except:
+        logging.error("wxpython missing")
+    
+    try:
+        import matplotlib
+    except:
+        logging.error("matplotlib missing")
+        
+    try:
+        import numpy
+    except:
+        logging.error("numpy missing")
+        
+    try:
+        import scipy
+    except:
+        logging.error("scipy missing")
+        
+    if os.system("gcc -dumpversion")==1:
+        logging.error("missing mingw")
+
+def install_pkg(install_dir, setup_dir, url):
+    """
+        Check a package out and install it
+        
+        @param install_dir: directory to put the code in
+        @param setup_dir: relative location of the setup.py script
+        @param url: URL of the SVN repo
+    """
+    logging.info("Installing %s" % url)
+    try:
+        if not os.path.isdir(install_dir):
+            os.mkdir(install_dir)
+        os.chdir(install_dir)   
+        os.system("%s checkout -q %s" % (SVN, url))        
+        os.chdir(setup_dir)
+        if sys.platform == 'win32':
+            os.system("%s setup.py -q build -cmingw32" % PYTHON)
+            os.system("%s setup.py -q install --root \"%s\"" % (PYTHON, LIB_FOLDER))
+        else:
+            os.system("%s setup.py build" % PYTHON)
+            os.system("%s setup.py install --prefix ~/.local" % PYTHON)
+    except:
+        logging.error("Install failed for %s" % url)
+        logging.error(sys.exc_value)
+        raw_input("Press enter to continue\n")
+        sys.exit()
+    
+def checkout(release=False):
+    """
+        Check the PrView code out
+    """
+    wd = os.getcwd()
+    
+    os.chdir(wd)
+    if release:
+        install_pkg(".", "DataLoader-%s" % DATALOADER, DATALOADER_URL)
+    else:
+        install_pkg(".", "DataLoader", "svn://danse.us/sans/trunk/DataLoader")
+    
+    os.chdir(wd)
+    if release:
+        install_pkg(".", "guicomm-%s" % GUICOMM, GUICOMM_URL)
+    else:
+        install_pkg(".", "guicomm", "svn://danse.us/sans/trunk/guicomm")
+    
+    os.chdir(wd)
+    if release:
+        install_pkg(".", "guiframe-%s" % GUIFRAME, GUIFRAME_URL)
+    else:
+        install_pkg(".", "guiframe", "svn://danse.us/sans/trunk/guiframe")
+    
+    os.chdir(wd)
+    if release:
+        install_pkg("plottools-%s" % PLOTTOOLS, "trunk", PLOTTOOLS_URL)
+    else:
+        install_pkg("plottools", "trunk", "svn://danse.us/common/plottools/trunk")
+    
+    os.chdir(wd)
+    if release:
+        install_pkg(".", "util-%s" % UTIL, UTIL_URL)
+    else:
+        install_pkg(".", "util", "svn://danse.us/common/util")
+    
+    os.chdir(wd)
+    if release:
+        install_pkg(".", "pr_inversion-%s" % PR_INV, PR_INV_URL)
+    else:
+        install_pkg(".", "pr_inversion", "svn://danse.us/sans/trunk/pr_inversion")
+    
+    os.chdir(wd)
+    if release:
+        os.system("%s checkout -q %s" % (SVN, PRVIEW_URL))
+    else:
+        os.system("%s checkout -q svn://danse.us/sans/trunk/prview" % SVN)
+    
+def prepare(wipeout = False):
+    """
+        Prepare the build
+        
+        @param wipeout: If True, the DANSE modules in the standard site-packages will be
+        removed to avoid conflicts.
+    """
+    # Remove existing libraries
+    if wipeout == True:
+        logging.info("Deleting DANSES modules in site-packages")
+        from distutils.sysconfig import get_python_lib
+        libdir = get_python_lib()
+        old_dirs = [os.path.join(libdir, 'danse'),
+                    os.path.join(libdir, 'data_util'),
+                    os.path.join(libdir, 'DataLoader'),
+                    os.path.join(libdir, 'sans'),
+                    os.path.join(libdir, 'sans_extension'),
+                    ]
+        for d in old_dirs:
+            if os.path.isdir(d):
+                shutil.rmtree(d)
+        
+    # Create a fresh installation folder
+    if os.path.isdir(INSTALL_FOLDER):
+        shutil.rmtree(INSTALL_FOLDER)
+
+    os.mkdir(INSTALL_FOLDER)
+    
+    # Check that the dependencies are properly installed
+    check_system()    
+    
+    # Move to the installation folder
+    os.chdir(INSTALL_FOLDER)   
+
+def warning():
+    """
+        The build script will wipe out part of the site-packages.
+        Ask the user whether he wants to proceed.
+    """
+    print "WARNING!\n"
+    print "In order to build a clean version of PrView, this script"
+    print "deletes anything found under site-packages for the following"
+    print "modules:"
+    print "   - danse"
+    print "   - data_util"
+    print "   - DataLoader"
+    print "   - sans"
+    print "   - sans_extension\n"
+    answer = raw_input("Do you want to delete those modules [Y] or continue with a dirty installation [N]? [Y|N]")
+    return answer.upper()=="Y"
+        
+if __name__ == "__main__": 
+    print "Build script for PrView %s" % PRVIEW
+    
+    if len(sys.argv)==1:
+        # If there is no argument, build the installer
+        sys.argv.append("-i")
+    
+    if len(sys.argv)>1:
+        # Help
+        if sys.argv[1]=="-h":
+            print "Usage:"
+            print "    python build_prview [command]\n"
+            print "[command] can be any of the following:"
+            print "    -h: lists the command line options"
+            print "    -r: Builds a PrView using the released modules"
+            print "    -t: Builds PrView from the trunk"
+            print "    -i: Builds an installer from the release version [Windows only]"        
+            print "    -n: Print out the dependencies for the release notes"
+        elif sys.argv[1]=="-n":
+            # Print out release URLs
+            print DATALOADER_URL 
+            print GUICOMM_URL 
+            print GUIFRAME_URL 
+            print PLOTTOOLS_URL 
+            print UTIL_URL 
+            print PRVIEW_URL
+            print PR_INV_URL 
+        else:
+            logging.info("Build script for PrView %s" % PRVIEW)
+                    
+            # Prepare installation folder
+            prepare(warning())
+            
+            # Check the command line argument
+            if sys.argv[1]=="-t":
+                logging.info("Building trunk version")
+                checkout()
+            elif sys.argv[1]=="-r":
+                logging.info("Building release version")
+                checkout(True)
+            elif sys.argv[1]=="-i":
+                logging.info("Building release version")
+                checkout(True)
+                if sys.platform=='win32':
+                    logging.info("Building Windows installer from release version")
+                    os.chdir("prview-%s" % (PRVIEW))
+                    os.system("%s setup_exe.py py2exe --extrapath \"%s\python25\lib\site-packages\"" % (PYTHON, LIB_FOLDER))
+                    os.system("%s/Q installer.iss" % INNO)
+                    shutil.copy2(os.path.join("Output","setupSansView.exe"), 
+                                 os.path.join(CWD, "setupSansView_%s.exe" % str(timestamp)))
+                elif sys.platform=='darwin':
+                    logging.info("Building Mac application from release version")
+                    os.chdir("prview-%s" % (PRVIEW))
+                    os.system("%s setup_mac.py py2app" % PYTHON)                    
+                    
+    raw_input("Press enter to continue\n")
Index: prview/custom_config.py
===================================================================
--- prview/custom_config.py	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
+++ prview/custom_config.py	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
@@ -0,0 +1,1 @@
+#Application appearance custom configuration
Index: prview/installer.iss
===================================================================
--- prview/installer.iss	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
+++ prview/installer.iss	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
@@ -0,0 +1,42 @@
+; Script generated by the Inno Setup Script Wizard.
+; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+
+[Setup]
+AppName=PrView-0.3
+AppVerName=PrView 0.3
+AppPublisher=University of Tennessee
+AppPublisherURL=http://danse.chem.utk.edu/
+AppSupportURL=http://danse.chem.utk.edu/
+AppUpdatesURL=http://danse.chem.utk.edu/
+DefaultDirName={pf}\PrView-0.3
+DefaultGroupName=DANSE\PrView-0.3
+DisableProgramGroupPage=yes
+LicenseFile=license.txt
+OutputBaseFilename=setupPrView
+SetupIconFile=images\ball.ico
+Compression=lzma
+SolidCompression=yes
+PrivilegesRequired=none
+
+[Languages]
+Name: "english"; MessagesFile: "compiler:Default.isl"
+Name: "french"; MessagesFile: "compiler:Languages\French.isl"
+Name: "german"; MessagesFile: "compiler:Languages\German.isl"
+
+[Tasks]
+Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
+
+[Files]
+Source: "dist\prView.exe"; DestDir: "{app}"; Flags: ignoreversion
+Source: "dist\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
+Source: "images\*"; DestDir: "{app}\images"; Flags: ignoreversion recursesubdirs createallsubdirs
+; NOTE: Don't use "Flags: ignoreversion" on any shared system files
+
+[Icons]
+Name: "{group}\PrView"; Filename: "{app}\prView.exe"; WorkingDir: "{app}"
+Name: "{group}\{cm:UninstallProgram,PrView}"; Filename: "{uninstallexe}"
+Name: "{commondesktop}\PrView"; Filename: "{app}\prView.exe"; Tasks: desktopicon; WorkingDir: "{app}"
+
+[Run]
+Filename: "{app}\prView.exe"; Description: "{cm:LaunchProgram,PrView}"; Flags: nowait postinstall skipifsilent
+
Index: prview/license.txt
===================================================================
--- prview/license.txt	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
+++ prview/license.txt	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
@@ -0,0 +1,13 @@
+This software was developed by the University of Tennessee as part of the
+Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+project funded by the US National Science Foundation. 
+
+If you use DANSE applications to do scientific research that leads to publication, 
+we ask that you acknowledge the use of the software with the following sentence:
+
+"This work benefited from DANSE software developed under NSF award DMR-0520547." 
+
+See the DANSE project web site for license information:
+http://wiki.cacr.caltech.edu/danse/index.php/Main_Page
+
+copyright 2008, University of Tennessee for the DANSE project
Index: prview/local_config.py
===================================================================
--- prview/local_config.py	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
+++ prview/local_config.py	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
@@ -0,0 +1,97 @@
+"""
+Application settings
+"""
+import time
+import os
+from sans.guiframe.gui_style import GUIFRAME
+
+# Version of the application
+__appname__ = "PrView"
+__version__ = '0.3.0'
+__download_page__ = 'http://danse.chem.utk.edu'
+__update_URL__ = 'http://danse.chem.utk.edu/prview_version.php'
+
+
+# Debug message flag
+__EVT_DEBUG__ = False
+
+# Flag for automated testing
+__TEST__ = False
+
+# Debug message should be written to a file?
+__EVT_DEBUG_2_FILE__   = False
+__EVT_DEBUG_FILENAME__ = "debug.log"
+
+# About box info
+_do_aboutbox=True
+_acknowledgement =  \
+'''This software was developed by the University of Tennessee as part of the
+Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+project funded by the US National Science Foundation. 
+
+If you use DANSE applications to do scientific research that leads to publication, 
+we ask that you acknowledge the use of the software with the following sentence:
+
+"This work benefited from DANSE software developed under NSF award DMR-0520547." 
+'''
+_homepage = "http://danse.chem.utk.edu"
+_download = "http://danse.chem.utk.edu/prview.html"
+_authors = []
+_paper = "http://danse.us/trac/sans/newticket"
+_license = "mailto:sansdanse@gmail.com"
+
+_nsf_logo = "images/nsf_logo.png"
+_danse_logo = "images/danse_logo.png"
+_inst_logo = "images/utlogo.gif"
+_nsf_url = "http://www.nsf.gov"
+_danse_url = "http://www.cacr.caltech.edu/projects/danse/release/index.html"
+_inst_url = "http://www.utk.edu"
+_corner_image = "images/prview.jpg"
+_copyright = "(c) 2008, University of Tennessee"
+#edit the list of file state your plugin can read
+
+APPLICATION_STATE_EXTENSION = '.prv'
+APPLICATION_WLIST = 'P(r) files (*.prv)|*.prv'
+DEFAULT_STYLE = GUIFRAME.DEFAULT_STYLE
+GUIFRAME_WIDTH = 900
+GUIFRAME_HEIGHT = 780
+PLUGIN_STATE_EXTENSIONS = ['.prv']
+PLUGINS_WLIST = ['P(r) files (*.prv)|*.prv']
+PLOPANEL_WIDTH = 350
+PLOPANEL_HEIGTH = 350
+SPLASH_SCREEN_PATH = os.path.join("images", "danse_logo.png")
+SPLASH_SCREEN_WIDTH = 500
+SPLASH_SCREEN_HEIGHT = 300
+SS_MAX_DISPLAY_TIME = 3000 #3 sec
+SetupIconFile_win = os.path.join("images", "ball.ico")
+SetupIconFile_mac = os.path.join("images", "ball.icns")
+DefaultGroupName = "DANSE"
+OutputBaseFilename = "setupPrView"
+DATAPANEL_WIDTH = 235
+DATAPANEL_HEIGHT = 700
+FIXED_PANEL = True
+DATALOADER_SHOW = True
+CLEANUP_PLOT = False
+WELCOME_PANEL_SHOW = False
+#Show or hide toolbar at the start up
+TOOLBAR_SHOW = True
+#Open Save project menu
+OPEN_SAVE_PROJECT_MENU = True
+#VIEW MENU
+VIEW_MENU = True
+#EDIT MENU
+EDIT_MENU = True
+# set a default perspective
+DEFAULT_PERSPECTIVE = 'None'
+import wx.lib.newevent
+(StatusBarEvent, EVT_STATUS) = wx.lib.newevent.NewEvent()
+
+def printEVT(message):
+    if __EVT_DEBUG__:
+        print "%g:  %s" % (time.clock(), message)
+        
+        if __EVT_DEBUG_2_FILE__:
+            out = open(__EVT_DEBUG_FILENAME__, 'a')
+            out.write("%10g:  %s\n" % (time.clock(), message))
+            out.close()
+            
Index: prview/release_notes.txt
===================================================================
--- prview/release_notes.txt	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
+++ prview/release_notes.txt	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
@@ -0,0 +1,91 @@
+Release Notes
+=============
+
+PrView 0.3
+
+Package name: prview
+
+1- Version 0.3.0
+	- Release date: 7/4/2009
+	- Added installer for compatibility with guiframe/sansview
+	- Added functionality to save inversion results
+	- Added functionality to explore d_max range and see results plotted as a function of d_max
+    
+   Version 0.2.3
+	- Release date: 10/24/2008
+	- Protected against loading files with multiple data entries (like cansas XML).
+	- Added functionality to load various data formats.
+	- Fixed problem with loading additional data after the P(r) graph's scale has been changed.
+	- Fixed problem of silent failure upon loading a file with a point at Q=0.
+	- Added use of SANS DataLoader   
+    - Mac compatibility 
+    
+   Version 0.2.2
+	- Release date: 7/8/2008
+	- Added option to normalize P(r) to 1, scale P_max to 1, or leave as is.
+	- Fixed problem with changing the number of P(r) points.
+
+   Version 0.2.1
+	- Release date: 7/04/2008
+	- Improved user interface.
+	- Automated estimate of the number of terms.
+	- I(q=0) and Rg are now outputs of the inversion.
+	- Slit smearing has been added.
+	- Constant background estimation.
+	- Functionality to compare p(r) output with data from a file.
+	- Functionality to change the number of p(r) points of the output distribution.
+
+   Version 0.1.0
+
+	- Release date: 5/28/2008
+	- First version put together built on guiframe.
+
+2- Downloading and Installing
+
+	2.1- System Requirements:
+		- Python version >= 2.4 should be running on the system
+
+	2.2- Installing:
+		- Get the code from svn://danse.us/sans/releases/prview-0.2.4
+		- This application is also dependent on the following DANSE code:
+			svn://danse.us/common/releases/plottools-0.1.6
+			svn://danse.us/common/releases/util-0.1.2 
+			svn://danse.us/sans/releases/DataLoader-0.2.4 
+			svn://danse.us/sans/releases/guicomm-0.1.3 
+			svn://danse.us/sans/releases/guiframe-0.1.7
+			svn://danse.us/sans/releases/pr_inversion-0.2.2 
+		- The following modules are required:
+			* matplotlib
+			* numpy
+			* scipy
+			* wxpython
+			* PyXML (for cansas reader)
+
+3- Known Issues
+
+	3.1- All systems:
+		- None
+
+	3.2- Windows:
+		- None
+
+	3.3- Mac OS:
+		- Context menu dialog interfere with dragging when displayed over plots.
+
+4- Troubleshooting
+
+	- None
+
+5- Frequently Asked Questions
+
+	- None
+
+6- Other Resources
+
+	- See: http://danse.chem.utk.edu/prview.html
+
+	
+
+	
+
+
Index: prview/requirements.txt
===================================================================
--- prview/requirements.txt	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
+++ prview/requirements.txt	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
@@ -0,0 +1,32 @@
+1. Thread [done]
+2. Find good defaults. Automate the inversion.
+   -How do we estimate d_max? Guinier fit?
+   -How do we estimate alpha? [done]
+   Compute the residuals once and choose a value that brings the reg term up to 
+   a fraction of the residuals.
+3. When fitting a plottable on a Graph with multiple plottables, remember the one the user chose [done]
+4. What q-range do we need to make it work? What are the constraints? [studied by Raiza]
+5. Create handshake so that a plug-in can set context menu items to its own panels... [done]
+6. Return figure of merit values and suggest the values for d_max and alpha. [alpha, nfunc done]
+7. Show time estimate [done]
+8. Plot the reg term alone to see what it looks like 
+9. Use data loader perspective/plug-in to load data/choose file [done]
+10. Common module for file reading and file choosing 
+11. Define limits of applicability 
+12. Return figures of merit [done]
+13. Errors on output constants [done]
+14. Clean up the InversionDialog [done]
+15. Add online help for inputs and outputs (especially figures of merit) [done]
+16. Add help text to the interface (description of what we are minimizing, to explain alpha and nfunc).
+17. Get rid of all output prints. 
+18. Clean up
+19. Replace help dialog text with a nice image. Mention how to choose alpha and what the suggested alpha means.
+20. If a figure of merit is clearly bad, put its background red
+21. Option to save data. [done]
+22. If you click compute before loading data, an error occurs. [fixed]
+23. Plot I(q) immediately when you choose a new file. [done]
+24. *** probably need to ship the perspectives separately...
+25. If no data is available, disable the Fit button. [Message sent instead]
+26. Remove an added curve...
+27. Add multiple additional data curves.
+28. Use Data Loader.
Index: prview/setup_exe.py
===================================================================
--- prview/setup_exe.py	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
+++ prview/setup_exe.py	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
@@ -0,0 +1,143 @@
+#!/usr/bin/env python
+
+#
+# The setup to create a Windows executable.
+# Inno Setup can then be used with the installer.iss file 
+# in the top source directory to create an installer. 
+#
+# Setuptools clashes with py2exe 0.6.8 (and probably later too).
+# For that reason, most of the code needs to have direct imports
+# that are not going through pkg_resources. 
+#
+# Attention should be paid to dynamic imports. Data files can
+# be added to the distribution directory for that purpose.
+# See for example the 'images' directory below.
+
+import os
+import sys
+
+# When using the SansView build script, we need to be able to pass
+# an extra path to be added to the python path. The extra arguments
+# should be removed from the list so that the setup processing doesn't
+# fail.
+try:
+    if sys.argv.count('--extrapath'):
+        path_flag_idx = sys.argv.index('--extrapath')
+        extra_path = sys.argv[path_flag_idx+1]
+        sys.path.insert(0, extra_path)
+        del sys.argv[path_flag_idx+1]
+        sys.argv.remove('--extrapath')
+except:
+    print "Error processing extra python path needed to build SansView\n  %s" % sys.exc_value
+
+from distutils.core import setup
+from distutils.filelist import findall
+import matplotlib
+import py2exe
+
+manifest = """
+   <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+   <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
+   manifestVersion="1.0">
+   <assemblyIdentity
+       version="0.64.1.0"
+       processorArchitecture="x86"
+       name="Controls"
+       type="win32"
+   />
+   <description>PrView</description>
+   <dependency>
+       <dependentAssembly>
+           <assemblyIdentity
+               type="win32"
+               name="Microsoft.Windows.Common-Controls"
+               version="6.0.0.0"
+               processorArchitecture="X86"
+               publicKeyToken="6595b64144ccf1df"
+               language="*"
+           />
+       </dependentAssembly>
+   </dependency>
+   </assembly>
+  """
+
+    
+class Target:
+    def __init__(self, **kw):
+        self.__dict__.update(kw)
+        # for the versioninfo resources
+        self.version = "0.3"
+        self.company_name = "U Tennessee"
+        self.copyright = "copyright 2009"
+        self.name = "PrView"
+        
+#
+# Adapted from http://www.py2exe.org/index.cgi/MatPlotLib
+# to use the MatPlotLib.
+#
+matplotlibdatadir = matplotlib.get_data_path()
+matplotlibdata = findall(matplotlibdatadir)
+data_files = []
+
+for f in matplotlibdata:
+    dirname = os.path.join('mpl-data', f[len(matplotlibdatadir)+1:])
+    data_files.append((os.path.split(dirname)[0], [f]))
+
+# Copying the images directory to the distribution directory.
+for f in findall('images'):
+    if os.path.split(f)[0].count('.svn')==0:
+        data_files.append((os.path.split(f)[0], [f]))
+
+# Copying the sample data user data
+for f in findall('test'):
+    if os.path.split(f)[0].count('.svn')==0:
+        data_files.append((os.path.split(f)[0], [f]))
+        
+# Copying the sample data user data
+for f in findall('plugins'):
+    if os.path.split(f)[0].count('.svn')==0:
+        data_files.append((os.path.split(f)[0], [f]))
+    
+#
+# packages
+#
+packages = ['matplotlib', 'pytz']
+includes = []
+excludes = [] 
+
+dll_excludes = [
+    'libgdk_pixbuf-2.0-0.dll', 
+    'libgobject-2.0-0.dll',
+    'libgdk-win32-2.0-0.dll',
+    ]
+
+target_wx_client = Target(
+    description = 'P(r) inversion viewer',
+    script = 'PrView.py',
+    icon_resources = [(1, "images/ball.ico")],
+    other_resources = [(24,1,manifest)],
+    dest_base = "prView"
+    )
+
+
+
+setup(
+    windows=[target_wx_client],
+    console=[],
+    
+    options={
+        'py2exe': {
+            'dll_excludes': dll_excludes,
+            'packages' : packages,
+            'includes':includes,
+            'excludes':excludes,
+            "compressed": 1,
+            "optimize": 0,
+            "bundle_files":2,
+            },
+    },
+    data_files=data_files
+    
+)
+
+
Index: prview/setup_mac.py
===================================================================
--- prview/setup_mac.py	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
+++ prview/setup_mac.py	(revision 29c15beca991d4e2bed305d670ffb7bfd4efef94)
@@ -0,0 +1,37 @@
+"""
+    Setup script to build a Mac app
+"""
+from setuptools import setup
+import DataLoader.readers 
+import os
+
+#Data reader data files
+
+RESOURCES_FILES = os.path.join(DataLoader.readers.get_data_path(),'defaults.xml')
+
+# Locate libxml2 library
+lib_locs = ['/usr/local/lib', '/usr/lib']
+libxml_path = None
+for item in lib_locs:
+    libxml_path_test = '%s/libxml2.2.dylib' % item
+    if os.path.isfile(libxml_path_test): 
+        libxml_path = libxml_path_test
+if libxml_path == None:
+    raise RuntimeError, "Could not find libxml2 on the system"
+
+APP = ['PrView.py']
+DATA_FILES = ['images', 'test', 'plugins']
+OPTIONS = {'argv_emulation': True,
+           'packages': ['lxml'],
+           'iconfile': 'images/ball.icns',
+           'frameworks':[libxml_path],
+           'resources': RESOURCES_FILES
+           }
+
+setup(
+    app=APP,
+    data_files=DATA_FILES,
+    include_package_data= True,
+    options={'py2app': OPTIONS},
+    setup_requires=['py2app'],
+)
