You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parser = argparse.ArgumentParser(description="This program goes from the toplevel directory recursively downwards and places a index PHP in each directory. Then, it's possible to browse files more conveniently with a web browser. Note, that the PHP files have to be accessed through a web server such as Apache with PHP support.")
parser.add_argument("toplevelDirectory", help="Path to the toplevel directory, which is the starting point for the recursion")
parser.add_argument("inputPHPfile", help="Path to the file source, which is placed in each directory")
parser.add_argument("-o", "--outputFilename", default="index.php", help="Name of the output file, which is placed in each directory")
parser.add_argument("-v", "--verbosity", default=1, help="Increase or decrease output verbosity")
args = parser.parse_args()
"""
Go through directories from given toplevel directory and put the given PHP file in each directory
"""
# Read input PHP file
with open(args.inputPHPfile, 'r') as f:
src = f.read()
# Walk downwards through toplevel directory and put given PHP file there
if args.verbosity == 1:
print('Start from toplevel dir: {}'.format(args.toplevelDirectory))