PSCF v1.3
|
Class that represents a directory. More...
Public Member Functions | |
clear (self) | |
Clear all data for this Directory. | |
filenames (self, pattern=' *', recursive=1) | |
Find files in directory that match a pattern. | |
__repr__ (self) | |
String representation of a directory. | |
__str__ (self) | |
String representation of a directory. | |
xml (self, indent='') | |
XML string representation of a directory. | |
write (self, filename) | |
Write XML representation to file. | |
ls (self) | |
Print constituent file and subdirectories. | |
__eq__ (self, other) | |
Test for equality of two Directory objects. | |
__ne__ (self, other) | |
Test for inequality of two Directory objects. | |
diff (self, other) | |
Return string reporting difference between Directory objects. | |
Public Member Functions inherited from pscfpp.file.File | |
__init__ (self, path=None, scan=1) | |
Constructor. | |
__str__ (self) | |
String representation of file data. | |
__repr__ (self) | |
String representation of file data. | |
open (self, mode) | |
Open this file in specified mode. | |
__eq__ (self, other) | |
Test for equality of files. | |
__ne__ (self, other) | |
Test for inequality of files. |
Class that represents a directory.
A Directory contains a dictionary of files and subdirectories.
pscfpp.file.Directory.clear | ( | self | ) |
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 dirs, filenames(), and pscfpp.file.File.path.
Referenced by filenames().
pscfpp.file.Directory.__repr__ | ( | self | ) |
String representation of a directory.
Definition at line 242 of file file.py.
References dirs, files, and pscfpp.file.File.path.
pscfpp.file.Directory.__str__ | ( | self | ) |
String representation of a directory.
Definition at line 254 of file file.py.
References dirs, files, and pscfpp.file.File.path.
Referenced by pscfpp.output.State.write(), and pscfpp.output.Thermo.write().
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 dirs, files, pscfpp.file.File.path, and xml().
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(), and pscfpp.file.File.xml().
pscfpp.file.Directory.ls | ( | self | ) |
pscfpp.file.Directory.__eq__ | ( | self, | |
other ) |
pscfpp.file.Directory.__ne__ | ( | self, | |
other ) |
pscfpp.file.Directory.diff | ( | self, | |
other ) |