Environment Variable Expansion

Index of All Documentation » Wing Pro Reference Manual » Project Manager » Project Properties »


Any string value for a property may contain environment variable references using the $(name) or $ {name} notation. These will be replaced with the value of the environment variable when used by the IDE. If the environment variable is not set, the reference will be replaced by an empty string.

The system environment, as modified by Wing's Project Properties and File Properties, is used to expand variable references.

Special Environment Variables

The following special variable names are defined by Wing:

  • WING:FILENAME -- Full path of currently selected file, either in the editor, in the Project tool or in other places where files can be selected.
  • WING:FILENAME_DIR -- Full path of the directory containing the currently selected file. Note that the full path does not include a trailing slash.
  • WING:FILENAME_BASE -- Base name of the currently selected file.
  • WING:LINENO -- Current line number in the currently selected file.
  • WING:SCOPE -- Dotted name of the current scope in the currently selected file (if Python)
  • WING:PROJECT Full path of current project, including the *.wpr project file name.
  • WING:PROJECT_DIR -- Full path of the directory containing the current project's *.wpr. Note that the full path does not include a trailing slash.
  • WING:PROJECT_HOME -- Full path of the Project Home directory, as set in Project Properties; by default this is the same as WING:PROJECT_DIR. Note that the full path does not include a trailing slash.
  • WING:SELECTION -- The text selected on the current editor, if any.
  • WING:HOSTNAME -- (Wing Pro only) The remote configuration's Hostname for the current project, or the empty string if not a remote project.
  • WING:PYTHON -- The Python interpreter being used in the current project.
  • WING:INSTALL_DIR -- The installation directory of Wing (sometimes referred to as WINGHOME)
  • WING:SETTINGS_DIR -- The user settings directory currently in use by Wing

These can be use the same way as other environment variables, for example ${WING:FILENAME}. Values based on the currently selected file or selection will evaluate to an empty string when there is none.