Example #1
0
    def __init__(self, parent, projectName, creationDate):
        """
        Default class constructor.

        
        **Parameters:**

        * projectName: the name of the project we are working on
        * creationDate: the date and time the project was created

        """
        
        BaseBuilderPanel.__init__(self, parent, projectName, creationDate, name="bbfreeze")

        # I need this flag otherwise all the widgets start sending changed
        # events when I first populate the full panel
        
        self.created = False

        # A whole bunch of static box sizers
        self.commonSizer_staticbox = wx.StaticBox(self, -1, _("Common Options"))
        self.includesSizer_staticbox = wx.StaticBox(self, -1, _("Includes"))
        self.excludesSizer_staticbox = wx.StaticBox(self, -1, _("Excludes"))
        self.otherOptionsSizer_staticbox = wx.StaticBox(self, -1, _("Other Options"))
        self.targetSizer_staticbox = wx.StaticBox(self, -1, _("Target Classes"))

        transdict = dict(projectName=projectName, creationDate=creationDate)
        # A simple label that holds information about the project
        self.label = wx.StaticText(self, -1, _("bbFreeze options for: %(projectName)s (Created: %(creationDate)s)")%transdict)

        # A list control for the target classes, scripts
        self.multipleExe = BaseListCtrl(self, columnNames=[_("Exe Kind"), _("Python Main Script")],
                                        name="multipleexe")
        
        # Optimization level for bbFreeze 1 for "python -O", 2 for "python -OO",
        # 0 to disable
        self.optimizeCombo = MultiComboBox(self, ["0", "1", "2"], wx.CB_DROPDOWN|wx.CB_READONLY,
                                           self.GetName(), "optimize")
        # Compression level for the zipfile in bbFreeze
        self.compressCombo = MultiComboBox(self, ["0", "1"],
                                           wx.CB_DROPDOWN|wx.CB_READONLY, self.GetName(), "compress")

        # A checkbox that enables the user to choose a different name for the
        # distribution directory. Default is unchecked, that means dist_dir="dist"
        self.distChoice = wx.CheckBox(self, -1, _("Dist Directory"), name="dist_dir_choice")
        # The name of the distribution directory (if enabled)
        self.distTextCtrl = wx.TextCtrl(self, -1, "dist", name="dist_dir")

        # A list control for the "includes" option, a comma separated list of
        # modules to include
        self.includeList = BaseListCtrl(self, columnNames=[_("Python Modules")], name="includes")
        # A list control for the "excludes" option, a comma separated list of
        # modules to exclude
        self.excludeList = BaseListCtrl(self, columnNames=[_("Python Modules")], name="excludes")

        self.includeInterpreter = wx.CheckBox(self, -1, _("Include Python Interpreter"), name="include_py")
        self.addManifest = wx.CheckBox(self, -1, _("Create Manifest File (MSW)"), name="create_manifest_file")

        # Hold a reference to all the list controls, to speed up things later
        self.listCtrls = [self.includeList, self.excludeList]

        # Do the hard work... quite a few to layout :-D
        self.LayoutItems()
        self.SetProperties()
        self.BindEvents()
