Path

class ostools.Path(envvar='PATH')[source]

This is a class for working with PATHs, like PATH or MANPATH.

It has the interface of a list. It loads the initial list from an environment variable, and converts each element into a FilePath, with exist_required set to false.

envvar

str – The environment variable to load the paths from.

items

list – The list of paths.

append(item)[source]

This function functions like list.append(). It also converts the item into a FilePath, with exist_required set to false.

extend(items)[source]

This function functions like list.extend(). It also converts each item into a FilePath, with exist_required set to false.

insert(index, item)[source]

This function functions like list.insert(). It also converts the item into a FilePath, with exist_required set to false.

reload()[source]

Load the PATH from the environment variable specified in envvar, converting each element into a FilePath, with exist_required set to false.