This commit is contained in:
ed 2021-05-29 15:03:32 +02:00
parent d8fd82bcb5
commit eb5aaddba4
8 changed files with 36 additions and 64 deletions

View file

@ -172,7 +172,7 @@ click `[-]` and `[+]` to adjust the size, and the `[a]` toggles if the tree shou
## thumbnails ## 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 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

View file

@ -1,8 +1,8 @@
# coding: utf-8 # coding: utf-8
VERSION = (0, 10, 22) VERSION = (0, 11, 0)
CODENAME = "zip it" CODENAME = "the grid"
BUILD_DT = (2021, 5, 18) BUILD_DT = (2021, 5, 29)
S_VERSION = ".".join(map(str, VERSION)) S_VERSION = ".".join(map(str, VERSION))
S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT) S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT)

View file

@ -243,8 +243,10 @@ class MTag(object):
self.log(msg, c=1) self.log(msg, c=1)
if not self.usable: if not self.usable:
msg = "need mutagen{} to read media tags so please run this:\n {} -m pip install --user mutagen" msg = "need mutagen{} to read media tags so please run this:\n{}{} -m pip install --user mutagen\n"
self.log(msg.format(or_ffprobe, os.path.basename(sys.executable)), c=1) self.log(
msg.format(or_ffprobe, " " * 37, os.path.basename(sys.executable)), c=1
)
return return
# https://picard-docs.musicbrainz.org/downloads/MusicBrainz_Picard_Tag_Map.html # https://picard-docs.musicbrainz.org/downloads/MusicBrainz_Picard_Tag_Map.html

View file

@ -54,8 +54,10 @@ class SvcHub(object):
self.thumbsrv = ThumbSrv(self, auth.vfs.all_vols) self.thumbsrv = ThumbSrv(self, auth.vfs.all_vols)
else: else:
msg = "need Pillow to create thumbnails; for example:\n {} -m pip install --user Pillow" msg = "need Pillow to create thumbnails; for example:\n{}{} -m pip install --user Pillow\n"
self.log("thumb", msg.format(os.path.basename(sys.executable)), c=3) self.log(
"thumb", msg.format(" " * 37, os.path.basename(sys.executable)), c=3
)
# decide which worker impl to use # decide which worker impl to use
if self.check_mp_enable(): if self.check_mp_enable():

View file

@ -119,10 +119,6 @@ class ThumbSrv(object):
t.daemon = True t.daemon = True
t.start() 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): if not self.args.no_vthumb and (not HAVE_FFMPEG or not HAVE_FFPROBE):
missing = [] missing = []
if not HAVE_FFMPEG: if not HAVE_FFMPEG:
@ -131,7 +127,7 @@ class ThumbSrv(object):
if not HAVE_FFPROBE: if not HAVE_FFPROBE:
missing.append("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) msg += ", ".join(missing)
self.log(msg, c=1) self.log(msg, c=1)
@ -299,7 +295,7 @@ class ThumbSrv(object):
cmd += [fsenc(tpath)] cmd += [fsenc(tpath)]
mchkcmd(*cmd) mchkcmd(cmd)
def poke(self, tdir): def poke(self, tdir):
if not self.poke_cd.poke(tdir): if not self.poke_cd.poke(tdir):

View file

@ -985,7 +985,7 @@ def chkcmd(*argv):
return sout, serr return sout, serr
def mchkcmd(*argv, timeout=10): def mchkcmd(argv, timeout=10):
if PY2: if PY2:
with open(os.devnull, "wb") as f: with open(os.devnull, "wb") as f:
rv = sp.call(argv, stdout=f, stderr=f) rv = sp.call(argv, stdout=f, stderr=f)

View file

@ -199,14 +199,21 @@ html.light #ggrid a.sel {
#ggrid a.sel:hover, #ggrid a.sel:hover,
html.light #ggrid a.sel:hover { html.light #ggrid a.sel:hover {
color: #fff; color: #fff;
background: #a36; background: #d39;
border-color: #d48; border-color: #d48;
text-shadow: 1px 1px 0 #804; text-shadow: 1px 1px 0 #804;
} }
#ggrid a.sel { #ggrid a.sel,
box-shadow: 0 .1em .7em #b36; 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 */ 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 { #files tr.sel a {
color: #fff; color: #fff;
} }
@ -772,7 +779,7 @@ html.light #ghead {
#ggrid a img { #ggrid a img {
border-radius: .2em; border-radius: .2em;
max-width: var(--grid-sz); max-width: var(--grid-sz);
max-height: var(--grid-sz); max-height: calc(var(--grid-sz)/1.25);
margin: 0 auto; margin: 0 auto;
display: block; display: block;
} }

View file

@ -5,22 +5,7 @@ from __future__ import print_function
import os import os
import sys import sys
from shutil import rmtree from shutil import rmtree
from setuptools import setup, Command, find_packages
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)
NAME = "copyparty" NAME = "copyparty"
@ -100,9 +85,8 @@ args = {
"author_email": "copyparty@ocv.me", "author_email": "copyparty@ocv.me",
"url": "https://github.com/9001/copyparty", "url": "https://github.com/9001/copyparty",
"license": "MIT", "license": "MIT",
"data_files": data_files,
"classifiers": [ "classifiers": [
"Development Status :: 3 - Alpha", "Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License", "License :: OSI Approved :: MIT License",
"Programming Language :: Python", "Programming Language :: Python",
"Programming Language :: Python :: 2", "Programming Language :: Python :: 2",
@ -120,35 +104,16 @@ args = {
"Environment :: Console", "Environment :: Console",
"Environment :: No Input/Output (Daemon)", "Environment :: No Input/Output (Daemon)",
"Topic :: Communications :: File Sharing", "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}, "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) setup(**args)