| |
- FileList
class FileList |
|
Class FileList is the implementation of the module.
Class attributes:
* end: Last value, inclusive (or less than this value, if
stride would exceed end), in sequence (integer).
* files: The files list (this is the key output of the
class).
* nchar: Minimum number of characters in each element of
sequence, including leading zeroes. If nchar is 0, the
width of each entry in sequence is just the numeral value
itself (integer).
* prefix: Prefix to each member of the files list.
* sequence: String list of filenumbers.
* start: First value, inclusive, in sequence (integer).
* stride: Stride of sequence (integer, defaults to 1).
* suffix: Suffix to each member of the files list. |
|
- __init__(self, in_dims, prefix, suffix)
- Initialize/calculate all class attributes.
Method Arguments:
* in_dims: List or tuple of these attributes:
[start, end, nchar, [stride]]. Note stride is
optional, and if left out that attribute is set
to 1. Copied to local variable dims.
* prefix: Prefix to each member of the files list
(string).
* suffix: Suffix to each member of the files list
(string).
- chg_prefix(self, prefix)
- Change prefix in file list.
Replaces the attribute prefix with the argument prefix
and re-calculates the attribute files accordingly.
Method Arguments:
* prefix: Prefix to each member of the files list
(string).
- chg_suffix(self, suffix)
- Change suffix in file list.
Replaces the attribute suffix with the argument suffix
and re-calculates the attribute files accordingly.
Method Arguments:
* suffix: Suffix to each member of the files list
(string).
- make_files(self)
- Create files.
Given attributes prefix, suffix, and sequence,
calculates and returns file list as files attribute.
- make_sequence(self)
- Create sequence.
Given attributes start, end, stride, and nchar,
calculates and returns string list of filenumbers
as the attribute sequence.
| |