Functions | |
| def | _common_path (p1, p2) |
| Returns the longest path common to p1 and p2. More... | |
| def | _find_absolute_path (path) |
| def | _find_relative_path (path, basedir) |
| def | _get_link_path (target, base) |
| def | _is_valid_file (path) |
| def | abspath (path, case_normalize=False) |
| Replacement for os.path.abspath with some enhancements and bug fixes. More... | |
| def | find_file (path, basedir='.', file_type=None) |
| def | get_link_path (target, base) |
Returns a relative path to target from base. More... | |
| def | normpath (path, case_normalize=False) |
| Replacement for os.path.normpath with some enhancements. More... | |
Variables | |
| bool | CASE_INSENSITIVE_FILESYSTEM = True |
|
private |
Returns the longest path common to p1 and p2.
Rationale: as os.path.commonprefix is character based, it doesn't consider
path separators as such, so it may return invalid paths:
commonprefix(('/foo/bar/', '/foo/baz.txt')) -> '/foo/ba' (instead of /foo)
Definition at line 115 of file robotpath.py.
|
private |
Definition at line 147 of file robotpath.py.
|
private |
Definition at line 153 of file robotpath.py.
|
private |
Definition at line 86 of file robotpath.py.
|
private |
Definition at line 165 of file robotpath.py.
| def robot.utils.robotpath.abspath | ( | path, | |
case_normalize = False |
|||
| ) |
Replacement for os.path.abspath with some enhancements and bug fixes.
1. Non-Unicode paths are converted to Unicode using file system encoding. 2. Optionally lower-case paths on case-insensitive file systems. That includes Windows and also OSX in default configuration. 3. Turn ``c:`` into ``c:\\`` on Windows instead of ``c:\\current\\path``.
Definition at line 65 of file robotpath.py.
| def robot.utils.robotpath.find_file | ( | path, | |
basedir = '.', |
|||
file_type = None |
|||
| ) |
Definition at line 132 of file robotpath.py.
| def robot.utils.robotpath.get_link_path | ( | target, | |
| base | |||
| ) |
Returns a relative path to target from base.
If ``base`` is an existing file, then its parent directory is considered to be the base. Otherwise ``base`` is assumed to be a directory. The returned path is URL encoded. On Windows returns an absolute path with ``file:`` prefix if the target is on a different drive.
Definition at line 78 of file robotpath.py.
| def robot.utils.robotpath.normpath | ( | path, | |
case_normalize = False |
|||
| ) |
Replacement for os.path.normpath with some enhancements.
1. Convert non-Unicode paths to Unicode using the file system encoding. 2. NFC normalize Unicode paths (affects mainly OSX). 3. Optionally lower-case paths on case-insensitive file systems. That includes Windows and also OSX in default configuration. 4. Turn ``c:`` into ``c:\\`` on Windows instead of keeping it as ``c:``.
Definition at line 46 of file robotpath.py.
| bool robot.utils.robotpath.CASE_INSENSITIVE_FILESYSTEM = True |
Definition at line 30 of file robotpath.py.