PSCF v1.3
pscfpp.file.Directory Class Reference

Class that represents a directory. More...

Inheritance diagram for pscfpp.file.Directory:
pscfpp.file.File

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.

Detailed Description

Class that represents a directory.

A Directory contains a dictionary of files and subdirectories.

Definition at line 190 of file file.py.

Member Function Documentation

◆ clear()

pscfpp.file.Directory.clear ( self)

Clear all data for this Directory.

Definition at line 221 of file file.py.

References dirs, and files.

◆ filenames()

pscfpp.file.Directory.filenames ( self,
pattern = '*',
recursive = 1 )

Find files in directory that match a pattern.

Parameters
patternglob pattern to match
recursiverecursive if true/1, descend subdirectories

Definition at line 231 of file file.py.

References dirs, filenames(), and pscfpp.file.File.path.

Referenced by filenames().

◆ __repr__()

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.

◆ __str__()

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().

◆ xml()

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().

Referenced by diff(), and xml().

◆ write()

pscfpp.file.Directory.write ( self,
filename )

Write XML representation to file.

Parameters
filenamename 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().

◆ ls()

pscfpp.file.Directory.ls ( self)

Print constituent file and subdirectories.

Definition at line 290 of file file.py.

References dirs, and files.

◆ __eq__()

pscfpp.file.Directory.__eq__ ( self,
other )

Test for equality of two Directory objects.

Parameters
otherother Directory to which to compare

Definition at line 301 of file file.py.

References dirs, and files.

◆ __ne__()

pscfpp.file.Directory.__ne__ ( self,
other )

Test for inequality of two Directory objects.

Parameters
otherother Directory to which to compare

Definition at line 328 of file file.py.

◆ diff()

pscfpp.file.Directory.diff ( self,
other )

Return string reporting difference between Directory objects.

Parameters
otherother Directory to which to compare

Definition at line 338 of file file.py.

References diff(), dirs, files, and xml().

Referenced by diff().


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