Skip to content

Commit

Permalink
v0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
9001 committed May 29, 2021
1 parent d8fd82b commit eb5aadd
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 64 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions copyparty/__version__.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
6 changes: 4 additions & 2 deletions copyparty/mtag.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,10 @@ def __init__(self, log_func, args):
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
Expand Down
6 changes: 4 additions & 2 deletions copyparty/svchub.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ def __init__(self, args):

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():
Expand Down
8 changes: 2 additions & 6 deletions copyparty/th_srv.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ def __init__(self, hub, vols):
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:
Expand All @@ -131,7 +127,7 @@ def __init__(self, hub, vols):
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)

Expand Down Expand Up @@ -299,7 +295,7 @@ def conv_ffmpeg(self, abspath, tpath):

cmd += [fsenc(tpath)]

mchkcmd(*cmd)
mchkcmd(cmd)

def poke(self, tdir):
if not self.poke_cd.poke(tdir):
Expand Down
2 changes: 1 addition & 1 deletion copyparty/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 11 additions & 4 deletions copyparty/web/browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
55 changes: 10 additions & 45 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,7 @@
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"
Expand Down Expand Up @@ -100,9 +85,8 @@ def run(self):
"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",
Expand All @@ -120,35 +104,16 @@ def run(self):
"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)

0 comments on commit eb5aadd

Please sign in to comment.