PSCF v1.1
|
Class that represents a directory. More...
Public Member Functions | |
def | __init__ (self, path=None, scan=1) |
Constructor. More... | |
def | clear (self) |
Clear all data for this Directory. More... | |
def | filenames (self, pattern=' *', recursive=1) |
Find files in directory that match a pattern. More... | |
def | __repr__ (self) |
String representation of a directory. More... | |
def | __str__ (self) |
String representation of a directory. More... | |
def | xml (self, indent='') |
XML string representation of a directory. More... | |
def | write (self, filename) |
Write XML representation to file. More... | |
def | ls (self) |
Print constituent file and subdirectories. More... | |
def | __eq__ (self, other) |
Test for equality of two Directory objects. More... | |
def | __ne__ (self, other) |
Test for inequality of two Directory objects. More... | |
def | diff (self, other) |
Return string reporting difference between Directory objects. More... | |
Public Member Functions inherited from pscfpp.file.File | |
def | __init__ (self, path=None, scan=1) |
Constructor. More... | |
def | __str__ (self) |
String representation of file data. More... | |
def | __repr__ (self) |
String representation of file data. More... | |
def | open (self, mode) |
Open this file in specified mode. More... | |
def | write (self, filename) |
Write XML representation to a file. More... | |
def | __eq__ (self, other) |
Test for equality of files. More... | |
def | __ne__ (self, other) |
Test for inequality of files. More... | |
Class that represents a directory.
A Directory contains a dictionary of files and subdirectories.
def pscfpp.file.Directory.__init__ | ( | self, | |
path = None , |
|||
scan = 1 |
|||
) |
Constructor.
path | path to file |
scan | bool flag to scan time and size |
Reimplemented from pscfpp.file.File.
Definition at line 192 of file file.py.
References pscfpp.file.Directory.dirs, pscfpp.make.MakeMaker.dirs, pscfpp.file.Directory.files, pscfpp.file.File.path, pscfpp.file.Directory.path, and pscfpp.make.MakeMaker.path.
def pscfpp.file.Directory.clear | ( | self | ) |
Clear all data for this Directory.
Definition at line 221 of file file.py.
References pscfpp.file.Directory.dirs, pscfpp.make.MakeMaker.dirs, and pscfpp.file.Directory.files.
def pscfpp.file.Directory.filenames | ( | self, | |
pattern = '*' , |
|||
recursive = 1 |
|||
) |
Find files in directory that match a pattern.
pattern | glob pattern to match |
recursive | recursive if true/1, descend subdirectories |
Definition at line 231 of file file.py.
References pscfpp.file.Directory.dirs, pscfpp.make.MakeMaker.dirs, pscfpp.file.Directory.filenames(), pscfpp.file.File.path, pscfpp.file.Directory.path, and pscfpp.make.MakeMaker.path.
Referenced by pscfpp.file.Directory.filenames().
def pscfpp.file.Directory.__repr__ | ( | self | ) |
String representation of a directory.
Reimplemented from pscfpp.file.File.
Definition at line 242 of file file.py.
References pscfpp.file.Directory.dirs, pscfpp.make.MakeMaker.dirs, pscfpp.file.Directory.files, pscfpp.file.File.path, pscfpp.file.Directory.path, and pscfpp.make.MakeMaker.path.
def pscfpp.file.Directory.__str__ | ( | self | ) |
String representation of a directory.
Reimplemented from pscfpp.file.File.
Definition at line 254 of file file.py.
References pscfpp.file.Directory.dirs, pscfpp.make.MakeMaker.dirs, pscfpp.file.Directory.files, pscfpp.file.File.path, pscfpp.file.Directory.path, and pscfpp.make.MakeMaker.path.
Referenced by pscfpp.field.Field.write(), pscfpp.output.Thermo.write(), and pscfpp.output.State.write().
def pscfpp.file.Directory.xml | ( | self, | |
indent = '' |
|||
) |
XML string representation of a directory.
Reimplemented from pscfpp.file.File.
Definition at line 266 of file file.py.
References pscfpp.file.Directory.dirs, pscfpp.make.MakeMaker.dirs, pscfpp.file.Directory.files, pscfpp.file.File.path, pscfpp.file.Directory.path, pscfpp.make.MakeMaker.path, and pscfpp.file.Directory.xml().
Referenced by pscfpp.file.Directory.diff(), pscfpp.file.File.write(), pscfpp.file.Directory.write(), and pscfpp.file.Directory.xml().
def pscfpp.file.Directory.write | ( | self, | |
filename | |||
) |
Write XML representation to file.
filename | name of output file |
Reimplemented from pscfpp.file.File.
Definition at line 282 of file file.py.
References pscfpp.file.File.open(), pscfpp.file.File.xml(), and pscfpp.file.Directory.xml().
def pscfpp.file.Directory.ls | ( | self | ) |
Print constituent file and subdirectories.
Definition at line 290 of file file.py.
References pscfpp.file.Directory.dirs, pscfpp.make.MakeMaker.dirs, and pscfpp.file.Directory.files.
def pscfpp.file.Directory.__eq__ | ( | self, | |
other | |||
) |
Test for equality of two Directory objects.
other | other Directory to which to compare |
Reimplemented from pscfpp.file.File.
Definition at line 301 of file file.py.
References pscfpp.file.Directory.dirs, pscfpp.make.MakeMaker.dirs, and pscfpp.file.Directory.files.
def pscfpp.file.Directory.__ne__ | ( | self, | |
other | |||
) |
Test for inequality of two Directory objects.
other | other Directory to which to compare |
Reimplemented from pscfpp.file.File.
def pscfpp.file.Directory.diff | ( | self, | |
other | |||
) |
Return string reporting difference between Directory objects.
other | other Directory to which to compare |
Definition at line 338 of file file.py.
References pscfpp.file.Directory.diff(), pscfpp.file.Directory.dirs, pscfpp.make.MakeMaker.dirs, pscfpp.file.Directory.files, and pscfpp.file.Directory.xml().
Referenced by pscfpp.file.Directory.diff().