Browse Source

adding readme, cleaning up code

package-it-up
rra 7 years ago
parent
commit
2a744c3355
  1. 1
      .gitignore
  2. 20
      README.md
  3. 13
      distribusi.py

1
.gitignore

@ -1,3 +1,4 @@
*.pyc
index.html
__pycache__/
.DS_Store

20
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.
#✌

13
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)
<pre>
iddqd_doom
</pre>
Loading…
Cancel
Save