Example #2
0
    def __init__(self, parent, projectName, creationDate):
        """
        Default class constructor.

        
        **Parameters:**

        * projectName: the name of the project we are working on
        * creationDate: the date and time the project was created

        """
        
        BaseBuilderPanel.__init__(self, parent, projectName, creationDate, name="PyInstaller")

        # I need this flag otherwise all the widgets start sending changed
        # events when I first populate the full panel
        
        self.created = False

        # A whole bunch of static box sizers

        self.pathSizer_staticbox = wx.StaticBox(self, -1, _("Path Extensions"))
        self.hookSizer_staticbox = wx.StaticBox(self, -1, _("Hooks Extensions"))
        self.commonSizer_staticbox = wx.StaticBox(self, -1, _("Common Options"))
        self.includesSizer_staticbox = wx.StaticBox(self, -1, _("Includes"))
        self.excludesSizer_staticbox = wx.StaticBox(self, -1, _("Excludes"))
        self.packagesSizer_staticbox = wx.StaticBox(self, -1, _("Packages (PKG)"))
        self.dllExcludesSizer_staticbox = wx.StaticBox(self, -1, _("DLL/Binary Excludes"))
        self.dllIncludesSizer_staticbox = wx.StaticBox(self, -1, _("DLL/Binary Includes"))
        self.datafileSizer_staticBox = wx.StaticBox(self, -1, _("Data Files"))
        self.otherOptionsSizer_staticbox = wx.StaticBox(self, -1, _("Other Options"))
        self.scriptSizer_staticbox = wx.StaticBox(self, -1, _("Scripts"))

        # A simple label that holds information about the project
        transdict = dict(projectName=projectName, creationDate=creationDate)
        self.label = wx.StaticText(self, -1, _("PyInstaller options for: %(projectName)s (Created: %(creationDate)s)")%transdict)

        # This list holds all the script files added by the user
        self.scriptsList = BaseListCtrl(self, columnNames=[_("Python Scripts")], name="scripts")
        # A list for the extension of the search path
        self.pathexList = BaseListCtrl(self, columnNames=[_("Paths")], name="pathex")
        # A list for the extension of the hooks package
        self.hookList = BaseListCtrl(self, columnNames=[_("Paths")], name="hookspath")
        # Do we want a debug build?
        self.debugCheck = wx.CheckBox(self, -1, _("Debug"), name="debug")
        # Radiobutton for the one-file build
        self.oneFileRadio = wx.RadioButton(self, -1, _("One File"), style=wx.RB_GROUP, name="onefile")
        # Name of the executable
        self.exeTextCtrl = wx.TextCtrl(self, -1, "", name="exename")
        # Whether it is a console or a windowed application
        self.consoleCheck = wx.CheckBox(self, -1, _("Console Application"), name="console")
        # Radiobutton for the one-dir build
        self.oneDirRadio = wx.RadioButton(self, -1, _("One Directory"), name="onedir")
        # A file picker for the executable icon
        self.iconPicker = wx.FilePickerCtrl(self, style=wx.FLP_USE_TEXTCTRL, name="icon")
        # Strip or no strip?
        self.stripCheck = wx.CheckBox(self, -1, _("Strip Executable"), name="strip")
        # Do we want to include encodings or not?
        self.asciiCheck = wx.CheckBox(self, -1, "Ascii", name="ascii")
        # Name of the distribution directory
        self.distTextCtrl = wx.TextCtrl(self, -1, "", name="dist_dir")
        # Compression level
        self.compressCombo = MultiComboBox(self, [str(i) for i in xrange(10)],
                                           wx.CB_DROPDOWN|wx.CB_READONLY, self.GetName(), "level")
        # Use UPX compression? 
        self.upxCheck = wx.CheckBox(self, -1, _("UPX Compression"), name="upx")
        # Include Tk in the distribution?
        self.includeTkCheck = wx.CheckBox(self, -1, _("Include Tk"), name="includetk")
        # A file picker for the version file
        self.versionPicker = wx.FilePickerCtrl(self, style=wx.FLP_USE_TEXTCTRL, name="version")
        # A list control for the "includes" option, a comma separated list of
        # modules to include
        self.includeList = BaseListCtrl(self, columnNames=[_("Python Modules"), _("Path")], name="includes")
        # A list control for the "excludes" option, a comma separated list of
        # modules to exclude
        self.excludeList = BaseListCtrl(self, columnNames=[_("Python Modules")], name="excludes")
        # A list control for the "packages" option, a comma separated list of
        # packages to include
        self.packagesList = BaseListCtrl(self, columnNames=[_("Python Packages"), _("Path")], name="packages")
        # A couple of listctrls to hold DLL/binary includes and excludes
        self.dllExcludeList = BaseListCtrl(self, columnNames=[_("File Name"), _("Path")], name="dll_excludes")
        self.dllIncludeList = BaseListCtrl(self, columnNames=[_("File Name"), _("Path")], name="dll_includes")
        # A list control for the "data_files" option. "data_files" should contain
        # a sequence of (target-dir, files) tuples, where files is a sequence of
        # files to be copied
        self.datafileList = BaseListCtrl(self, columnNames=[_("File Name"), _("Path")], name="data_files")
        # Less used options
        self.verboseCheck = wx.CheckBox(self, -1, _("Verbose Import"), name="option1")
        self.warningCheck = wx.CheckBox(self, -1, _("Warning Option"), name="option2")
        self.forceexecCheck = wx.CheckBox(self, -1, _("Force Execpv"), name="option3")
        self.unbufferedCheck = wx.CheckBox(self, -1, _("Unbuffered STDIO"), name="option4")
        self.useSiteCheck = wx.CheckBox(self, -1, _("Use Site.py"), name="option5")
        self.optimizeCheck = wx.CheckBox(self, -1, _("Build Optimized"), name="option6")
        self.addManifest = wx.CheckBox(self, -1, _("Create Manifest File (MSW)"), name="create_manifest_file")

        # Hold a reference to all the list controls, to speed up things later
        self.listCtrls = [self.includeList, self.packagesList, self.excludeList, self.dllExcludeList,
                          self.dllIncludeList, self.datafileList, self.scriptsList, self.pathexList,
                          self.hookList]
        # Hold a reference to the most obscure PyInstaller options
        self.optionsCheckBoxes = [self.verboseCheck, self.warningCheck, self.forceexecCheck,
                                  self.unbufferedCheck, self.useSiteCheck, self.optimizeCheck]
        
        # Do the hard work... quite a few to layout :-D
        self.LayoutItems()
        self.SetProperties()
        self.BindEvents()
Example #3
0
    def __init__(self, parent, projectName, creationDate):
        """
        Default class constructor.

        
        **Parameters:**

        * projectName: the name of the project we are working on
        * creationDate: the date and time the project was created

        """

        BaseBuilderPanel.__init__(self, parent, projectName, creationDate, name="vendorid")

        # I need this flag otherwise all the widgets start sending changed
        # events when I first populate the full panel

        self.created = False

        # A whole bunch of static box sizers
        self.commonSizer_staticbox = wx.StaticBox(self, -1, _("Common Options"))
        self.includesSizer_staticbox = wx.StaticBox(self, -1, _("Includes"))
        self.packagesSizer_staticbox = wx.StaticBox(self, -1, _("Packages"))
        self.otherSizer_staticbox = wx.StaticBox(self, -1, _("Other Options"))

        # A simple label that holds information about the project
        transdict = dict(projectName=projectName, creationDate=creationDate)
        self.label = wx.StaticText(
            self, -1, _("VendorID options for: %(projectName)s (Created: %(creationDate)s)") % transdict
        )

        # The file picker that allows us to pick the script to be compiled by py2app
        self.scriptPicker = wx.FilePickerCtrl(self, style=wx.FLP_USE_TEXTCTRL, wildcard=_pywild, name="script")

        # Name of the executable
        self.exeTextCtrl = wx.TextCtrl(self, -1, "", name="exename")

        # Optimization level for vendorid  1 for "python -O", 2 for "python -OO",
        # 0 to disable
        self.optimizeCombo = MultiComboBox(
            self, ["0", "1", "2"], wx.CB_DROPDOWN | wx.CB_READONLY, self.GetName(), "optimize"
        )

        # A checkbox that enables the user to choose a different name for the
        # distribution directory. Default is unchecked, that means build_dir="build_ + python main script name"
        self.distChoice = wx.CheckBox(self, -1, _("Build Directory"), name="build_dir_choice")
        # The name of the distribution directory (if enabled)
        self.distTextCtrl = wx.TextCtrl(self, -1, "", name="build_dir")

        # A checkbox that enables the user to choose a different name for the
        # installation directory. Default is unchecked, that means sys.exec_prefix
        self.instChoice = wx.CheckBox(self, -1, _("Installation Directory"), name="install_dir_choice")
        # The name of the installation directory (if enabled)
        self.instTextCtrl = wx.TextCtrl(self, -1, "", name="install_dir")
        # Prefix for compiled Python code
        self.prefixTextCtrl = wx.TextCtrl(self, -1, "", name="prefix")
        # The icon picker that allows us to pick the application icon (Windows only)
        self.iconPicker = wx.FilePickerCtrl(
            self, style=wx.FLP_USE_TEXTCTRL, wildcard="Icon files (*.ico)|*.ico", name="iconfile"
        )

        # A list control for the "includes" option, a comma separated list of
        # modules to include
        self.includeList = BaseListCtrl(self, columnNames=[_("Python Modules")], name="includes")
        # A list control for the "packages" option, a comma separated list of
        # packages to include
        self.packagesList = BaseListCtrl(self, columnNames=[_("Python Packages")], name="packages")

        # Create a signed interpreter (default is True)
        self.signCheck = wx.CheckBox(self, -1, "Sign Interpreter", name="signed")

        # Create console application (Windows only)
        self.consoleCheck = wx.CheckBox(self, -1, "Console App", name="console")

        # Add support for Python's verbose flag (default is False)
        self.verboseCheck = wx.CheckBox(self, -1, "Verbose Flag", name="verbose")

        # Run make install after compilation
        self.runmakeCheck = wx.CheckBox(self, -1, "Run Make Install", name="runmake")

        # Hold a reference to all the list controls, to speed up things later
        self.listCtrls = [self.includeList, self.packagesList]

        # Do the hard work... quite a few to layout :-D
        self.LayoutItems()
        self.SetProperties()
        self.BindEvents()
Example #4
0
    def __init__(self, parent, projectName, creationDate):
        """
        Default class constructor.

        
        **Parameters:**

        * projectName: the name of the project we are working on
        * creationDate: the date and time the project was created

        """

        BaseBuilderPanel.__init__(self,
                                  parent,
                                  projectName,
                                  creationDate,
                                  name="vendorid")

        # I need this flag otherwise all the widgets start sending changed
        # events when I first populate the full panel

        self.created = False

        # A whole bunch of static box sizers
        self.commonSizer_staticbox = wx.StaticBox(self, -1,
                                                  _("Common Options"))
        self.includesSizer_staticbox = wx.StaticBox(self, -1, _("Includes"))
        self.packagesSizer_staticbox = wx.StaticBox(self, -1, _("Packages"))
        self.otherSizer_staticbox = wx.StaticBox(self, -1, _("Other Options"))

        # A simple label that holds information about the project
        transdict = dict(projectName=projectName, creationDate=creationDate)
        self.label = wx.StaticText(
            self, -1,
            _("VendorID options for: %(projectName)s (Created: %(creationDate)s)"
              ) % transdict)

        # The file picker that allows us to pick the script to be compiled by py2app
        self.scriptPicker = wx.FilePickerCtrl(self,
                                              style=wx.FLP_USE_TEXTCTRL,
                                              wildcard=_pywild,
                                              name="script")

        # Name of the executable
        self.exeTextCtrl = wx.TextCtrl(self, -1, "", name="exename")

        # Optimization level for vendorid  1 for "python -O", 2 for "python -OO",
        # 0 to disable
        self.optimizeCombo = MultiComboBox(self, ["0", "1", "2"],
                                           wx.CB_DROPDOWN | wx.CB_READONLY,
                                           self.GetName(), "optimize")

        # A checkbox that enables the user to choose a different name for the
        # distribution directory. Default is unchecked, that means build_dir="build_ + python main script name"
        self.distChoice = wx.CheckBox(self,
                                      -1,
                                      _("Build Directory"),
                                      name="build_dir_choice")
        # The name of the distribution directory (if enabled)
        self.distTextCtrl = wx.TextCtrl(self, -1, "", name="build_dir")

        # A checkbox that enables the user to choose a different name for the
        # installation directory. Default is unchecked, that means sys.exec_prefix
        self.instChoice = wx.CheckBox(self,
                                      -1,
                                      _("Installation Directory"),
                                      name="install_dir_choice")
        # The name of the installation directory (if enabled)
        self.instTextCtrl = wx.TextCtrl(self, -1, "", name="install_dir")
        # Prefix for compiled Python code
        self.prefixTextCtrl = wx.TextCtrl(self, -1, "", name="prefix")
        # The icon picker that allows us to pick the application icon (Windows only)
        self.iconPicker = wx.FilePickerCtrl(
            self,
            style=wx.FLP_USE_TEXTCTRL,
            wildcard="Icon files (*.ico)|*.ico",
            name="iconfile")

        # A list control for the "includes" option, a comma separated list of
        # modules to include
        self.includeList = BaseListCtrl(self,
                                        columnNames=[_("Python Modules")],
                                        name="includes")
        # A list control for the "packages" option, a comma separated list of
        # packages to include
        self.packagesList = BaseListCtrl(self,
                                         columnNames=[_("Python Packages")],
                                         name="packages")

        # Create a signed interpreter (default is True)
        self.signCheck = wx.CheckBox(self,
                                     -1,
                                     "Sign Interpreter",
                                     name="signed")

        # Create console application (Windows only)
        self.consoleCheck = wx.CheckBox(self,
                                        -1,
                                        "Console App",
                                        name="console")

        # Add support for Python's verbose flag (default is False)
        self.verboseCheck = wx.CheckBox(self,
                                        -1,
                                        "Verbose Flag",
                                        name="verbose")

        # Run make install after compilation
        self.runmakeCheck = wx.CheckBox(self,
                                        -1,
                                        "Run Make Install",
                                        name="runmake")

        # Hold a reference to all the list controls, to speed up things later
        self.listCtrls = [self.includeList, self.packagesList]

        # Do the hard work... quite a few to layout :-D
        self.LayoutItems()
        self.SetProperties()
        self.BindEvents()
