scanEclipseForPydevd(self,
rootforscan=None,
**kargs)
| source code
|
Scans filesystem directory tree of Eclipse for PyDev plugin containing 'pydevd'.
Scans for 'pydevd' required for subprocess debugging
by the Debug-Server of PyDev. See PyDev manual for
path reference, the default pattern for 'marketplace' installation is:
::
eclipse/plugins/org.python.pydev_x.x.x/pysrc/pydevd.py
in case of drop-in installation
::
eclipse/dropins/<pydev-dropin-name>/plugins/org.python.pydev_x.x.x/pysrc/pydevd.py
The matching versions could be varied by glob-expressions.
The provided parameters match as follows:
::
rdbgroot := /path/to/eclipse
rdbgsub := org.python.pydev_x.x.x/pysrc/pydevd.py
The glue-hook depends on the type of installation and is determined
dynamically:
::
dropin-install := dropins/<pydev-dropin-name>/plugins
market-place-install := plugins
Basically any path could be used, in particular a rdbgsub directory
containing a subset for 'pydevd.py' on a remote machine as stated
by the PyDev project for remote debugging of server processes. The
filesystem resolution is performed on a local filesystem only, but
could be performed by command line start of the headless process
on the remote machine too.
The path is the containment path of the file *pydevd.py* and has to be
included in the *sys.path* variable for activation.
The *scanEclipseForPydevd* method performs a search and returns the
absolute path in case of a match.
The search for the root directory into the Eclipse package installation
is performed in the following order and priority:
1. **parameters**
Consume call/command line parameters, ENV, and hard/coded.
Parameter mix by environment variables as present:
For the actual main control of environment variables
refer to epyunit.checkRDbg.checkAndRemoveRDbgOptions.
::
(rdbgroot or RDBGROOT) + ( rdbgsub or RDBGSUB )
Contains the value for the option '--rdbg-root',
either literal or as a 'glob' pattern.
The following priorities are applied:
1. CLI call option
2. API call option
3. RDBGROOT/RDBGSUB + missing from
4. Code defaults
2. **sys.path**
Each separate path is tried with the sub-path pattern,
first match wins.
3. **PATH - which eclipse**
Each separate path is tried with the sub-path pattern,
first match wins.
4. **<HOME>/eclipse/eclipse**
A convention of the author, where the the path is
a symbolic link to the executable.
When present, the realpath is evaluated from the link.
5. **search install directory - dropins**
When 'ePyUnit' itself is installed as a drop-in within eclipse,
the search is performed within the current Eclipse release
only::
os.path.dirname(__file__) + rdbgsub
For example::
eclipse/dropins/epyunit
The first match of containing directory for 'pydevd.py'
is returned, thus ambiguity in case of multiple occurrences
has to be avoided.
The pattern resolution into the PyDev dir is performed by the steps:
::
0. <eclipse-root>/plugins/<rdbgsub>
1. <eclipse-root>/dropins/<rdbgsub>
2. <eclipse-root>/dropins/*/plugins/<rdbgsub>
Args:
rootforscan: Start directory for tree-scan, either a
single, multiple in PATH notation. Each path points
to an Eclipse installation directory.
**kargs:
altpat=(<literal>|<glob>): Alternative pattern, varies 'eclipse_glob',
and 'pydevd_glob'.
strict: Provided parameter has to match, else error.
Default is to try all, when supplied params do not
match default values are checked.
version=(a,b,c): Provide version to be requested. It is recommended
to combine this with 'strict'.
The parameters 'altpat' and 'version' are EXOR.
version=(a,b,c)
a := [0-9]+
b := [0-9]+
b := [0-9]+
Returns:
The location of pydevd.py
Raises:
AttributeError:
|