From 2a744c3355a4a97764190a5f436467cb5664a76a Mon Sep 17 00:00:00 2001 From: rra Date: Sat, 10 Feb 2018 19:15:57 +0100 Subject: [PATCH] adding readme, cleaning up code --- .gitignore | 1 + README.md | 20 ++++++++++++++++++++ distribusi.py | 13 ++----------- 3 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 README.md diff --git a/.gitignore b/.gitignore index ccf38ae..57d8da2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.pyc index.html __pycache__/ +.DS_Store diff --git a/README.md b/README.md new file mode 100644 index 0000000..c7c5b18 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ + +#distribusi cms +distbusi is a content management system for the web that produces static index pages based on folders in the filesystem. It is inspired by the automatic index functions featured in several web servers. It works by traversing the file system and directory hierarchy to automatically list all the files in the directory and providing them with html classes and tags for easy styling. + + +##installation + +distribusi depends on python-magic 0.4+ to do automatic mime (filetype) detection + +using pip: + `sudo pip3 install python-magic` + +##usage + +Make a distribusi of your home folder: + `python3 distribusi -d ~/` + +You will find that you now have an `index.html` in every folder. + +#✌ diff --git a/distribusi.py b/distribusi.py index d60ae0b..9318531 100755 --- a/distribusi.py +++ b/distribusi.py @@ -6,11 +6,8 @@ import os, magic, argparse, sys from page_template import * parser = argparse.ArgumentParser(""" - - distribusi is a content management system for the web producing static pages based on the filesystem. It is inspired by the automatic index functions featured in several webservers. As such it uses the file system and directory hierarchy to automatically list all the files in the - directory and providing them with html classes and tags for easy styling. - - """) +distbusi is a content management system for the web that produces static index pages based on folders in the filesystem. It is inspired by the automatic index functions featured in several web servers. It works by traversing the file system and directory hierarchy to automatically list all the files in the directory and providing them with html classes and tags for easy styling. +""") parser.add_argument('-d', '--directory', help="Select which directory to distribute") parser.add_argument('-v', '--verbose', help="Print verbose debug output", action="store_true") args = parser.parse_args() @@ -95,9 +92,3 @@ for root, dirs, files in os.walk(directory): for line in html: f.write(line+'\n') f.write(html_footer) - - - -
-		iddqd_doom
-		
\ No newline at end of file