Example #5
0
    def __init__(self, parent, projectName, creationDate):
        """
        Default class constructor.

        
        **Parameters:**

        * projectName: the name of the project we are working on
        * creationDate: the date and time the project was created

        """
        
        BaseBuilderPanel.__init__(self, parent, projectName, creationDate, name="py2app")

        # I need this flag otherwise all the widgets start sending changed
        # events when I first populate the full panel
        
        self.created = False

        # A whole bunch of static box sizers
        self.commonSizer_staticbox = wx.StaticBox(self, -1, _("Common Options"))
        self.includesSizer_staticbox = wx.StaticBox(self, -1, _("Includes"))
        self.packagesSizer_staticbox = wx.StaticBox(self, -1, _("Packages"))
        self.excludesSizer_staticbox = wx.StaticBox(self, -1, _("Excludes"))
        self.dylibExcludesSizer_staticbox = wx.StaticBox(self, -1, _("Dylib/Frameworks Excludes"))
        self.datamodelsSizer_staticbox = wx.StaticBox(self, -1, _("XC Data Models"))
        self.frameworksSizer_staticbox = wx.StaticBox(self, -1, _("Dylib/Frameworks Includes"))
        self.datafile_staticbox = wx.StaticBox(self, -1, _("Resources"))

        self.otherSizer_staticbox = wx.StaticBox(self, -1, _("Other Options"))

        # A simple label that holds information about the project
        transdict = dict(projectName=projectName, creationDate=creationDate)
        self.label = wx.StaticText(self, -1, _("Py2app options for: %(projectName)s (Created: %(creationDate)s)")%transdict)

        # A combobox to choose the application extension
        self.extensionCombo = MultiComboBox(self, [".app", ".plugin"], wx.CB_DROPDOWN|wx.CB_READONLY,
                                            self.GetName(), "extension")
        # The file picker that allows us to pick the script to be compiled by py2app
        self.scriptPicker = wx.FilePickerCtrl(self, style=wx.FLP_USE_TEXTCTRL,
                                              wildcard=_pywild, name="script")

        # A checkbox that enables the user to choose a different name for the
        # distribution directory. Default is unchecked, that means dist_dir="dist"
        self.distChoice = wx.CheckBox(self, -1, _("Dist Directory"), name="dist_dir_choice")
        # The name of the distribution directory (if enabled)
        self.distTextCtrl = wx.TextCtrl(self, -1, "dist", name="dist_dir")
        
        # Optimization level for py2app  1 for "python -O", 2 for "python -OO",
        # 0 to disable
        self.optimizeCombo = MultiComboBox(self, ["0", "1", "2"], wx.CB_DROPDOWN|wx.CB_READONLY,
                                           self.GetName(), "optimize")

        # The icon picker that allows us to pick the application icon
        self.iconPicker = wx.FilePickerCtrl(self, style=wx.FLP_USE_TEXTCTRL,
                                            wildcard=_iconwild, name="iconfile")
                
        # A picker for the PList file
        self.pListPicker = wx.FilePickerCtrl(self, style=wx.FLP_USE_TEXTCTRL,
                                             wildcard=_plistwild, name="plist")

        # To add/edit PList code
        self.pListChoice = wx.CheckBox(self, -1, _("PList Code"), name="plistCode_choice")
        editBmp = self.MainFrame.CreateBitmap("edit_add")
        removeBmp = self.MainFrame.CreateBitmap("remove")
        self.pListAddButton = buttons.ThemedGenBitmapTextButton(self, -1, editBmp, _("Add/Edit"),
                                                                size=(-1, 25), name="plistCode")
        self.pListRemoveButton = buttons.ThemedGenBitmapTextButton(self, -1, removeBmp, _("Remove"),
                                                                   size=(-1, 25), name="plistRemove")
        
        # A list control for the "includes" option, a comma separated list of
        # modules to include
        self.includeList = BaseListCtrl(self, columnNames=[_("Python Modules")], name="includes")
        # A list control for the "packages" option, a comma separated list of
        # packages to include
        self.packagesList = BaseListCtrl(self, columnNames=[_("Python Packages")], name="packages")
        # A list control for the "frameworks" option, a comma separated list of
        # frameworks/dylibs to include
        self.frameworksList = BaseListCtrl(self, columnNames=[_("Dylib/Frameworks Names")], name="frameworks")
        # A list control for the "excludes" option, a comma separated list of
        # modules to exclude   
        self.excludeList = BaseListCtrl(self, columnNames=[_("Python Modules")], name="excludes")
        # A list control for the "dylib_excludes" option, a comma separated list of
        # dylibs/frameworks to exclude
        self.dylibExcludeList = BaseListCtrl(self, columnNames=[_("Dylib/Frameworks Names")], name="dylib_excludes")
        # A list control for the "xcdatamodels" option, a comma separated list of
        # xcdatamodels to compile and include
        self.datamodelsList = BaseListCtrl(self, columnNames=[_("XC Data Models Names")], name="datamodels")
        # A list control for the "resources" option. "resources" should contain
        # a sequence of (target-dir, files) tuples, where files is a sequence of
        # files to be copied
        self.datafileList = BaseListCtrl(self, columnNames=[_("Files Path")], name="resources")

        # output module dependency graph
        self.graphCheck = wx.CheckBox(self, -1, "Graph", name="graph")
        # This command line switch instructs py2app to create a python module cross
        # reference and display it in the webbrowser.  This allows to answer question
        # why a certain module has been included, or if you can exclude a certain module
        # and it's dependencies. Also, the html page includes links which will even
        # allow to view the source code of a module in the browser, for easy inspection.
        self.crossRefCheck = wx.CheckBox(self, -1, "Cross-Reference", name="xref")
        # Do not strip debug and local symbols from output
        self.noStripCheck = wx.CheckBox(self, -1, "No Strip", name="no_strip")
        # Do not change to the data directory (Contents/Resources) [forced for plugins]
        self.noChdirCheck = wx.CheckBox(self, -1, "No Chdir", name="no_chdir")
        # Depend on an existing installation of Python 2.4
        self.semiStandaloneCheck = wx.CheckBox(self, -1, "Semi Standalone", name="semi_standalone")
        # Use argv emulation (disabled for plugins)
        self.argvEmulationCheck = wx.CheckBox(self, -1, "Argv Emulation", name="argv_emulation")
        # Allow PYTHONPATH to effect the interpreter's environment
        self.usePythonPathCheck = wx.CheckBox(self, -1, "Use PYTHONPATH", name="use_pythonpath")
        # Include the system and user site-packages into sys.path
        self.sitePackagesCheck= wx.CheckBox(self, -1, "Site Packages", name="site_packages")
        # Force application to run translated on i386 (LSPrefersPPC=True)
        self.preferPPCCheck= wx.CheckBox(self, -1, "Prefer PPC", name="prefer_ppc")
        # Drop to pdb console after the module finding phase is complete
        self.debugModuleGraphCheck= wx.CheckBox(self, -1, "Debug Modulegraph", name="debug_modulegraph")
        # Skip macholib phase (app will not be standalone!)
        self.skipMacholibCheck= wx.CheckBox(self, -1, "Debug Skip Macholib", name="debug_skip_macholib")

        # Hold a reference to all the list controls, to speed up things later
        self.listCtrls = [self.includeList, self.packagesList, self.frameworksList, self.excludeList,
                          self.dylibExcludeList, self.datamodelsList, self.datafileList]

        # Do the hard work... quite a few to layout :-D
        self.LayoutItems()
        self.SetProperties()
        self.BindEvents()
        wx.CallAfter(self.EnableMacPList)

        self.Bind(wx.EVT_BUTTON, self.OnPListAdd, self.pListAddButton)
        self.Bind(wx.EVT_BUTTON, self.OnPListRemove, self.pListRemoveButton)
