This class has static methods that can be used to interact with PDG’s global path mapping object.
Methods ¶
Static Methods ¶
edit()
→ pdg.PathMapEditBlock
Returns a context manager that can be used to edit the global path mapping. The PDG_PATHMAP
environment variable is updated automatically when the context manager exits.
mapPath(path, zone)
Static method
Returns the mapped version of the given path for the given zone.
mapPathToLocal(path)
Static method
Returns the mapped version of the given path for the local zone.
mappingZone()
Static method
Returns the local mapping zone.
mappings(zone='', scheduler='')
→ list
of pdg.PathMapEntry
Returns the list of path map entries. If the optional Zone and Scheduler filter strings are passed in, the results are filtered to only include entries that match the zone and/or scheduler.
pathMapJSON()
Static method
Returns the PDG Path Map as a JSON string.
setMappingZone(zone)
Static method
Sets the local mapping zone.
setPathMapJSON(json_string, merge=False)
Static method
Sets the PDG Path Map from a JSON string. If merge
is True
, then entries in the JSON string are appended to the end of the existing path map. Otherwise, the existing path map is replaced with the contents of the JSON string.
Instance Methods ¶
addPathMapping(zone, mapFrom, mapTo, createdBy='')
Adds a path mapping entry. This should only be called on the path map instanced returned by the pdg.PathMap.edit context manager.
clearAllMappings()
Clears all path mapping entries.
clearSchedulerMappings(scheduler_path)
Clears any mappings that were added with the specified scheduler path. This should only be called on the path map instanced returned by the pdg.PathMap.edit context manager.
AllZone
: str
Static method Property
The zone string the matches all zones – “*”.
LinuxZone
: str
Static method Property
The zone string for Linux systems – “LINUX”
MacZone
: str
Static method Property
The zone string for Mac systems – “MAC”
WindowsZone
: str
Static method Property
The zone string for Windows systems – “WINDOWS”