copyparty 1.16.5__py3-none-any.whl → 1.16.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- copyparty/__init__.py +3 -0
- copyparty/__main__.py +4 -1
- copyparty/__version__.py +2 -2
- copyparty/authsrv.py +33 -20
- copyparty/fsutil.py +4 -4
- copyparty/httpcli.py +273 -83
- copyparty/httpsrv.py +6 -9
- copyparty/mtag.py +4 -4
- copyparty/smbd.py +1 -1
- copyparty/sutil.py +1 -1
- copyparty/tcpsrv.py +3 -3
- copyparty/tftpd.py +1 -1
- copyparty/th_cli.py +3 -3
- copyparty/th_srv.py +6 -6
- copyparty/u2idx.py +3 -3
- copyparty/up2k.py +92 -87
- copyparty/util.py +13 -13
- copyparty/web/a/u2c.py +1 -1
- copyparty/web/browser.html +1 -1
- copyparty/web/browser.js.gz +0 -0
- copyparty/web/md.html +2 -2
- copyparty/web/mde.html +2 -2
- copyparty/web/rups.css.gz +0 -0
- copyparty/web/rups.html +50 -0
- copyparty/web/rups.js.gz +0 -0
- copyparty/web/shares.css.gz +0 -0
- copyparty/web/shares.html +6 -3
- copyparty/web/splash.html +2 -1
- copyparty/web/splash.js.gz +0 -0
- copyparty/web/svcs.html +1 -1
- copyparty/web/up2k.js.gz +0 -0
- copyparty/web/util.js.gz +0 -0
- {copyparty-1.16.5.dist-info → copyparty-1.16.7.dist-info}/METADATA +14 -2
- {copyparty-1.16.5.dist-info → copyparty-1.16.7.dist-info}/RECORD +38 -35
- {copyparty-1.16.5.dist-info → copyparty-1.16.7.dist-info}/LICENSE +0 -0
- {copyparty-1.16.5.dist-info → copyparty-1.16.7.dist-info}/WHEEL +0 -0
- {copyparty-1.16.5.dist-info → copyparty-1.16.7.dist-info}/entry_points.txt +0 -0
- {copyparty-1.16.5.dist-info → copyparty-1.16.7.dist-info}/top_level.txt +0 -0
    
        copyparty/httpsrv.py
    CHANGED
    
    | @@ -168,15 +168,16 @@ class HttpSrv(object): | |
| 168 168 | 
             
                    env = jinja2.Environment()
         | 
| 169 169 | 
             
                    env.loader = jinja2.FunctionLoader(lambda f: load_jinja2_resource(self.E, f))
         | 
| 170 170 | 
             
                    jn = [
         | 
| 171 | 
            -
                        "splash",
         | 
| 172 | 
            -
                        "shares",
         | 
| 173 | 
            -
                        "svcs",
         | 
| 174 171 | 
             
                        "browser",
         | 
| 175 172 | 
             
                        "browser2",
         | 
| 176 | 
            -
                        " | 
| 173 | 
            +
                        "cf",
         | 
| 177 174 | 
             
                        "md",
         | 
| 178 175 | 
             
                        "mde",
         | 
| 179 | 
            -
                        " | 
| 176 | 
            +
                        "msg",
         | 
| 177 | 
            +
                        "rups",
         | 
| 178 | 
            +
                        "shares",
         | 
| 179 | 
            +
                        "splash",
         | 
| 180 | 
            +
                        "svcs",
         | 
| 180 181 | 
             
                    ]
         | 
| 181 182 | 
             
                    self.j2 = {x: env.get_template(x + ".html") for x in jn}
         | 
| 182 183 | 
             
                    self.prism = has_resource(self.E, "web/deps/prism.js.gz")
         | 
| @@ -190,10 +191,6 @@ class HttpSrv(object): | |
| 190 191 | 
             
                    self.xff_nm = build_netmap(self.args.xff_src)
         | 
| 191 192 | 
             
                    self.xff_lan = build_netmap("lan")
         | 
| 192 193 |  | 
| 193 | 
            -
                    self.ptn_cc = re.compile(r"[\x00-\x1f]")
         | 