Example #6
0
    def __init__(self, parent, projectName, creationDate):
        """
        Default class constructor.

        
        **Parameters:**

        * projectName: the name of the project we are working on
        * creationDate: the date and time the project was created

        """

        BaseBuilderPanel.__init__(self,
                                  parent,
                                  projectName,
                                  creationDate,
                                  name="py2exe")

        # I need this flag otherwise all the widgets start sending changed
        # events when I first populate the full panel

        self.created = False

        # A whole bunch of static box sizers
        self.commonSizer_staticbox = wx.StaticBox(self, -1,
                                                  _("Common Options"))
        self.includesSizer_staticbox = wx.StaticBox(self, -1, _("Includes"))
        self.packagesSizer_staticbox = wx.StaticBox(self, -1, _("Packages"))
        self.excludesSizer_staticbox = wx.StaticBox(self, -1, _("Excludes"))
        self.dllExcludesSizer_staticbox = wx.StaticBox(self, -1,
                                                       _("DLL Excludes"))
        self.ignoreSizer_staticbox = wx.StaticBox(self, -1, _("Ignores"))
        self.datafile_staticbox = wx.StaticBox(self, -1, _("Data Files"))
        self.icon_staticbox = wx.StaticBox(self, -1, _("Icon Resources"))
        self.bitmap_staticbox = wx.StaticBox(self, -1, _("Bitmap Resources"))
        self.other_staticbox = wx.StaticBox(self, -1, _("Other Resources"))
        self.otherSizer_staticbox = wx.StaticBox(self, -1, _("Other Options"))
        self.targetSizer_staticbox = wx.StaticBox(self, -1,
                                                  _("Target Classes"))

        # A simple label that holds information about the project
        transdict = dict(projectName=projectName, creationDate=creationDate)
        self.label = wx.StaticText(
            self, -1,
            _("Py2exe options for: %(projectName)s (Created: %(creationDate)s)"
              ) % transdict)

        # These text controls hold data used by VersionInfo in py2exe

        # A list control for the target classes, scripts
        self.multipleExe = BaseListCtrl(self,
                                        columnNames=[
                                            _("Exe Kind"),
                                            _("Python Main Script"),
                                            _("Executable Name"),
                                            _("Version"),
                                            _("Company Name"),
                                            _("Copyrights"),
                                            _("Program Name")
                                        ],
                                        name="multipleexe")

        # Optimization level for py2exe  1 for "python -O", 2 for "python -OO",
        # 0 to disable
        self.optimizeCombo = MultiComboBox(self, ["0", "1", "2"],
                                           wx.CB_DROPDOWN | wx.CB_READONLY,
                                           self.GetName(), "optimize")
        # Compression level for the zipfile (if any) in py2exe
        self.compressCombo = MultiComboBox(self, ["0", "1", "2"],
                                           wx.CB_DROPDOWN | wx.CB_READONLY,
                                           self.GetName(), "compressed")
        # Bundle files option for py2exe. Specifying a level of 2 includes
        # the .pyd and .dll files into the zip-archive or the executable. Thus,
        # the dist directory will contain your exe file(s), the library.zip file
        # (if you haven't specified 'zipfile=None'), and the python dll. The
        # advantage of this scheme is that the application can still load extension
        # modules from the file system if you extend sys.path at runtime.
        # Using a level of 1 includes the .pyd and .dll files into the zip-archive
        # or the executable itself, and does the same for pythonXY.dll. The advantage
        # is that you only need to distribute one file per exe, which will however
        # be quite large. Another advantage is that inproc COM servers will run
        # completely isolated from other Python interpreters in the same exe. The
        # disadvantage of this scheme is that it is impossible to load other
        # extensions from the file system, the application will crash with a fatal
        # Python error if you try this.
        self.bundleCombo = MultiComboBox(self, ["1", "2", "3"],
                                         wx.CB_DROPDOWN | wx.CB_READONLY,
                                         self.GetName(), "bundle_files")
        # A checkbox that enables the user to choose a different name for the zipfile
        # Default is unchecked, that means zipfile=None
        self.zipfileChoice = wx.CheckBox(self,
                                         -1,
                                         "Zipfile",
                                         name="zipfile_choice")
        # The name of the zipfile (if enabled by the user)
        self.zipfileTextCtrl = wx.TextCtrl(self, -1, "None", name="zipfile")
        # A checkbox that enables the user to choose a different name for the
        # distribution directory. Default is unchecked, that means dist_dir="dist"
        self.distChoice = wx.CheckBox(self,
                                      -1,
                                      _("Dist Directory"),
                                      name="dist_dir_choice")
        # The name of the distribution directory (if enabled)
        self.distTextCtrl = wx.TextCtrl(self, -1, "dist", name="dist_dir")
        # Allows to skip the archive. If checked, this copies the Python bytecode files
        # directly into the dist directory and subdirectories - no archive is used.
        self.skiparchiveChoice = wx.CheckBox(self,
                                             -1,
                                             "Skip Archive",
                                             name="skip_archive")
        # If checked, embed the XP manifest file directly in the executable
        self.xpmanifestChoice = wx.CheckBox(self,
                                            -1,
                                            "XP Manifest File",
                                            name="manifest_file")

        # A list control for the "includes" option, a comma separated list of
        # modules to include
        self.includeList = BaseListCtrl(self,
                                        columnNames=[_("Python Modules")],
                                        name="includes")
        # A list control for the "packages" option, a comma separated list of
        # packages to include
        self.packagesList = BaseListCtrl(self,
                                         columnNames=[_("Python Packages")],
                                         name="packages")
        # A list control for the "excludes" option, a comma separated list of
        # modules to exclude
        self.excludeList = BaseListCtrl(self,
                                        columnNames=[_("Python Modules")],
                                        name="excludes")
        # A list control for the "dll_excludes" option, a comma separated list of
        # Windows dlls to include
        self.dllExcludeList = BaseListCtrl(self,
                                           columnNames=[_("DLL Names")],
                                           name="dll_excludes")
        # A list control for the "ignores" option, a comma separated list of
        # modules to ignores
        self.ignoreList = BaseListCtrl(self,
                                       columnNames=[_("Python Modules")],
                                       name="ignores")
        # A list control for the "data_files" option. "data_files" should contain
        # a sequence of (target-dir, files) tuples, where files is a sequence of
        # files to be copied
        self.datafileList = BaseListCtrl(
            self,
            columnNames=[_("Directory") + " " * 15,
                         _("Files Path")],
            name="data_files")
        # A list control for the "icon_resources" option
        self.iconResourceList = BaseListCtrl(
            self,
            columnNames=[_("Id  "), _("Icon Path")],
            name="icon_resources")
        # A list control for the "bitmap_resources" option
        self.bitmapResourceList = BaseListCtrl(
            self,
            columnNames=[_("Id  "), _("Bitmap Path")],
            name="bitmap_resources")
        # A list control for the "other_resources" option
        self.otherResourceList = BaseListCtrl(
            self,
            columnNames=[_("Type"), _("Id  "),
                         _("Path/Value")],
            name="other_resources")

        # This command line switch instructs py2exe to create a python module cross
        # reference and display it in the webbrowser.  This allows to answer question
        # why a certain module has been included, or if you can exclude a certain module
        # and it's dependencies. Also, the html page includes links which will even
        # allow to view the source code of a module in the browser, for easy inspection.
        self.crossRefCheck = wx.CheckBox(self,
                                         -1,
                                         "Cross-Reference",
                                         name="xref")
        # To prevent unicode encoding error, py2exe now by default includes the codecs
        # module and the encodings package. If you are sure your program never
        # implicitely or explicitely has to convert between unicode and ascii strings
        # this can be prevented by checking this checkbox
        self.asciiCheck = wx.CheckBox(self, -1, "Ascii", name="ascii")

        # The following 2 are only for service, com_server and ctypes_com_server
        self.createExeCheck = wx.CheckBox(self,
                                          -1,
                                          "Create EXE",
                                          name="create_exe")
        self.createDllCheck = wx.CheckBox(self,
                                          -1,
                                          "Create DLL",
                                          name="create_dll")

        # By picking a Python script here, this script can do things like installing
        # a customized stdout blackhole. See py2exe's boot_common.py for examples of
        # what can be done. The custom boot script is executed during startup of
        # the executable immediately after boot_common.py is executed
        self.customBootPicker = wx.FilePickerCtrl(self,
                                                  style=wx.FLP_USE_TEXTCTRL,
                                                  name="custom_boot_script")

        # Hold a reference to all the list controls, to speed up things later
        self.listCtrls = [
            self.includeList, self.packagesList, self.excludeList,
            self.dllExcludeList, self.ignoreList, self.datafileList,
            self.iconResourceList, self.bitmapResourceList,
            self.otherResourceList
        ]

        # Do the hard work... quite a few to layout :-D
        self.LayoutItems()
        self.SetProperties()
        self.BindEvents()
