
run_sofastats_maker

# chmod 755 so can be executed. NB no extension
python /Users/g/Desktop/sofastats_py2app_setup.py py2app
echo "FINISHED"

sofastats_py2app_setup.py


# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.5: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.3: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.3: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.3: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.3: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.3: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.3: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.3: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.3: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.3: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.3: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.3: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.3: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.3: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D
# ======================================================== #
# File automagically generated by GUI2Exe version 0.5.1
# Copyright: (c) 2007-2011 Andrea Gavana
# ======================================================== #

# Let's start with some default (for me) imports...

from setuptools import setup

# Ok, let's explain why I am doing that.
# Often, data_files,subprocess.call(cmd, shell=True) excludes and friends (but also resources)
# can be very long list of things, and this will clutter too much
# the setup call at the end of this file. So, I put all the big lists
# here and I wrap them using the textwrap module.

resources = []

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.3: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D

includes = []
excludes = ['Tkconstants', 'Tkinter', '_gtkagg', '_tkagg', 'bsddb',
            'curses', 'email', 'pywin.debugger', 'pywin.debugger.dbgcon',
            'pywin.dialogs', 'tcl']
packages = []
frameworks = []
dylib_excludes = []
datamodels = []

# PList custom code (if any) goes here
# No code for PList

# This is a place where the user custom code may go. You can do almost
# whatever you want, even modify the data_files, includes and friends
# here as long as they have the same variable name that the setup call
# below is expecting.

import os
import subprocess
mounted_folder = '/Users/g/Desktop/mounted_macmaker'
try:
    os.mkdir(mounted_folder)
except Exception, e:
    pass # OK if already there
try:
    subprocess.call("mount -t smbfs '//guest:@grant-office/grantshare' %s" % mounted_folder, shell=True)
except Exception, e:
    pass # OK if already mounted

# That's serious now: we have all (or almost all) the options py2app
# supports. I put them all even if some of them are usually defaulted
# and not used. Some of them I didn't even know about.

setup(

    app = [r'%s/macmaker/sofa.main/SOFA Statistics.py' % mounted_folder],
    setup_requires=['py2app'],
    # optimize=2 seemed to fail
    options = {"py2app": {"optimize": 1,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dylib_excludes": dylib_excludes,
                          "frameworks": frameworks,
                          "datamodels": datamodels,
                          "resources": resources,
                          "iconfile": r'/Users/g/Desktop/storage/sofastatistics.icns',
                          "plist": None,
                          "extension": ".app",
                          "graph": False,
                          "dist_dir": r"/Users/g/Desktop/sofastats", # NB this folders gets WIPED first !!!!!!!!!!!!!!!!!!!
                          "xref": False,
                          "no_strip": False,
                          "no_chdir": False,
                          "semi_standalone": False,
                          "argv_emulation": True,
                          "use_pythonpath": False,
                          "site_packages": False,
                          "prefer_ppc": False,
                          "debug_modulegraph": False,
                          "debug_skip_macholib": False
                         }
              },
    )

# This is a place where any post-compile code may go.
# You can add as much code as you want, which can be used, for example,
# to clean up your folders or to do some particular post-compilation
# actions.

# trailing dot so copies contents of folder over, but not root folder itself.
subprocess.call("cp -R '%s/macmaker/sofa.main/.' '/Users/g/Desktop/sofastats/SOFA Statistics.app/Contents/Resources'" % mounted_folder, shell=True)
version = raw_input("Enter version number e.g. 1.1.3: ")
# must be in path of file/dir to zip or will include all the subfolders between your dir and it! -j removes ALL folders so no use.
subprocess.call("cd '/Users/g/Desktop/sofastats/' && zip -r '%s/sofastats-%s_for_mac.zip' 'SOFA Statistics.app'" %
                (mounted_folder, version), shell=True)
# And we are done. That's a setup script :-D


