Index: calculatorview/MANIFEST.IN
===================================================================
--- calculatorview/MANIFEST.IN	(revision def0f332e27e2c81cec49373f0ccbf2c15d07fca)
+++ calculatorview/MANIFEST.IN	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
@@ -1,4 +1,4 @@
 graft docs
-graft scripts
+graft test
 include README.txt
 include release_notes.txt
Index: calculatorview/build/lib/sans/perspectives/calculator/media/kiessig_calculator_help.html
===================================================================
--- calculatorview/build/lib/sans/perspectives/calculator/media/kiessig_calculator_help.html	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
+++ calculatorview/build/lib/sans/perspectives/calculator/media/kiessig_calculator_help.html	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
@@ -0,0 +1,27 @@
+<html>
+<body>
+<h4>Kiessig Thickness Calculator</h4>
+<ul>
+<li><a href="#Description">Description:</a></li>
+<li><a href="#HowTo">HowTo?</a></li>
+
+</ul>
+<h5><a name="Description">Description</a></h5>
+<p>
+This tool is to approximately estimate the thickness of a layer
+ or the diameter of particles from the Kiessig fringe in 
+ SANS/NR data, and uses the Kiessig relation;
+ thickness = 2*Pi/fringe_width.
+  
+</p>
+
+
+<h5><a name="HowTo">HowTo?</a></h5>
+<p>
+To get a rough thickness or particle size, just type the Kiessig fringe width (in the 1/A unit)
+ and click on the 'Compute' button. Then the output value will be show up in the 'Thickness' text box.</p>
+
+
+</body>
+
+</html>
Index: calculatorview/build/lib/sans/perspectives/calculator/media/resolution_calculator_help.html
===================================================================
--- calculatorview/build/lib/sans/perspectives/calculator/media/resolution_calculator_help.html	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
+++ calculatorview/build/lib/sans/perspectives/calculator/media/resolution_calculator_help.html	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
@@ -0,0 +1,41 @@
+<html>
+<body>
+<h4>SANS Q Resolution Estimator</h4>
+<ul>
+<li><a href="#Description">Description:</a></li>
+<li><a href="#HowTo">HowTo?</a></li>
+
+</ul>
+<h5><a name="Description">Description</a></h5>
+<p>
+This tool is to approximately estimate the resolution of Q based on the
+SANS instrumental parameter values assuming that the detector is flat 
+and vertical to the incident beam direction.
+</p>
+
+
+<h5><a name="HowTo">HowTo?</a></h5>
+<p>
+1. Change the default values of the instrumental parameters as desired,
+and type the qx and qy value where the resolution
+is calculated. 
+</p>
+<p>
+2. Select the coordinate system from the radio button.
+</p>
+<p>
+3. Click on the compute button.
+</p>
+<p> 
+4. 1D and 2D dQ will be displayed in the text-box at the bottom of 
+the panel. Two dimensional resolution weight distribution 
+(2D elliptical Gaussian function) will also be 
+displayed in the plot panel even if the Q inputs are outside 
+of the detector limit.
+The red lines indicate the limits of the detector. 
+</p>
+<p><img src="resolution_tutor.gif">
+</p>
+</body>
+
+</html>
Index: calculatorview/build/lib/sans/perspectives/calculator/media/sld_calculator_help.html
===================================================================
--- calculatorview/build/lib/sans/perspectives/calculator/media/sld_calculator_help.html	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
+++ calculatorview/build/lib/sans/perspectives/calculator/media/sld_calculator_help.html	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
@@ -0,0 +1,42 @@
+<html>
+<body>
+<h4>Scattering Length Density (SLD) Calculator</h4>
+<ul>
+<li><a href="#SLD_calculator">Description</a></li>
+<li><a href="#How to use">How to format the compound name?</a></li>
+</ul>
+<h5><a name="SLD_calculator">Description</a></h5>
+<p>
+The neutron scattering length density is defined as: <br> 
+SLD = (b_c1 +b_c2+...+b_cn )/Vm  <br> where b_ci is the bound coherent scattering length of ith of 
+n atoms in a molecule with the molecular volume Vm
+</p>
+
+
+<h5><a name="How to use">How to format the compound name?</a></h5>
+<p>
+To calculate scattering length densities enter a compound and
+a mass density and click "Calculate". Enter a wavelength value is optional and its default 
+value will be 6.0A.
+</p> 
+<p>
+<ul>
+<li>Formula strings consist of counts and atoms such as "CaCO3+6H2O".</li>
+<li>Groups can be separated by <b>'+'</b> or <b>space</b>, so "CaCO3 6H2O" works as well.</li>
+<li>Groups and be defined using parentheses, such as "CaCO3(H2O)6".</li>
+<li>Parentheses can nest: "(CaCO3(H2O)6)1".</li>
+<li>Isotopes are represented by index, e.g., "CaCO[18]3+6H2O".</li>
+More examples: H[1], H[2].
+<li>Counts can be integer or decimal, e.g. "CaCO3+(3HO0.5)2".</li>
+Other compositions can be calculated as well,<br>
+for example a 70-30 mixture of H2O/D2O can be written as <b>H14O7+ D6O3</b><br>
+or more simply <b>H7D3O5 <\b>(i.e. 7 hydrogens, 3 deuteriums, and 5 oxygens)<br>
+and the mass density calculated based on the percentages of H and D. 
+Type for example "C[13]6 H[2]12 O[18]6" for C(13)6H(2)12O(18)6 (6 Carbon-13 atoms, 12 deuterium atoms, and 6 Oxygen-18 atoms) 
+
+</ul>
+</p>
+
+</body>
+
+<\html>
Index: calculatorview/build/lib/sans/perspectives/calculator/media/slit_calculator_help.html
===================================================================
--- calculatorview/build/lib/sans/perspectives/calculator/media/slit_calculator_help.html	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
+++ calculatorview/build/lib/sans/perspectives/calculator/media/slit_calculator_help.html	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
@@ -0,0 +1,33 @@
+<html>
+<body>
+<h4>Slit Size Calculator</h4>
+<ul>
+<li><a href="#Description">Description:</a></li>
+<li><a href="#HowTo">HowTo?</a></li>
+<li><a href="#Note">Note</a></li>
+</ul>
+<h5><a name="Description">Description</a></h5>
+<p>
+This tool is for X-ray users to calculate the slit size (FWHM/2) 
+for smearing  based on their half beam profile data (SAXSess). 
+</p>
+
+
+<h5><a name="HowTo">HowTo?</a></h5>
+<p>
+To calculate the slit size (FWHM/2), just load the beam profile data using the browse button. </p>
+<p>
+Once a data is loaded, the slit size will be computed and show up in the text box. </p>
+<p>
+Because the unit is not specified in the data file, we do not convert it into 1/A so that users are responsible for converting the unit.
+</p>
+
+<h5><a name="Note">Note: </a></h5>
+This slit size calculator is working only for a beam profile data produced by 'SAXSess'. 
+
+<p>
+To see the file format, check the file, 'beam profile.DAT', in the 'test' folder of SansView. 
+</p>
+</body>
+
+</html>
Index: calculatorview/custom_config.py
===================================================================
--- calculatorview/custom_config.py	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
+++ calculatorview/custom_config.py	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
@@ -0,0 +1,11 @@
+#Application appearance custom configuration
+DATAPANEL_WIDTH = 235
+FIXED_PANEL = True
+PLOPANEL_WIDTH = 415
+DATALOADER_SHOW = False
+GUIFRAME_HEIGHT = 100
+GUIFRAME_WIDTH = 400
+CLEANUP_PLOT = False
+WELCOME_PANEL_SHOW = False
+TOOLBAR_SHOW = False
+DEFAULT_PERSPECTIVE = "Calculator"
Index: calculatorview/local_config.py
===================================================================
--- calculatorview/local_config.py	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
+++ calculatorview/local_config.py	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
@@ -0,0 +1,97 @@
+"""
+    Application settings
+"""
+import time
+import os
+from sans.guiframe.gui_style import GUIFRAME
+# Version of the application
+__appname__ = "SansViewTool"
+__version__ = '0.9.2dev'
+__download_page__ = 'http://danse.chem.utk.edu'
+#__update_URL__ = 'http://danse.chem.utk.edu/sansview_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
+_do_tutorial = False
+_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. 
+
+'''
+_homepage = "http://danse.chem.utk.edu"
+_download = "http://danse.chem.utk.edu/sansview.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/angles_flat.png"
+_welcome_image = "images/SVwelcome.png"
+_copyright = "(c) 2009, University of Tennessee"
+
+
+#edit the list of file state your plugin can read
+APPLICATION_WLIST = ''
+APPLICATION_STATE_EXTENSION = ''
+GUIFRAME_WIDTH = 300
+GUIFRAME_HEIGHT = 200
+PLUGIN_STATE_EXTENSIONS = []
+PLUGINS_WLIST = []
+PLOPANEL_WIDTH = 415
+PLOPANEL_HEIGTH = 370
+DATAPANEL_WIDTH = 235
+DATAPANEL_HEIGHT = 700
+SPLASH_SCREEN_PATH = os.path.join("images","SVwelcome_mini.png")
+TUTORIAL_PATH = os.path.join("media","Tutorial.pdf")
+DEFAULT_STYLE = GUIFRAME.CALCULATOR_ON
+SPLASH_SCREEN_WIDTH = 512
+SPLASH_SCREEN_HEIGHT = 366
+SS_MAX_DISPLAY_TIME = 6000 #6 sec
+WELCOME_PANEL_ON  = False
+CLEANUP_PLOT = False
+SetupIconFile_win = os.path.join("images", "ball.ico")
+SetupIconFile_mac = os.path.join("images", "ball.icns")
+DefaultGroupName = "DANSE"
+OutputBaseFilename = "setupSansViewTool"
+DATAPANEL_WIDTH = 235
+FIXED_PANEL = True
+DATALOADER_SHOW = False
+CLEANUP_PLOT = False
+WELCOME_PANEL_SHOW = False
+#Open Save project menu
+OPEN_SAVE_PROJECT_MENU = False
+#VIEW MENU
+VIEW_MENU = False
+#EDIT MENU
+EDIT_MENU = False
+#Show or hide toolbar at the start up
+TOOLBAR_SHOW = False
+# set a default perspective
+DEFAULT_PERSPECTIVE = 'None'
+
+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: calculatorview/sansviewtool.py
===================================================================
--- calculatorview/sansviewtool.py	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
+++ calculatorview/sansviewtool.py	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
@@ -0,0 +1,60 @@
+
+################################################################################
+#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. 
+#
+#See the license text in license.txt
+#
+#copyright 2009, University of Tennessee
+################################################################################
+
+import wx
+from sans.guiframe import gui_manager
+
+# For py2exe, import config here
+import local_config
+import logging
+import sys
+class SansViewToolApp(gui_manager.ViewApp):
+    """
+    """
+    
+   
+class SansViewTool():
+    """
+    """
+    def __init__(self):
+        """
+        """
+        #from gui_manager import ViewApp
+        self.gui = SansViewToolApp(0) 
+        # Set the application manager for the GUI
+        self.gui.set_manager(self)
+        # Add perspectives to the basic application
+        # Additional perspectives can still be loaded
+        # dynamically
+        # Note: py2exe can't find dynamically loaded
+        # modules. We load the fitting module here
+        # to ensure a complete Windows executable build.
+        
+        
+        #Calculator perspective   
+        try:
+            import sans.perspectives.calculator as module    
+            calculator_plug = module.Plugin(standalone=True)
+            self.gui.add_perspective(calculator_plug)
+        except:
+            logging.error("SansView: could not find Calculator plug-in module")
+            logging.error(sys.exc_value)  
+
+      
+        # Build the GUI
+        self.gui.build_gui()
+        
+        # Start the main loop
+        self.gui.MainLoop() 
+        
+
+if __name__ == "__main__": 
+    sansviewtool = SansViewTool()
Index: lculatorview/scripts/custom_config.py
===================================================================
--- calculatorview/scripts/custom_config.py	(revision 8ddaa9b2af5661631a85f868fa98cda49a62b5c5)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#Application appearance custom configuration
-DATAPANEL_WIDTH = 235
-FIXED_PANEL = True
-PLOPANEL_WIDTH = 415
-DATALOADER_SHOW = False
-GUIFRAME_HEIGHT = 100
-GUIFRAME_WIDTH = 400
-CLEANUP_PLOT = False
-WELCOME_PANEL_SHOW = False
-TOOLBAR_SHOW = False
-DEFAULT_PERSPECTIVE = "Calculator"
Index: lculatorview/scripts/local_config.py
===================================================================
--- calculatorview/scripts/local_config.py	(revision 8e3dc19e70bc161819fbe6590c0384552a35aa9a)
+++ 	(revision )
@@ -1,97 +1,0 @@
-"""
-    Application settings
-"""
-import time
-import os
-from sans.guiframe.gui_style import GUIFRAME
-# Version of the application
-__appname__ = "SansViewTool"
-__version__ = '0.9.2dev'
-__download_page__ = 'http://danse.chem.utk.edu'
-#__update_URL__ = 'http://danse.chem.utk.edu/sansview_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
-_do_tutorial = False
-_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. 
-
-'''
-_homepage = "http://danse.chem.utk.edu"
-_download = "http://danse.chem.utk.edu/sansview.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/angles_flat.png"
-_welcome_image = "images/SVwelcome.png"
-_copyright = "(c) 2009, University of Tennessee"
-
-
-#edit the list of file state your plugin can read
-APPLICATION_WLIST = ''
-APPLICATION_STATE_EXTENSION = ''
-GUIFRAME_WIDTH = 300
-GUIFRAME_HEIGHT = 200
-PLUGIN_STATE_EXTENSIONS = []
-PLUGINS_WLIST = []
-PLOPANEL_WIDTH = 415
-PLOPANEL_HEIGTH = 370
-DATAPANEL_WIDTH = 235
-DATAPANEL_HEIGHT = 700
-SPLASH_SCREEN_PATH = os.path.join("images","SVwelcome_mini.png")
-TUTORIAL_PATH = os.path.join("media","Tutorial.pdf")
-DEFAULT_STYLE = GUIFRAME.CALCULATOR_ON
-SPLASH_SCREEN_WIDTH = 512
-SPLASH_SCREEN_HEIGHT = 366
-SS_MAX_DISPLAY_TIME = 6000 #6 sec
-WELCOME_PANEL_ON  = False
-CLEANUP_PLOT = False
-SetupIconFile_win = os.path.join("images", "ball.ico")
-SetupIconFile_mac = os.path.join("images", "ball.icns")
-DefaultGroupName = "DANSE"
-OutputBaseFilename = "setupSansViewTool"
-DATAPANEL_WIDTH = 235
-FIXED_PANEL = True
-DATALOADER_SHOW = False
-CLEANUP_PLOT = False
-WELCOME_PANEL_SHOW = False
-#Open Save project menu
-OPEN_SAVE_PROJECT_MENU = False
-#VIEW MENU
-VIEW_MENU = False
-#EDIT MENU
-EDIT_MENU = False
-#Show or hide toolbar at the start up
-TOOLBAR_SHOW = False
-# set a default perspective
-DEFAULT_PERSPECTIVE = 'None'
-
-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: lculatorview/scripts/sansviewtool.py
===================================================================
--- calculatorview/scripts/sansviewtool.py	(revision 8ddaa9b2af5661631a85f868fa98cda49a62b5c5)
+++ 	(revision )
@@ -1,60 +1,0 @@
-
-################################################################################
-#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. 
-#
-#See the license text in license.txt
-#
-#copyright 2009, University of Tennessee
-################################################################################
-
-import wx
-from sans.guiframe import gui_manager
-
-# For py2exe, import config here
-import local_config
-import logging
-import sys
-class SansViewToolApp(gui_manager.ViewApp):
-    """
-    """
-    
-   
-class SansViewTool():
-    """
-    """
-    def __init__(self):
-        """
-        """
-        #from gui_manager import ViewApp
-        self.gui = SansViewToolApp(0) 
-        # Set the application manager for the GUI
-        self.gui.set_manager(self)
-        # Add perspectives to the basic application
-        # Additional perspectives can still be loaded
-        # dynamically
-        # Note: py2exe can't find dynamically loaded
-        # modules. We load the fitting module here
-        # to ensure a complete Windows executable build.
-        
-        
-        #Calculator perspective   
-        try:
-            import sans.perspectives.calculator as module    
-            calculator_plug = module.Plugin(standalone=True)
-            self.gui.add_perspective(calculator_plug)
-        except:
-            logging.error("SansView: could not find Calculator plug-in module")
-            logging.error(sys.exc_value)  
-
-      
-        # Build the GUI
-        self.gui.build_gui()
-        
-        # Start the main loop
-        self.gui.MainLoop() 
-        
-
-if __name__ == "__main__": 
-    sansviewtool = SansViewTool()
Index: lculatorview/scripts/setup_exe.py
===================================================================
--- calculatorview/scripts/setup_exe.py	(revision 2f5d888638a2fbbe3b48bf307e06251b0357f836)
+++ 	(revision )
@@ -1,160 +1,0 @@
-#!/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, sys
-if len(sys.argv) == 1:
-    sys.argv.append('py2exe')
-# 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>SansView</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 = "1.0"
-        self.company_name = "U Tennessee"
-        self.copyright = "copyright 2009"
-        self.name = "SansViewTool"
-        
-#
-# Adapted from http://www.py2exe.org/index.cgi/MatPlotLib
-# to use the MatPlotLib.
-#
-matplotlibdatadir = matplotlib.get_data_path()
-matplotlibdata = findall(matplotlibdatadir)
-data_files = []
-# Copying SLD data
-import periodictable
-import logging
-data_files += periodictable.data_files()
-
-import sans.perspectives.calculator as calculator
-data_files += calculator.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.
-import sans.perspectives.calculator as cal
-path = cal.get_data_path('images')
-for f in findall(path):
-    if os.path.split(f)[0].count('.svn')==0:
-        data_files.append(('images', [f]))
-import sans.guiframe as guiframe
-data_files += guiframe.data_files()
-# Copy the settings file for the DataLoader file extension associations
-import sans.dataloader.readers
-f = os.path.join(sans.dataloader.readers.get_data_path(),'defaults.xml')
-if os.path.isfile(f):
-    data_files.append(('.', [f]))
-f = 'custom_config.py'
-if os.path.isfile(f):
-    data_files.append(('.', [f]))
-
-# Copying the HTML help docs
-path = cal.get_data_path('media')
-for f in findall(path):
-    if os.path.split(f)[0].count('.svn')==0:
-        data_files.append((os.path.split(f)[0], [f]))
-
-
-    
-#
-# packages
-#
-packages = ['matplotlib', 'pytz','encodings', 'scipy']
-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 = 'SansViewTool',
-    script = 'sansviewtool.py',
-    #icon_resources = [(1, "images/ball.ico")],
-    other_resources = [(24,1,manifest)],
-    dest_base = "SansViewTool"
-    )
-
-
-
-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: calculatorview/setup_exe.py
===================================================================
--- calculatorview/setup_exe.py	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
+++ calculatorview/setup_exe.py	(revision cda8c34b918290e5a6cde94d5ec26617fc9bd349)
@@ -0,0 +1,160 @@
+#!/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, sys
+if len(sys.argv) == 1:
+    sys.argv.append('py2exe')
+# 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>SansView</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 = "1.0"
+        self.company_name = "U Tennessee"
+        self.copyright = "copyright 2009"
+        self.name = "SansViewTool"
+        
+#
+# Adapted from http://www.py2exe.org/index.cgi/MatPlotLib
+# to use the MatPlotLib.
+#
+matplotlibdatadir = matplotlib.get_data_path()
+matplotlibdata = findall(matplotlibdatadir)
+data_files = []
+# Copying SLD data
+import periodictable
+import logging
+data_files += periodictable.data_files()
+
+import sans.perspectives.calculator as calculator
+data_files += calculator.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.
+import sans.perspectives.calculator as cal
+path = cal.get_data_path('images')
+for f in findall(path):
+    if os.path.split(f)[0].count('.svn')==0:
+        data_files.append(('images', [f]))
+import sans.guiframe as guiframe
+data_files += guiframe.data_files()
+# Copy the settings file for the DataLoader file extension associations
+import sans.dataloader.readers
+f = os.path.join(sans.dataloader.readers.get_data_path(),'defaults.xml')
+if os.path.isfile(f):
+    data_files.append(('.', [f]))
+f = 'custom_config.py'
+if os.path.isfile(f):
+    data_files.append(('.', [f]))
+
+# Copying the HTML help docs
+path = cal.get_data_path('media')
+for f in findall(path):
+    if os.path.split(f)[0].count('.svn')==0:
+        data_files.append((os.path.split(f)[0], [f]))
+
+
+    
+#
+# packages
+#
+packages = ['matplotlib', 'pytz','encodings', 'scipy']
+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 = 'SansViewTool',
+    script = 'sansviewtool.py',
+    #icon_resources = [(1, "images/ball.ico")],
+    other_resources = [(24,1,manifest)],
+    dest_base = "SansViewTool"
+    )
+
+
+
+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,
+    
+)
+
+