Example #7
0
    def __init__(self, parent, projectName, creationDate):
        """
        Default class constructor.

        
        **Parameters:**

        * projectName: the name of the project we are working on
        * creationDate: the date and time the project was created

        """
        
        BaseBuilderPanel.__init__(self, parent, projectName, creationDate, name="py2exe")

        # I need this flag otherwise all the widgets start sending changed
        # events when I first populate the full panel
        
        self.created = False

        # A whole bunch of static box sizers
        self.commonSizer_staticbox = wx.StaticBox(self, -1, _("Common Options"))
        self.includesSizer_staticbox = wx.StaticBox(self, -1, _("Includes"))
        self.packagesSizer_staticbox = wx.StaticBox(self, -1, _("Packages"))
        self.excludesSizer_staticbox = wx.StaticBox(self, -1, _("Excludes"))
        self.dllExcludesSizer_staticbox = wx.StaticBox(self, -1, _("DLL Excludes"))
        self.ignoreSizer_staticbox = wx.StaticBox(self, -1, _("Ignores"))
        self.datafile_staticbox = wx.StaticBox(self, -1, _("Data Files"))
        self.icon_staticbox = wx.StaticBox(self, -1, _("Icon Resources"))
        self.bitmap_staticbox = wx.StaticBox(self, -1, _("Bitmap Resources"))
        self.other_staticbox = wx.StaticBox(self, -1, _("Other Resources"))
        self.otherSizer_staticbox = wx.StaticBox(self, -1, _("Other Options"))
        self.targetSizer_staticbox = wx.StaticBox(self, -1, _("Target Classes"))

        # A simple label that holds information about the project
        transdict = dict(projectName=projectName, creationDate=creationDate)
        self.label = wx.StaticText(self, -1, _("Py2exe options for: %(projectName)s (Created: %(creationDate)s)")%transdict)

        # These text controls hold data used by VersionInfo in py2exe

        # A list control for the target classes, scripts
        self.multipleExe = BaseListCtrl(self, columnNames=[_("Exe Kind"), _("Python Main Script"),
                                                           _("Executable Name"), _("Version"),
                                                           _("Company Name"), _("Copyrights"),
                                                           _("Program Name")], name="multipleexe")
        
        # Optimization level for py2exe  1 for "python -O", 2 for "python -OO",
        # 0 to disable
        self.optimizeCombo = MultiComboBox(self, ["0", "1", "2"], wx.CB_DROPDOWN|wx.CB_READONLY,
                                           self.GetName(), "optimize")
        # Compression level for the zipfile (if any) in py2exe
        self.compressCombo = MultiComboBox(self, ["0", "1", "2"], wx.CB_DROPDOWN|wx.CB_READONLY,
                                           self.GetName(), "compressed")
        # Bundle files option for py2exe. Specifying a level of 2 includes
        # the .pyd and .dll files into the zip-archive or the executable. Thus,
        # the dist directory will contain your exe file(s), the library.zip file
        # (if you haven't specified 'zipfile=None'), and the python dll. The
        # advantage of this scheme is that the application can still load extension
        # modules from the file system if you extend sys.path at runtime.
        # Using a level of 1 includes the .pyd and .dll files into the zip-archive
        # or the executable itself, and does the same for pythonXY.dll. The advantage
        # is that you only need to distribute one file per exe, which will however
        # be quite large. Another advantage is that inproc COM servers will run
        # completely isolated from other Python interpreters in the same exe. The
        # disadvantage of this scheme is that it is impossible to load other
        # extensions from the file system, the application will crash with a fatal
        # Python error if you try this.
        self.bundleCombo = MultiComboBox(self, ["1", "2", "3"], wx.CB_DROPDOWN|wx.CB_READONLY,
                                         self.GetName(), "bundle_files")
        # A checkbox that enables the user to choose a different name for the zipfile
        # Default is unchecked, that means zipfile=None
        self.zipfileChoice = wx.CheckBox(self, -1, "Zipfile", name="zipfile_choice")
        # The name of the zipfile (if enabled by the user)
        self.zipfileTextCtrl = wx.TextCtrl(self, -1, "None", name="zipfile")
        # A checkbox that enables the user to choose a different name for the
        # distribution directory. Default is unchecked, that means dist_dir="dist"
        self.distChoice = wx.CheckBox(self, -1, _("Dist Directory"), name="dist_dir_choice")
        # The name of the distribution directory (if enabled)
        self.distTextCtrl = wx.TextCtrl(self, -1, "dist", name="dist_dir")
        # Allows to skip the archive. If checked, this copies the Python bytecode files
        # directly into the dist directory and subdirectories - no archive is used.
        self.skiparchiveChoice = wx.CheckBox(self, -1, "Skip Archive", name="skip_archive")
        # If checked, embed the XP manifest file directly in the executable
        self.xpmanifestChoice = wx.CheckBox(self, -1, "XP Manifest File", name="manifest_file")

        # A list control for the "includes" option, a comma separated list of
        # modules to include
        self.includeList = BaseListCtrl(self, columnNames=[_("Python Modules")], name="includes")
        # A list control for the "packages" option, a comma separated list of
        # packages to include
        self.packagesList = BaseListCtrl(self, columnNames=[_("Python Packages")], name="packages")
        # A list control for the "excludes" option, a comma separated list of
        # modules to exclude
        self.excludeList = BaseListCtrl(self, columnNames=[_("Python Modules")], name="excludes")
        # A list control for the "dll_excludes" option, a comma separated list of
        # Windows dlls to include
        self.dllExcludeList = BaseListCtrl(self, columnNames=[_("DLL Names")], name="dll_excludes")
        # A list control for the "ignores" option, a comma separated list of
        # modules to ignores
        self.ignoreList = BaseListCtrl(self, columnNames=[_("Python Modules")], name="ignores")
        # A list control for the "data_files" option. "data_files" should contain
        # a sequence of (target-dir, files) tuples, where files is a sequence of
        # files to be copied
        self.datafileList = BaseListCtrl(self, columnNames=[_("Directory")+" "*15, _("Files Path")], name="data_files")
        # A list control for the "icon_resources" option
        self.iconResourceList = BaseListCtrl(self, columnNames=[_("Id  "), _("Icon Path")], name="icon_resources")
        # A list control for the "bitmap_resources" option
        self.bitmapResourceList = BaseListCtrl(self, columnNames=[_("Id  "), _("Bitmap Path")], name="bitmap_resources")
        # A list control for the "other_resources" option
        self.otherResourceList = BaseListCtrl(self, columnNames=[_("Type"), _("Id  "), _("Path/Value")], name="other_resources")

        # This command line switch instructs py2exe to create a python module cross
        # reference and display it in the webbrowser.  This allows to answer question
        # why a certain module has been included, or if you can exclude a certain module
        # and it's dependencies. Also, the html page includes links which will even
        # allow to view the source code of a module in the browser, for easy inspection.
        self.crossRefCheck = wx.CheckBox(self, -1, "Cross-Reference", name="xref")
        # To prevent unicode encoding error, py2exe now by default includes the codecs
        # module and the encodings package. If you are sure your program never
        # implicitely or explicitely has to convert between unicode and ascii strings
        # this can be prevented by checking this checkbox 
        self.asciiCheck = wx.CheckBox(self, -1, "Ascii", name="ascii")

        # The following 2 are only for service, com_server and ctypes_com_server
        self.createExeCheck = wx.CheckBox(self, -1, "Create EXE", name="create_exe")
        self.createDllCheck = wx.CheckBox(self, -1, "Create DLL", name="create_dll")

        # By picking a Python script here, this script can do things like installing
        # a customized stdout blackhole. See py2exe's boot_common.py for examples of
        # what can be done. The custom boot script is executed during startup of
        # the executable immediately after boot_common.py is executed
        self.customBootPicker = wx.FilePickerCtrl(self, style=wx.FLP_USE_TEXTCTRL, name="custom_boot_script")

        # Hold a reference to all the list controls, to speed up things later
        self.listCtrls = [self.includeList, self.packagesList, self.excludeList, self.dllExcludeList,
                          self.ignoreList, self.datafileList, self.iconResourceList, self.bitmapResourceList,
                          self.otherResourceList]

        # Do the hard work... quite a few to layout :-D
        self.LayoutItems()
        self.SetProperties()
        self.BindEvents()