FileStatus¶
Provides a command line tool for finding out information on files:
$ python3 src/cpip/FileStatus.py -r src/cpip/
Cmd: src/cpip/FileStatus.py -r src/cpip/
File SLOC Size MD5 Last modified
src/cpip/CPIPMain.py 1072 44829 4dee8712b7d51f978689ef257cf1fd34 Wed Sep 27 08:57:00 2017
src/cpip/CppCondGraphToHtml.py 124 4862 4f0d5731ef6f3d47ec638f00e7646a9f Fri Sep 8 15:30:41 2017
src/cpip/DupeRelink.py 269 11795 914ed2149dce6584e6f3f55ec0e2b923 Wed Sep 27 11:35:32 2017
src/cpip/FileStatus.py 218 8015 6db0658622e82d32a9a9b4c8eb9e82e5 Thu Sep 28 11:13:40 2017
src/cpip/IncGraphSVG.py 1026 45049 7b82651dadd44eb4ed65d390f6c052df Fri Sep 8 15:30:41 2017
...
src/cpip/util/Tree.py 166 5719 cdb81d1eaaf6a1743e5182355f2e75bb Fri Sep 8 15:30:41 2017
src/cpip/util/XmlWrite.py 425 15114 48563685ace3ec0f6d734695cac17ede Tue Sep 12 15:38:55 2017
src/cpip/util/__init__.py 31 1161 208abac9edd9682f438945906a451473 Fri Sep 8 15:30:41 2017
Total [54] 19475 789349
CPU time = 0.041 (S)
Bye, bye!
-
class
cpip.FileStatus.
FileInfo
(thePath)¶ Holds information on a text file.
-
count
¶ Files processed.
-
size
¶ Size in bytes.
-
sloc
¶ Lines in file.
-
write
(theS=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>, incHash=True)¶ Writes the number of lines and bytes (optionally MD5) to stream.
-
writeHeader
(theS=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)¶ Writes header to stream.
-
-
class
cpip.FileStatus.
FileInfoSet
(thePath, glob=None, isRecursive=False)¶ Contains information on a set of files.
-
processDir
(theDir, glob, isRecursive)¶ Read a directory and return a map of {path : class FileInfo, ...}
-
processPath
(theP, glob=None, isRecursive=False)¶ Process a file or directory.
-
write
(theS=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)¶ Write summary to stream.
-
-
cpip.FileStatus.
main
()¶ Prints out the status of files in a directory:
$ python ../src/cpip/FileStatus.py --help Cmd: ../src/cpip/FileStatus.py --help Usage: FileStatus.py [options] dir Counts files and sizes. Options: --version show program's version number and exit -h, --help show this help message and exit -g GLOB, --glob=GLOB Space separated list of file match patterns. [default: *.py] -l LOGLEVEL, --loglevel=LOGLEVEL Log Level (debug=10, info=20, warning=30, error=40, critical=50) [default: 30] -r Recursive. [default: False]