module filehelper.files_status
¶
Short summary¶
module pyquickhelper.filehelper.files_status
keep the status of a folder, assuming this folder is not moved
Classes¶
class |
truncated documentation |
---|---|
This class maintains a list of files and does some verifications in order to check if a file was modified or not … |
Methods¶
method |
truncated documentation |
---|---|
file which will contains the status |
|
Iterates on all files stored in the current file, yield a couple (filename, FileInfo). |
|
Adds a file to self.modifiedList if it was modified. |
|
Adds a file the modified list of files. |
|
Goes through the list of files and tells which one has changed. |
|
Returns (True, reason) if a file was modified or (False, None) if not. |
|
Iterates on all modified files yield a couple (filename, reason). |
|
Saves the status of the copy. |
|
Updates the file in copyFiles (before saving), update all fields. |
Documentation¶
keep the status of a folder, assuming this folder is not moved
- class pyquickhelper.filehelper.files_status.FilesStatus(file, fLOG=<function noLOG>)[source]¶
Bases:
object
This class maintains a list of files and does some verifications in order to check if a file was modified or not (if yes, then it will be updated to the website).
file which will contains the status
- Parameters:
file – file, if None, fill _children
fLOG – logging function
- __init__(file, fLOG=<function noLOG>)[source]¶
file which will contains the status
- Parameters:
file – file, if None, fill _children
fLOG – logging function
- __iter__()[source]¶
Iterates on all files stored in the current file, yield a couple (filename, FileInfo).
- add_if_modified(file)[source]¶
Adds a file to self.modifiedList if it was modified.
- Parameters:
file – filename
- Returns:
True or False
- add_modified_file(file, reason)[source]¶
Adds a file the modified list of files.
- Parameters:
file – file to add
reason – reason for modification
- difference(files, u4=False, nlog=None)[source]¶
Goes through the list of files and tells which one has changed.
- Parameters:
files –
FileTreeNode
u4 –
FileTreeNode
(changes the output)nlog – if not None, print something every
nlog
processed files
- Returns:
iterator on files which changed
- has_been_modified_and_reason(file)[source]¶
Returns (True, reason) if a file was modified or (False, None) if not.
- Parameters:
file – filename
- Returns:
(True, reason) or (False, None)
- save_dates(checkfile=None)[source]¶
Saves the status of the copy.
- Parameters:
checkfile – check the status for file checkfile