adding readme, cleaning up code
This commit is contained in:
parent
5f27768b15
commit
2a744c3355
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
*.pyc
|
*.pyc
|
||||||
index.html
|
index.html
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
.DS_Store
|
||||||
|
20
README.md
Normal file
20
README.md
Normal file
@ -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.
|
||||||
|
|
||||||
|
#✌
|
@ -6,11 +6,8 @@ import os, magic, argparse, sys
|
|||||||
from page_template import *
|
from page_template import *
|
||||||
|
|
||||||
parser = argparse.ArgumentParser("""
|
parser = argparse.ArgumentParser("""
|
||||||
|
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.
|
||||||
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.
|
|
||||||
|
|
||||||
""")
|
|
||||||
parser.add_argument('-d', '--directory', help="Select which directory to distribute")
|
parser.add_argument('-d', '--directory', help="Select which directory to distribute")
|
||||||
parser.add_argument('-v', '--verbose', help="Print verbose debug output", action="store_true")
|
parser.add_argument('-v', '--verbose', help="Print verbose debug output", action="store_true")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
@ -95,9 +92,3 @@ for root, dirs, files in os.walk(directory):
|
|||||||
for line in html:
|
for line in html:
|
||||||
f.write(line+'\n')
|
f.write(line+'\n')
|
||||||
f.write(html_footer)
|
f.write(html_footer)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
iddqd_doom
|
|
||||||
</pre>
|
|
Loading…
Reference in New Issue
Block a user