Compare commits
10 commits
cb9e19d1a2
...
60275a475e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60275a475e | ||
|
|
e730cfec55 | ||
|
|
f766f67cee | ||
|
|
49a521ea14 | ||
|
|
69fa5bb7c5 | ||
|
|
5253d37411 | ||
|
|
c0c069cead | ||
|
|
64f449eee8 | ||
|
|
601d5e86e7 | ||
|
|
fd370294be |
7 changed files with 68 additions and 37 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -6,3 +6,6 @@ build/
|
|||
dist
|
||||
index.html
|
||||
pip-wheel-metadata/
|
||||
*.pdf
|
||||
*.css
|
||||
*.pyz
|
||||
|
|
|
|||
41
CHANGELOG.md
41
CHANGELOG.md
|
|
@ -2,28 +2,33 @@
|
|||
|
||||
The changelog was only added at version 0.0.4.
|
||||
|
||||
## 0.0.9
|
||||
|
||||
- Fix thumbnail generation (thanks @dickreckard!)
|
||||
- Adjust formatting for usage output
|
||||
|
||||
## 0.0.8
|
||||
|
||||
* Allow to ignore hidden directories with `--no-hidden`
|
||||
* Files and directories are now sorted during distribusification.
|
||||
* Allow to append `index.html` to the menu items with `--menu-with-index`
|
||||
- Allow to ignore hidden directories with `--no-hidden`
|
||||
- Files and directories are now sorted during distribusification.
|
||||
- Allow to append `index.html` to the menu items with `--menu-with-index`
|
||||
|
||||
## 0.0.7
|
||||
|
||||
Let's think a bit about safety and robustness:
|
||||
|
||||
* distribusi only overwrites (or removes) indexes that have been created by distribusi itself
|
||||
* override the above behaviour with `--force`
|
||||
* `--exclude` now allows you to exclude folder names from being listed, this behaviour is not influenced by `--force`
|
||||
- distribusi only overwrites (or removes) indexes that have been created by distribusi itself
|
||||
- override the above behaviour with `--force`
|
||||
- `--exclude` now allows you to exclude folder names from being listed, this behaviour is not influenced by `--force`
|
||||
|
||||
And also some refactoring and niceties:
|
||||
|
||||
* Distribusi only prints when called with `--verbose`
|
||||
* Restyled `--verbose` output
|
||||
* Generated indexes can be removed with `--remove-indexes`
|
||||
* .html and .txt files are now expanded and included as snippets in the index file
|
||||
* code rewrite for clarity
|
||||
* HTML output is more precisely styleable
|
||||
- Distribusi only prints when called with `--verbose`
|
||||
- Restyled `--verbose` output
|
||||
- Generated indexes can be removed with `--remove-indexes`
|
||||
- .html and .txt files are now expanded and included as snippets in the index file
|
||||
- code rewrite for clarity
|
||||
- HTML output is more precisely styleable
|
||||
|
||||
## 0.0.6
|
||||
|
||||
|
|
@ -31,12 +36,12 @@ Woops, we missed that one.
|
|||
|
||||
## 0.0.5
|
||||
|
||||
* Use loose bounds for dependencies
|
||||
* Don't call exiftools on every execution
|
||||
* If `PILLOW` can't thumbnail an image it is included as a link instead
|
||||
- Use loose bounds for dependencies
|
||||
- Don't call exiftools on every execution
|
||||
- If `PILLOW` can't thumbnail an image it is included as a link instead
|
||||
|
||||
## 0.0.4
|
||||
|
||||
* Add captions from EXIF metadata
|
||||
* Custom stylesheet usage
|
||||
* Ability to hide filenames
|
||||
- Add captions from EXIF metadata
|
||||
- Custom stylesheet usage
|
||||
- Ability to hide filenames
|
||||
|
|
|
|||
|
|
@ -78,6 +78,13 @@ $ distribusi -d /var/www/archive/my_event -t -v
|
|||
|
||||
# ✌
|
||||
|
||||
|
||||
## History
|
||||
|
||||
Distribusi was first conceptualized as a tool which supported a contribution by Dennis de Bel, Danny van der Kleij and Roel Roscam Abbing to the [ruru house](http://ruruhuis.nl/) organized by [Reinaart Vanhoe](http://vanhoe.org/) and the [ruangrupa](http://ruru.ruangrupa.org/) collective during 2016 Sonsbeek Biennale in Arnhem. During the biennale time the ruru house was a lively meeting place with a programme of discussions, workshops, lectures, culinary activities, performances, pop-up markets and even karaoke evenings, where curators and Arnhemmers met.
|
||||
|
||||
The contribution consisted of setting up distribusi.ruruhuis.nl (distribusi is bahasa Indonesian for 'distribution') which was a website connected to a server in the space. Rather than a hidden administrative interface, the server was present and visible and an invitation was extended to visitors to use it to publish material online. This was done by inserting a USB-drive into any of the ports. The distribusi script would then turn the contents of that stick it into a website. Once the USB-drive was removed that website was no longer on-line. Over time distribusi.ruruhuis.nl hosted photos, books and movies. The website is now off-line but the tool that was used to make it is still used in Varia
|
||||
|
||||
## Change It
|
||||
|
||||
You'll need to get a copy of the repository and then do an [editable] install:
|
||||
|
|
|
|||
12
build.sh
Executable file
12
build.sh
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Ultra wild west single binary compiling
|
||||
# https://github.com/linkedin/shiv
|
||||
|
||||
shiv --output-file=distribusi.pyz \
|
||||
--site-packages=.venv/lib/python3.7/site-packages/ \
|
||||
--entry-point=distribusi.cli.cli_entrypoint \
|
||||
--python="/usr/bin/env python3" \
|
||||
--compressed \
|
||||
--compile-pyc \
|
||||
.
|
||||
|
|
@ -5,13 +5,15 @@ from distribusi.distribusi import distribusify
|
|||
|
||||
|
||||
def build_argparser():
|
||||
parser = argparse.ArgumentParser("""
|
||||
distbusi is a content management system for the web that produces static
|
||||
index pages based on folders in the files system.
|
||||
It is inspired by the automatic index functions featured in several popular web
|
||||
servers. distribusi works by traversing the file system and directory hierarchy
|
||||
to automatically list all the files in the directory, detect the file types and
|
||||
providing them with relevant html classes and tags for easy styling.""")
|
||||
parser = argparse.ArgumentParser(
|
||||
"""
|
||||
distribusi is a content management system for the web that produces static
|
||||
index pages based on folders in the files system. It is inspired by the
|
||||
automatic index functions featured in several popular web servers.
|
||||
distribusi works by traversing the file system and directory hierarchy to
|
||||
automatically list all the files in the directory, detect the file types
|
||||
and providing them with relevant html classes and tags for easy styling.
|
||||
""")
|
||||
|
||||
parser.add_argument(
|
||||
'-d', '--directory', help="Select which directory to distribute", default="."
|
||||
|
|
|
|||
|
|
@ -33,6 +33,12 @@ def thumbnail(image, name, args):
|
|||
size = (450, 450)
|
||||
im = Image.open(image)
|
||||
im.thumbnail(size)
|
||||
|
||||
if (im.mode == 'RGBA'):
|
||||
bg = Image.new('RGBA', im.size, (255,255,255))
|
||||
composite = Image.alpha_composite(bg, im)
|
||||
im=composite.convert('RGB')
|
||||
|
||||
output = BytesIO()
|
||||
im.save(output, format='JPEG')
|
||||
im_data = output.getvalue()
|
||||
|
|
@ -162,7 +168,7 @@ def distribusify(args, directory): # noqa
|
|||
caption = ""
|
||||
if args.captions:
|
||||
caption = caption(full_path)
|
||||
a = FILE_TYPES[type_].format(name, caption)
|
||||
a = FILE_TYPES[type_].format(name, caption)
|
||||
|
||||
if subtype in SUB_TYPES:
|
||||
a = SUB_TYPES[subtype]
|
||||
|
|
@ -180,7 +186,10 @@ def distribusify(args, directory): # noqa
|
|||
html.append(div(args, type_, subtype, a, name))
|
||||
|
||||
if root != directory:
|
||||
html.append('<a href="../">../</a>')
|
||||
if args.menu_with_index:
|
||||
html.append('<a href="../index.html">../</a>')
|
||||
else:
|
||||
html.append('<a href="../">../</a>')
|
||||
|
||||
for name in dirs:
|
||||
if args.menu_with_index:
|
||||
|
|
|
|||
13
setup.py
13
setup.py
|
|
@ -7,7 +7,7 @@ with open('README.md', 'r') as handle:
|
|||
|
||||
setup(
|
||||
name='distribusi',
|
||||
version='0.0.5',
|
||||
version='0.0.9',
|
||||
url='https://git.vvvvvvaria.org/varia/distribusi',
|
||||
license='GPLv3',
|
||||
author='Varia',
|
||||
|
|
@ -23,13 +23,6 @@ setup(
|
|||
zip_safe=False,
|
||||
platforms='any',
|
||||
install_requires=dependencies,
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'distribusi = distribusi.cli:cli_entrypoint',
|
||||
],
|
||||
},
|
||||
classifiers=[
|
||||
'Programming Language :: Python :: 3',
|
||||
'Environment :: Console',
|
||||
],
|
||||
entry_points={'console_scripts': ['distribusi = distribusi.cli:cli_entrypoint']},
|
||||
classifiers=['Programming Language :: Python :: 3', 'Environment :: Console'],
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue