Belle II Software  release-06-02-00
PathExtras Class Reference

Public Member Functions

def __init__ (self, path=None)
 
def __contains__ (self, module_name)
 
def index (self, module_name)
 

Public Attributes

 path
 Attribute to hold path object that this class wraps.
 

Private Member Functions

def _update_names (self)
 

Private Attributes

 _module_names
 Holds a list of module names for the path in self.path.
 

Detailed Description

Simple wrapper for basf2 paths to allow some extra python functionality directly on
them e.g. comparing whether or not a module is contained within a path with 'in' keyword.

Definition at line 570 of file utils.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  path = None 
)
Initialising with a path.

Definition at line 576 of file utils.py.

Member Function Documentation

◆ __contains__()

def __contains__ (   self,
  module_name 
)
Special method to allow 'module_name in path' type comparisons. Returns
a boolean and compares by module name.

Definition at line 597 of file utils.py.

◆ _update_names()

def _update_names (   self)
private
Takes the self.path attribute and uses the current state to recreate the
self.module_names list

Definition at line 589 of file utils.py.

◆ index()

def index (   self,
  module_name 
)
Returns the index of the first instance of a module in the contained path.

Definition at line 605 of file utils.py.


The documentation for this class was generated from the following file: