fix mojibake (...and py2.7)

This commit is contained in:
ed 2019-07-02 21:25:54 +00:00
parent 7d4844c6dd
commit 1b43ed9432
7 changed files with 13 additions and 14 deletions

View file

@ -110,7 +110,7 @@ class BrokerMp(object):
obj = getattr(obj, node)
# TODO will deadlock if dest performs another ipc
rv = try_exec(obj, *args, want_retval=retq_id)
rv = try_exec(retq_id, obj, *args)
if retq_id:
proc.q_pend.put([retq_id, "retq", rv])

View file

@ -1,4 +1,3 @@
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function, unicode_literals
@ -39,7 +38,7 @@ class BrokerThr(object):
obj = getattr(obj, node)
# TODO will deadlock if dest performs another ipc
rv = try_exec(obj, *args, want_retval=want_retval)
rv = try_exec(want_retval, obj, *args)
if not want_retval:
return

View file

@ -13,7 +13,7 @@ else:
from Queue import Queue # pylint: disable=import-error,no-name-in-module
class ExceptionalQueue(Queue):
class ExceptionalQueue(Queue, object):
def get(self, block=True, timeout=None):
rv = super(ExceptionalQueue, self).get(block, timeout)
@ -28,7 +28,7 @@ class ExceptionalQueue(Queue):
return rv
def try_exec(func, *args, want_retval=False):
def try_exec(want_retval, func, *args):
try:
return func(*args)

View file

@ -633,8 +633,8 @@ class HttpCli(object):
logues = [None, None]
for n, fn in enumerate([".prologue.html", ".epilogue.html"]):
fn = os.path.join(abspath, fn)
if os.path.exists(fn):
with open(fn, "rb") as f:
if os.path.exists(fsenc(fn)):
with open(fsenc(fn), "rb") as f:
logues[n] = f.read().decode("utf-8")
ts = ""

View file

@ -114,7 +114,9 @@ class Up2k(object):
raise Pebkac(400, "at least one hash is not according to spec")
# server-reproducible file identifier, independent of name or location
ident = "\n".join([self.salt, str(cj["size"]), *cj["hash"]])
ident = [self.salt, str(cj["size"])]
ident.extend(cj["hash"])
ident = "\n".join(ident)
hasher = hashlib.sha512()
hasher.update(ident.encode("utf-8"))

View file

@ -164,12 +164,10 @@ function up2k_init(have_crypto) {
var parallel_uploads = cfg('nthread');
var col_hashing = '#0099ff'; //'#d7d7d7';
//var col_hashed = '#e8a6df'; //'#decb7f';
//var col_hashed = '#0099ff';
var col_hashed = '#eeeeee';
var col_hashing = '#0099ff';
var col_hashed = '#004466';
var col_uploading = '#ffcc44';
var col_uploaded = '#00cc00';
var col_uploaded = '#00bb00';
var fdom_ctr = 0;
var st = {
"files": [],

View file

@ -137,7 +137,7 @@
padding: 0;
height: 1.1em;
margin-bottom: -.15em;
box-shadow: -.1em -.1em .2em inset rgba(0,0,0,0.2);
box-shadow: -1px -1px 0 inset rgba(255,255,255,0.1);
}
.prog>div>div {
width: 0%;