FileStatus - Show the status of a group of source files.

Provides a command line tool for finding out information on files:

$ python3 src/cpip/ -r src/cpip/
Cmd: src/cpip/ -r src/cpip/
File                                     SLOC      Size                               MD5  Last modified
src/cpip/                     1072     44829  4dee8712b7d51f978689ef257cf1fd34  Wed Sep 27 08:57:00 2017
src/cpip/            124      4862  4f0d5731ef6f3d47ec638f00e7646a9f  Fri Sep  8 15:30:41 2017
src/cpip/                    269     11795  914ed2149dce6584e6f3f55ec0e2b923  Wed Sep 27 11:35:32 2017
src/cpip/                    218      8015  6db0658622e82d32a9a9b4c8eb9e82e5  Thu Sep 28 11:13:40 2017
src/cpip/                  1026     45049  7b82651dadd44eb4ed65d390f6c052df  Fri Sep  8 15:30:41 2017
src/cpip/util/                     166      5719  cdb81d1eaaf6a1743e5182355f2e75bb  Fri Sep  8 15:30:41 2017
src/cpip/util/                 425     15114  48563685ace3ec0f6d734695cac17ede  Tue Sep 12 15:38:55 2017
src/cpip/util/                  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.


Add other to me.


list of weak references to the object (if defined)


Files processed.


Size in bytes.


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.


list of weak references to the object (if defined)

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.


Prints out the status of files in a directory:

$ python ../src/cpip/ --help
Cmd: ../src/cpip/ --help
Usage: [options] dir
Counts files and sizes.

  --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:
  -l LOGLEVEL, --loglevel=LOGLEVEL
                        Log Level (debug=10, info=20, warning=30, error=40,
                        critical=50) [default: 30]
  -r                    Recursive. [default: False]