DynAIkonTrap.server.html_generator#

This file contains functions for generating html pages for the DynAikonTrap web viewer. Heavily modifed from the startpoint provided over at: https://gist.githubusercontent.com/glowinthedark/625eb4caeca12c5aa52778a3b4b0adb4/raw/d245a5c53e935f03b08e528f0b79c66e58823987/generate_directory_index_caddystyle.py

Functions

make_fov_page()

Creates the HTML for the page to view camera's current field of view, this is saved to a file, html/fov.html

make_head(dir)

Creates and returns the header html for served pages, includes bootstrap styling.

make_main_page(top_dir, output_log)

Creates the html for the main page and writes this to a file, index.html

make_shell_page(ip_addr, port)

Creates HTML for the page to view the shellinabox terminal.

make_sprites()

Creates html code for loading svg sprites used, this is returned as a string

pretty_size(bytes[, units])

Human-readable file sizes.

process_dir(path_top_dir)

Make the html for a serving a directory and its nested members

make_fov_page()#

Creates the HTML for the page to view camera’s current field of view, this is saved to a file, html/fov.html

make_head(dir) str#

Creates and returns the header html for served pages, includes bootstrap styling.

make_main_page(top_dir, output_log)#

Creates the html for the main page and writes this to a file, index.html

make_shell_page(ip_addr, port)#

Creates HTML for the page to view the shellinabox terminal. Makes use of an IFrame and a basic href to the port running shellinabox. May not work for some browsers.

make_sprites()#

Creates html code for loading svg sprites used, this is returned as a string

pretty_size(bytes, units=[(1125899906842624, ' PB'), (1099511627776, ' TB'), (1073741824, ' GB'), (1048576, ' MB'), (1024, ' KB'), (1, (' byte', ' bytes'))])#

Human-readable file sizes. ripped from https://pypi.python.org/pypi/hurry.filesize/

process_dir(path_top_dir)#

Make the html for a serving a directory and its nested members