| 194 | 
            -
                    self.ptn_hsafe = re.compile(r"[\x00-\x1f<>\"'&]")
         | 
| 195 | 
            -
                    self.uparam_cc_ok = set("doc move tree".split())
         | 
| 196 | 
            -
             | 
| 197 194 | 
             
                    self.mallow = "GET HEAD POST PUT DELETE OPTIONS".split()
         | 
| 198 195 | 
             
                    if not self.args.no_dav:
         | 
| 199 196 | 
             
                        zs = "PROPFIND PROPPATCH LOCK UNLOCK MKCOL COPY MOVE"
         | 
    
        copyparty/mtag.py
    CHANGED
    
    | @@ -188,7 +188,7 @@ def au_unpk( | |
| 188 188 |  | 
| 189 189 | 
             
                except Exception as ex:
         | 
| 190 190 | 
             
                    if ret:
         | 
| 191 | 
            -
                        t = "failed to decompress audio file  | 
| 191 | 
            +
                        t = "failed to decompress audio file %r: %r"
         | 
| 192 192 | 
             
                        log(t % (abspath, ex))
         | 
| 193 193 | 
             
                        wunlink(log, ret, vn.flags if vn else VF_CAREFUL)
         | 
| 194 194 |  | 
| @@ -576,7 +576,7 @@ class MTag(object): | |
| 576 576 | 
             
                            raise Exception()
         | 
| 577 577 | 
             
                    except Exception as ex:
         | 
| 578 578 | 
             
                        if self.args.mtag_v:
         | 
| 579 | 
            -
                            self.log("mutagen-err [ | 
| 579 | 
            +
                            self.log("mutagen-err [%s] @ %r" % (ex, abspath), "90")
         | 
| 580 580 |  | 
| 581 581 | 
             
                        return self.get_ffprobe(abspath) if self.can_ffprobe else {}
         | 
| 582 582 |  | 
| @@ -693,8 +693,8 @@ class MTag(object): | |
| 693 693 | 
             
                                        ret[tag] = zj[tag]
         | 
| 694 694 | 
             
                        except:
         | 
| 695 695 | 
             
                            if self.args.mtag_v:
         | 
| 696 | 
            -
                                t = "mtag error: tagname  | 
| 697 | 
            -
                                self.log(t | 
| 696 | 
            +
                                t = "mtag error: tagname %r, parser %r, file %r => %r"
         | 
| 697 | 
            +
                                self.log(t % (tagname, parser.bin, abspath, min_ex()), 6)
         | 
| 698 698 |  | 
| 699 699 | 
             
                    if ap != abspath:
         | 
| 700 700 | 
             
                        wunlink(self.log, ap, VF_CAREFUL)
         | 
    
        copyparty/smbd.py
    CHANGED
    
    
    
        copyparty/sutil.py
    CHANGED
    
    | @@ -104,7 +104,7 @@ def errdesc( | |
| 104 104 | 
             
                report = ["copyparty failed to add the following files to the archive:", ""]
         | 
| 105 105 |  | 
| 106 106 | 
             
                for fn, err in errors:
         | 
| 107 | 
            -
                    report.extend([" file:  | 
| 107 | 
            +
                    report.extend([" file: %r" % (fn,), "error: %s" % (err,), ""])
         | 
| 108 108 |  | 
| 109 109 | 
             
                btxt = "\r\n".join(report).encode("utf-8", "replace")
         | 
| 110 110 | 
             
                btxt = vol_san(list(vfs.all_vols.values()), btxt)
         | 
    
        copyparty/tcpsrv.py
    CHANGED
    
    | @@ -403,12 +403,12 @@ class TcpSrv(object): | |
| 403 403 | 
             
                        rem = []
         | 
| 404 404 | 
             
                        for k, v in netdevs.items():
         | 
| 405 405 | 
             
                            if k not in self.netdevs:
         | 
| 406 | 
            -
                                add.append("\n  added %s = %s" % (k, v))
         | 
| 406 | 
            +
                                add.append("\n\033[32m  added %s = %s" % (k, v))
         | 
| 407 407 | 
             
                        for k, v in self.netdevs.items():
         | 
| 408 408 | 
             
                            if k not in netdevs:
         | 
| 409 | 
            -
                                rem.append("\ | 
| 409 | 
            +
                                rem.append("\n\033[33mremoved %s = %s" % (k, v))
         | 
| 410 410 |  | 
| 411 | 
            -
                        t = "network change detected | 
| 411 | 
            +
                        t = "network change detected:%s%s"
         | 
| 412 412 | 
             
                        self.log("tcpsrv", t % ("".join(add), "".join(rem)), 3)
         | 
| 413 413 | 
             
                        self.netdevs = netdevs
         | 
| 414 414 | 
             
                        self._distribute_netdevs()
         | 
    
        copyparty/tftpd.py
    CHANGED
    
    | @@ -354,7 +354,7 @@ class Tftpd(object): | |
| 354 354 | 
             
                            time.time(),
         | 
| 355 355 | 
             
                            "",
         | 
| 356 356 | 
             
                        ):
         | 
| 357 | 
            -
                            yeet("blocked by xbu server config: "  | 
| 357 | 
            +
                            yeet("blocked by xbu server config: %r" % (vpath,))
         | 
| 358 358 |  | 
| 359 359 | 
             
                    if not self.args.tftp_nols and bos.path.isdir(ap):
         | 
| 360 360 | 
             
                        return self._ls(vpath, "", 0, True)
         | 
    
        copyparty/th_cli.py
    CHANGED
    
    | @@ -106,13 +106,13 @@ class ThumbCli(object): | |
| 106 106 | 
             
                        fmt = sfmt
         | 
| 107 107 |  | 
| 108 108 | 
             
                    elif fmt[:1] == "p" and not is_au and not is_vid:
         | 
| 109 | 
            -
                        t = "cannot thumbnail  | 
| 110 | 
            -
                        self.log(t % (rem), 6)
         | 
| 109 | 
            +
                        t = "cannot thumbnail %r: png only allowed for waveforms"
         | 
| 110 | 
            +
                        self.log(t % (rem,), 6)
         | 
| 111 111 | 
             
                        return None
         | 
| 112 112 |  | 
| 113 113 | 
             
                    histpath = self.asrv.vfs.histtab.get(ptop)
         | 
| 114 114 | 
             
                    if not histpath:
         | 
| 115 | 
            -
                        self.log("no histpath for  | 
| 115 | 
            +
                        self.log("no histpath for %r" % (ptop,))
         | 
| 116 116 | 
             
                        return None
         | 
| 117 117 |  | 
| 118 118 | 
             
                    tpath = thumb_path(histpath, rem, mtime, fmt, self.fmt_ffa)
         | 
    
        copyparty/th_srv.py
    CHANGED
    
    | @@ -236,7 +236,7 @@ class ThumbSrv(object): | |
| 236 236 | 
             
                def get(self, ptop , rem , mtime , fmt )  :
         | 
| 237 237 | 
             
                    histpath = self.asrv.vfs.histtab.get(ptop)
         | 
| 238 238 | 
             
                    if not histpath:
         | 
| 239 | 
            -
                        self.log("no histpath for  | 
| 239 | 
            +
                        self.log("no histpath for %r" % (ptop,))
         | 
| 240 240 | 
             
                        return None
         | 
| 241 241 |  | 
| 242 242 | 
             
                    tpath = thumb_path(histpath, rem, mtime, fmt, self.fmt_ffa)
         | 
| @@ -246,7 +246,7 @@ class ThumbSrv(object): | |
| 246 246 | 
             
                    with self.mutex:
         | 
| 247 247 | 
             
                        try:
         | 
| 248 248 | 
             
                            self.busy[tpath].append(cond)
         | 
| 249 | 
            -
                            self.log("joined waiting room for % | 
| 249 | 
            +
                            self.log("joined waiting room for %r" % (tpath,))
         | 
| 250 250 | 
             
                        except:
         | 
| 251 251 | 
             
                            thdir = os.path.dirname(tpath)
         | 
| 252 252 | 
             
                            bos.makedirs(os.path.join(thdir, "w"))
         | 
| @@ -263,11 +263,11 @@ class ThumbSrv(object): | |
| 263 263 | 
             
                        allvols = list(self.asrv.vfs.all_vols.values())
         | 
| 264 264 | 
             
                        vn = next((x for x in allvols if x.realpath == ptop), None)
         | 
| 265 265 | 
             
                        if not vn:
         | 
| 266 | 
            -
                            self.log("ptop  | 
| 266 | 
            +
                            self.log("ptop %r not in %s" % (ptop, allvols), 3)
         | 
| 267 267 | 
             
                            vn = self.asrv.vfs.all_aps[0][1]
         | 
| 268 268 |  | 
| 269 269 | 
             
                        self.q.put((abspath, tpath, fmt, vn))
         | 
| 270 | 
            -
                        self.log("conv  | 
| 270 | 
            +
                        self.log("conv %r :%s \033[0m%r" % (tpath, fmt, abspath), 6)
         | 
| 271 271 |  | 
| 272 272 | 
             
                    while not self.stopping:
         | 
| 273 273 | 
             
                        with self.mutex:
         | 
| @@ -372,8 +372,8 @@ class ThumbSrv(object): | |
| 372 372 | 
             
                                fun(ap_unpk, ttpath, fmt, vn)
         | 
| 373 373 | 
             
                                break
         | 
| 374 374 | 
             
                            except Exception as ex:
         | 
| 375 | 
            -
                                msg = " | 
| 376 | 
            -
                                msg = msg | 
| 375 | 
            +
                                msg = "%s could not create thumbnail of %r\n%s"
         | 
| 376 | 
            +
                                msg = msg % (fun.__name__, abspath, min_ex())
         | 
| 377 377 | 
             
                                c   = 1 if "<Signals.SIG" in msg else "90"
         | 
| 378 378 | 
             
                                self.log(msg, c)
         | 
| 379 379 | 
             
                                if getattr(ex, "returncode", 0) != 321:
         | 
    
        copyparty/u2idx.py
    CHANGED
    
    | @@ -130,7 +130,7 @@ class U2idx(object): | |
| 130 130 | 
             
                    ptop = vn.realpath
         | 
| 131 131 | 
             
                    histpath = self.asrv.vfs.histtab.get(ptop)
         | 
| 132 132 | 
             
                    if not histpath:
         | 
| 133 | 
            -
                        self.log("no histpath for  | 
| 133 | 
            +
                        self.log("no histpath for %r" % (ptop,))
         | 
| 134 134 | 
             
                        return None
         | 
| 135 135 |  | 
| 136 136 | 
             
                    db_path = os.path.join(histpath, "up2k.db")
         | 
| @@ -145,7 +145,7 @@ class U2idx(object): | |
| 145 145 | 
             
                            db = sqlite3.connect(uri, timeout=2, uri=True, check_same_thread=False)
         | 
| 146 146 | 
             
                            cur = db.cursor()
         | 
| 147 147 | 
             
                            cur.execute('pragma table_info("up")').fetchone()
         | 
| 148 | 
            -
                            self.log("ro:  | 
| 148 | 
            +
                            self.log("ro: %r" % (db_path,))
         | 
| 149 149 | 
             
                        except:
         | 
| 150 150 | 
             
                            self.log("could not open read-only: {}\n{}".format(uri, min_ex()))
         | 
| 151 151 | 
             
                            # may not fail until the pragma so unset it
         | 
| @@ -155,7 +155,7 @@ class U2idx(object): | |
| 155 155 | 
             
                        # on windows, this steals the write-lock from up2k.deferred_init --
         | 
| 156 156 | 
             
                        # seen on win 10.0.17763.2686, py 3.10.4, sqlite 3.37.2
         | 
| 157 157 | 
             
                        cur = sqlite3.connect(db_path, timeout=2, check_same_thread=False).cursor()
         | 
| 158 | 
            -
                        self.log("opened  | 
| 158 | 
            +
                        self.log("opened %r" % (db_path,))
         | 
| 159 159 |  | 
| 160 160 | 
             
                    self.cur[ptop] = cur
         | 
| 161 161 | 
             
                    return cur
         |