old_contents: """
  This is a setup.py script partly generated by py2applet
  
  Usage:
      python setup.py py2app
  """
  from setuptools import setup
  import periodictable.xsf
  import DataLoader.readers 
  from distutils.sysconfig import get_python_lib
  import os
  
  DATA_FILES = []
  RESOURCES_FILES = []
  
  #Periodictable data file
  DATA_FILES = periodictable.data_files()
  
  #invariant and calculator help doc
  import sans.perspectives.calculator as calculator
  DATA_FILES += calculator.data_files()
  import sans.perspectives.invariant as invariant
  DATA_FILES += invariant.data_files()
  import sans.models as models
  DATA_FILES += models.data_files()
  
  #CANSAxml reader data files
  RESOURCES_FILES.append(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 = ['sansview.py']
  DATA_FILES += ['images','test','plugins','media']
  OPTIONS = {'argv_emulation': True,
             'packages': ['lxml','periodictable'],
             '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'],
  )
  
new_contents: """
  This is a setup.py script partly generated by py2applet
  
  Usage:
      python setup.py py2app
  """
  from setuptools import setup
  import periodictable.xsf
  import DataLoader.readers 
  from distutils.sysconfig import get_python_lib
  import os
  
  DATA_FILES = []
  RESOURCES_FILES = []
  
  #Periodictable data file
  DATA_FILES = periodictable.data_files()
  
  #invariant and calculator help doc
  import sans.perspectives.calculator as calculator
  DATA_FILES += calculator.data_files()
  import sans.perspectives.invariant as invariant
  DATA_FILES += invariant.data_files()
  import sans.models as models
  DATA_FILES += models.data_files()
  import sans.guiframe as guiframe
  DATA_FILES += guiframe.data_files()
  
  #CANSAxml reader data files
  RESOURCES_FILES.append(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 = ['sansview.py']
  DATA_FILES += ['images','test','plugins','media']
  OPTIONS = {'argv_emulation': True,
             'packages': ['lxml','periodictable'],
             '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'],
  )
  
subject: add guiframe image for mac installation