1
0
Fork 0

better colors, hints, and progress bars in docker

This commit is contained in:
Nick Sweeting 2020-08-18 18:32:11 -04:00
parent 5cb13ff1dd
commit 31a6318582
4 changed files with 19 additions and 16 deletions

View file

@ -62,10 +62,10 @@ To get started, you can [install them manually](https://github.com/pirate/Archiv
```bash ```bash
# Docker # Docker
mkdir data && cd data mkdir data && cd data
docker run -v $PWD:/data nikisweeting/archivebox init docker run -v $PWD:/data -it nikisweeting/archivebox init
docker run -v $PWD:/data nikisweeting/archivebox add 'https://example.com' docker run -v $PWD:/data -it nikisweeting/archivebox add 'https://example.com'
docker run -v $PWD:/data -it nikisweeting/archivebox manage createsuperuser docker run -v $PWD:/data -it nikisweeting/archivebox manage createsuperuser
docker run -v $PWD:/data -p 8000:8000 nikisweeting/archivebox server 0.0.0.0:8000 docker run -v $PWD:/data -it -p 8000:8000 nikisweeting/archivebox server 0.0.0.0:8000
open http://127.0.0.1:8000 open http://127.0.0.1:8000
``` ```

View file

@ -840,10 +840,10 @@ def check_dependencies(config: ConfigDict=CONFIG, show_help: bool=True) -> None:
info['version'] or 'unable to detect version', info['version'] or 'unable to detect version',
) )
) )
# if dependency in ("SINGLEFILE_BINARY", "READABILITY_BINARY"): if dependency in ('SINGLEFILE_BINARY', 'READABILITY_BINARY'):
# hint(('npm install --prefix . "git+https://github.com/pirate/ArchiveBox.git"', hint(('npm install --prefix . "git+https://github.com/piratee/ArchiveBox.git"',
# f'or set SAVE_{dependency.rsplit("_", 1)[0]}=False to silence this warning', f'or set SAVE_{dependency.rsplit("_", 1)[0]}=False to silence this warning',
# '')) ''), prefix=' ')
stderr('') stderr('')
if config['TIMEOUT'] < 5: if config['TIMEOUT'] < 5:

View file

@ -99,15 +99,18 @@ class TimedProgress:
if self.SHOW_PROGRESS: if self.SHOW_PROGRESS:
# terminate if we havent already terminated # terminate if we havent already terminated
self.p.terminate()
self.p.join()
self.p.close()
# clear whole terminal line
try: try:
sys.stdout.write('\r{}{}\r'.format((' ' * TERM_WIDTH()), ANSI['reset'])) self.p.terminate()
except (IOError, BrokenPipeError): self.p.join()
# ignore when the parent proc has stopped listening to our stdout self.p.close()
# clear whole terminal line
try:
sys.stdout.write('\r{}{}\r'.format((' ' * TERM_WIDTH()), ANSI['reset']))
except (IOError, BrokenPipeError):
# ignore when the parent proc has stopped listening to our stdout
pass
except ValueError:
pass pass

View file

@ -31,7 +31,7 @@ services:
# host machine, add tasks and see more info with archivebox schedule --help # host machine, add tasks and see more info with archivebox schedule --help
# scheduler: # scheduler:
# image: nikisweeting/archivebox:latest # image: nikisweeting/archivebox:latest
# command: schedule --foreground --every=day --depth=1 'https://getpocket.com/users/USERNA<E/feed/all' # command: schedule --foreground --every=day --depth=1 'https://getpocket.com/users/USERNAME/feed/all'
# environment: # environment:
# - USE_COLOR=True # - USE_COLOR=True
# - SHOW_PROGRESS=False # - SHOW_PROGRESS=False