diff --git a/README.md b/README.md index 04888b5b..8619b3a6 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ click `[-]` and `[+]` to adjust the size, and the `[a]` toggles if the tree shou ## thumbnails -![copyparty-thumbs-fs8](https://user-images.githubusercontent.com/241032/119577189-6d490200-bdba-11eb-81a6-7b2ef7bc1128.png) +![copyparty-thumbs-fs8](https://user-images.githubusercontent.com/241032/120070302-10836b00-c08a-11eb-8eb4-82004a34c342.png) it does static images with Pillow and uses FFmpeg for video files, so you may want to `--no-thumb` or maybe just `--no-vthumb` depending on how destructive your users are diff --git a/copyparty/__version__.py b/copyparty/__version__.py index 1e826ddd..2751922c 100644 --- a/copyparty/__version__.py +++ b/copyparty/__version__.py @@ -1,8 +1,8 @@ # coding: utf-8 -VERSION = (0, 10, 22) -CODENAME = "zip it" -BUILD_DT = (2021, 5, 18) +VERSION = (0, 11, 0) +CODENAME = "the grid" +BUILD_DT = (2021, 5, 29) S_VERSION = ".".join(map(str, VERSION)) S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT) diff --git a/copyparty/mtag.py b/copyparty/mtag.py index 8079ce4a..6a5d272b 100644 --- a/copyparty/mtag.py +++ b/copyparty/mtag.py @@ -243,8 +243,10 @@ class MTag(object): self.log(msg, c=1) if not self.usable: - msg = "need mutagen{} to read media tags so please run this:\n {} -m pip install --user mutagen" - self.log(msg.format(or_ffprobe, os.path.basename(sys.executable)), c=1) + msg = "need mutagen{} to read media tags so please run this:\n{}{} -m pip install --user mutagen\n" + self.log( + msg.format(or_ffprobe, " " * 37, os.path.basename(sys.executable)), c=1 + ) return # https://picard-docs.musicbrainz.org/downloads/MusicBrainz_Picard_Tag_Map.html diff --git a/copyparty/svchub.py b/copyparty/svchub.py index c2b192cf..d4c53146 100644 --- a/copyparty/svchub.py +++ b/copyparty/svchub.py @@ -54,8 +54,10 @@ class SvcHub(object): self.thumbsrv = ThumbSrv(self, auth.vfs.all_vols) else: - msg = "need Pillow to create thumbnails; for example:\n {} -m pip install --user Pillow" - self.log("thumb", msg.format(os.path.basename(sys.executable)), c=3) + msg = "need Pillow to create thumbnails; for example:\n{}{} -m pip install --user Pillow\n" + self.log( + "thumb", msg.format(" " * 37, os.path.basename(sys.executable)), c=3 + ) # decide which worker impl to use if self.check_mp_enable(): diff --git a/copyparty/th_srv.py b/copyparty/th_srv.py index c28d2e83..cfead02d 100644 --- a/copyparty/th_srv.py +++ b/copyparty/th_srv.py @@ -119,10 +119,6 @@ class ThumbSrv(object): t.daemon = True t.start() - if not HAVE_PIL: - msg = "need Pillow to create thumbnails so please run this:\n {} -m pip install --user Pillow" - self.log(msg.format(os.path.basename(sys.executable)), c=1) - if not self.args.no_vthumb and (not HAVE_FFMPEG or not HAVE_FFPROBE): missing = [] if not HAVE_FFMPEG: @@ -131,7 +127,7 @@ class ThumbSrv(object): if not HAVE_FFPROBE: missing.append("ffprobe") - msg = "cannot create video thumbnails since some of the required programs are not available: " + msg = "cannot create video thumbnails because some of the required programs are not available: " msg += ", ".join(missing) self.log(msg, c=1) @@ -299,7 +295,7 @@ class ThumbSrv(object): cmd += [fsenc(tpath)] - mchkcmd(*cmd) + mchkcmd(cmd) def poke(self, tdir): if not self.poke_cd.poke(tdir): diff --git a/copyparty/util.py b/copyparty/util.py index 697aa5b6..6eca8f7e 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -985,7 +985,7 @@ def chkcmd(*argv): return sout, serr -def mchkcmd(*argv, timeout=10): +def mchkcmd(argv, timeout=10): if PY2: with open(os.devnull, "wb") as f: rv = sp.call(argv, stdout=f, stderr=f) diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 26208802..53aff15f 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -199,14 +199,21 @@ html.light #ggrid a.sel { #ggrid a.sel:hover, html.light #ggrid a.sel:hover { color: #fff; - background: #a36; + background: #d39; border-color: #d48; text-shadow: 1px 1px 0 #804; } -#ggrid a.sel { - box-shadow: 0 .1em .7em #b36; +#ggrid a.sel, +html.light #ggrid a.sel { + border-top: 1px solid #d48; + box-shadow: 0 .1em 1.2em #b36; transition: all 0.2s cubic-bezier(.2, 2.2, .5, 1); /* https://cubic-bezier.com/#.4,2,.7,1 */ } +#ggrid a.sel img { + opacity: .7; + box-shadow: 0 0 1em #b36; + filter: contrast(130%) brightness(107%); +} #files tr.sel a { color: #fff; } @@ -772,7 +779,7 @@ html.light #ghead { #ggrid a img { border-radius: .2em; max-width: var(--grid-sz); - max-height: var(--grid-sz); + max-height: calc(var(--grid-sz)/1.25); margin: 0 auto; display: block; } diff --git a/setup.py b/setup.py index a0dda08a..4f60e992 100755 --- a/setup.py +++ b/setup.py @@ -5,22 +5,7 @@ from __future__ import print_function import os import sys from shutil import rmtree - -setuptools_available = True -try: - # need setuptools to build wheel - from setuptools import setup, Command, find_packages - -except ImportError: - # works in a pinch - setuptools_available = False - from distutils.core import setup, Command - -from distutils.spawn import spawn - -if "bdist_wheel" in sys.argv and not setuptools_available: - print("cannot build wheel without setuptools") - sys.exit(1) +from setuptools import setup, Command, find_packages NAME = "copyparty" @@ -100,9 +85,8 @@ args = { "author_email": "copyparty@ocv.me", "url": "https://github.com/9001/copyparty", "license": "MIT", - "data_files": data_files, "classifiers": [ - "Development Status :: 3 - Alpha", + "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", @@ -120,35 +104,16 @@ args = { "Environment :: Console", "Environment :: No Input/Output (Daemon)", "Topic :: Communications :: File Sharing", + "Topic :: Internet :: WWW/HTTP :: HTTP Servers", ], + "include_package_data": True, + "data_files": data_files, + "packages": find_packages(), + "install_requires": ["jinja2"], + "extras_require": {"thumbnails": ["Pillow"], "audiotags": ["mutagen"]}, + "entry_points": {"console_scripts": ["copyparty = copyparty.__main__:main"]}, + "scripts": ["bin/copyparty-fuse.py"], "cmdclass": {"clean2": clean2}, } - -if setuptools_available: - args.update( - { - "packages": find_packages(), - "install_requires": ["jinja2"], - "extras_require": {"thumbnails": ["Pillow"]}, - "include_package_data": True, - "entry_points": { - "console_scripts": ["copyparty = copyparty.__main__:main"] - }, - "scripts": ["bin/copyparty-fuse.py"], - } - ) -else: - args.update( - { - "packages": ["copyparty", "copyparty.stolen"], - "scripts": ["bin/copyparty-fuse.py"], - } - ) - - -# import pprint -# pprint.PrettyPrinter().pprint(args) -# sys.exit(0) - setup(**args)