This chapter describes how to use the Wing IDE project manager.
|The project manager is designed to act as a convenient index into the files of
your software project, without tying you to Wing or requiring other developers
that you work with to use Wing.
It is possible to run Wing without using the project manager. However, doing so will prevent the source browser and other source analysis-based capabilities (such as source index menu and auto-completion) from easily discovering the extent of your source code base. For this reason, we recommend setting up a project file for your work.
NOTE: Wing IDE Lite limits projects to containing at most 100 files, and omits some of the project manager features, as indicated below.
Before creating a project, make sure that your project manager window is visible. If it isn't, choose the Project Manager item in the Windows menu to display it.
To create a new project, use the New Project item in the Project menu. This will prompt you to save any changes to your currently open project and will create a new blank project. If Wing is started without any command line arguments, a blank new project is opened by default.
To add files to your project, use the Add File, Add Package, and Add Directory Tree menu items in the Project menu. These can also be accessed from the popup menu that appears when right-clicking your mouse on the surface of the project manager window.
Note that Add Package and Add Directory Tree operate only on files that
Wing considers likely to be relevant for adding to the project. If the list
is missing files you wish to add, you will need to change the
package-omit-types preferences and restart the IDE. For Add Directory
Tree, the preference
dir-omit-types can also be used to specify directories
that should be omitted based on their name. See the section
3.10 below for details.
Normally, Wing will start debugging in whatever file you have as your front- most window. Depending on the nature of your project, you may wish to specify a file as the default debug entry point.
To do this, right-click on one of your Python files in the project manager window and choose the Set As Main Debug File option from the popup menu, or use the Set Current as Main Debug File item in the Project menu. This file is subsequently run whenever you start the debugger, except if you use the Debug Selected File popup menu item on a specific file or the Debug Current File item in the Run menu.
Note that the path to the main debug file is highlighted in red in the project window. You may clear the default debug entry point with the popup menu's Clear Main Debug File item or the Clear Main Debug file in the Project menu.
To remove a specific file, select it and use the Remove From Project menu item in the right-click popup menu from the surface of the Project Manager window, or from the Remove Selected Entry item in the Project menu. You can also remove a whole package directory and all the files that it contains in this way.
You can save your project at any time with the Save Project item in the Project Menu. You will also be prompted to save if you try to close the project, open another project, or exit Wing and you have an unsaved, altered project.
It is possible to set up automatic saving of project files, which is often
convenient as they are altered by many actions taken from the user interface.
To do this, set the
proj.save-without-asking preference to
You can also save a copy of your project to another location or name with Save Project As in the Project menu.
|Using Save Project As is recommended if you need to alter the location of your project file in relation to your source files because it will update the partial relative paths that the project manager uses to locate files in the project. Otherwise, Wing may not be able to find all of the files in the project.|
The project window can be set to show your files in one of two modes:
Once it has the focus, the project manager tree view is navigable with the keyboard, using the up/down arrow keys, page up and page down, home/end, and by using the right arrow key on a parent to expand it, or the left arrow key to collapse a parent. Holding down the shift key while pressing the right arrow will expand recursively below the expansion point. Recursive expansion is capped at five additional levels for each operation to avoid difficult-to-detect infinite recursions. Whenever a tree row is selected, pressing enter or return will open that item within Wing IDE.
|There are two related file formats in which you can save your project. One supports sharing the project file via a revision control system.|
The default project type is 'Normal', which results in all project data
being stored in a single file. This file usually will end in
but does not have to.
If you use a revision control system to share code with multiple developers,
you should change your project to 'Shared' type using the Project Type item in
the Project menu. After making this change, save your project to obtain the
two separate project files on disk. The main project file (usually ending in
'.wpr') can be checked into revision control and the user-specific file
'.wpu') should not be checked into revision control.
If you subsequently change from a Shared project back to Normal, the
user-specific data file, ending in
'.wpu', will be removed from disk
and its data will be merged back into the main project file.
Note that both the combined 'Normal' file and two split 'Shared' files use the same textual file format that is used for the preferences file. See section 2.1.1 for more information on the format itself.
This section enumerates the values stored in the shared project area:
This section enumerates the values stored in the user-specific project area:
Each project has a set of top-level properties that can be accessed and edited via the Properties item in the Project menu. Because these are all debugger-related properties, they are described in the Debugger chapter in section 6.3.1. Note however that these values also inform the source code analysis engine, as described in section 4.16.
Properties similar to those available for the project as a whole can also be set on a per-file basis. This is done by right-clicking on a Python source file and selecting the Set Debug Properties menu item in the popup. Values entered here will override any project-wide values.
Since these all control the debugger, per-file properties are documented in the Debugger chapter in section 6.3.2. See also section 4.16 for information on how these values affect the source code analysis engine.
The bottom of the project manager window contains a file information area that will display file name, file type, and file-level documentation string (when available) for the current selection in the file selection area of the project manager window.
The documentation string contains the file-level docstring for Python files only and currently does not support any other programming languages.
The size of this area can be altered by dragging the divider handle between the file information area and the rest of the project manager window.
Files can be opened from the project manager window by double clicking on the file name, middle-clicking on the file name, or right-clicking and using the Open in Wing IDE menu item.
Files may also be opened using an external viewer or editor by right-clicking
on the file and using the Open in External Viewer item. On Windows, this opens
the file as if you had double clicked on it in Windows Explorer. On Linux/Unix,
can be used to configure how files are opened. See section 2.2.7
It is possible to debug specific files (even if you have set a main debug file for your project) by right-clicking on the file in the project manager window and choosing the Debug Selected File item from the popup menu. A debug session for the selected file is launched, but the definition of the main debug file is not altered.
You can also execute Makefiles, python source, and any executable files by selecting the Execute Selected File item from the popup menu. This executes outside of the debugger with any input/output occurring in the window from which Wing was launched.
Project files tend to grow over time because Wing stores visual state and other information about files that you open. As files come and go, some of this information becomes outdated and may be removed from the project. You can use the Compact File item in the Project menu to prune various types of extraneous information from the project file:
The following preferences affect the project manager:
proj.package-file-typesmatches the given item. Default=
("*.o", "*.a", "*.so", "*.pyc", "*.pyo", "core", "*~", "#*#", "CVS", ".svn")
100if you don't want to see the file information area. Default=
falseto open only the project when a project is opened and
trueto open the project and also any windows that were open the last time the project was closed. This includes both source windows and manager windows. Default=
true, all document windows open at time of project close will also be closed. When
falseonly the project will be closed and other windows will remain untouched. Default=
Changing these values requires you to restart Wing before they take effect.