Functions
rtctree::path Namespace Reference

Functions

def format_path
def get_port
def parse_path
 API functions.

Function Documentation

def rtctree.path.format_path (   path)
Formats a path as a string, placing / between each component.

@param path A path in rtctree format, as a tuple with the port name as the
            second component.

Definition at line 95 of file path.py.

def rtctree.path.get_port (   path)

Definition at line 85 of file path.py.

def rtctree.path.parse_path (   path)

API functions.

Parses an address into directory and port parts.

The last segment of the address will be checked to see if it matches a port
specification (i.e. contains a colon followed by text). This will be
returned separately from the directory parts.

If a leading / is given, that will be returned as the first directory
component. All other / characters are removed.

All leading / characters are condensed into a single leading /.

Any path components that are . will be removed, as they just point to the
previous path component. For example, '/localhost/.' will become
'/localhost'. Any path components that are .. will be removed, along with
the previous path component. If this renders the path empty, it will be
replaced with '/'.

Examples:

'localhost:30000/manager/comp0.rtc' ->
    (['localhost:30000', 'manager', 'comp0.rtc'], None)
'localhost/manager/comp0.rtc:in' ->
    (['localhost', 'manager', 'comp0.rtc'], 'in')
'/localhost/manager/comp0.rtc' ->
    (['/', 'localhost', 'manager', 'comp0.rtc'], None)
'/localhost/manager/comp0.rtc:in' ->
    (['/', 'localhost', 'manager', 'comp0.rtc'], 'in')
'manager/comp0.rtc' ->
        (['manager', 'comp0.rtc'], None)
'comp0.rtc' ->
        (['comp0.rtc'], None)

Definition at line 28 of file path.py.



rtctree
Author(s): Geoffrey Biggs
autogenerated on Wed Aug 26 2015 16:13:08