From eed82dbb541e29027bc80443607a3a72da58b637 Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 21 Apr 2021 18:44:47 +0200 Subject: [PATCH] remove dead code --- copyparty/up2k.py | 12 ------------ copyparty/web/up2k.js | 36 ------------------------------------ 2 files changed, 48 deletions(-) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index 236beb26..6ede618b 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -668,12 +668,6 @@ class Up2k(object): cur.close() def _start_mpool(self): - if WINDOWS and False: - nah = open(os.devnull, "wb") - wmic = "processid={}".format(os.getpid()) - wmic = ["wmic", "process", "where", wmic, "call", "setpriority"] - sp.call(wmic + ["below normal"], stdout=nah, stderr=nah) - # mp.pool.ThreadPool and concurrent.futures.ThreadPoolExecutor # both do crazy runahead so lets reinvent another wheel nw = os.cpu_count() if hasattr(os, "cpu_count") else 4 @@ -698,12 +692,6 @@ class Up2k(object): mpool.join() done = self._flush_mpool(wcur) - if WINDOWS and False: - nah = open(os.devnull, "wb") - wmic = "processid={}".format(os.getpid()) - wmic = ["wmic", "process", "where", wmic, "call", "setpriority"] - sp.call(wmic + ["below normal"], stdout=nah, stderr=nah) - return done def _tag_thr(self, q): diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index 9bb5be1e..530a9b90 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -287,15 +287,6 @@ function U2pvis(act, btns) { } }; - this.bzw_log = function (first, last) { - console.log("first %d head %d tail %d last %d", first, this.head, this.tail, last); - var trs = document.querySelectorAll('#u2tab>tbody>tr'), msg = []; - for (var a = 0; a < trs.length; a++) - msg.push(trs[a].getAttribute('id')); - - console.log(msg.join(' ')); - } - this.bzw = function () { var first = document.querySelector('#u2tab>tbody>tr:first-child'); if (!first) @@ -304,7 +295,6 @@ function U2pvis(act, btns) { var last = document.querySelector('#u2tab>tbody>tr:last-child'); first = parseInt(first.getAttribute('id').slice(1)); last = parseInt(last.getAttribute('id').slice(1)); - //this.bzw_log(first, last); while (this.head - first > this.wsz) { var obj = ebi('f' + (first++)); @@ -315,8 +305,6 @@ function U2pvis(act, btns) { if (!obj) this.addrow(last); } - //this.bzw_log(first, last); - //console.log('--'); }; this.drawcard = function (cat) { @@ -758,17 +746,6 @@ function up2k_init(have_crypto) { mutex = true; while (true) { - if (false) { - ebi('srv_info').innerHTML = - new Date().getTime() + ", " + - st.todo.hash.length + ", " + - st.todo.handshake.length + ", " + - st.todo.upload.length + ", " + - st.busy.hash.length + ", " + - st.busy.handshake.length + ", " + - st.busy.upload.length; - } - var is_busy = 0 != st.todo.hash.length + st.todo.handshake.length + @@ -907,19 +884,6 @@ function up2k_init(have_crypto) { } } - function ensure_rendered(func) { - var hidden = false; - var keys = ['hidden', 'msHidden', 'webkitHidden']; - for (var a = 0; a < keys.length; a++) - if (typeof document[keys[a]] !== "undefined") - hidden = document[keys[a]]; - - if (hidden) - return func(); - - window.requestAnimationFrame(func); - } - function exec_hash() { var t = st.todo.hash.shift(); st.busy.hash.push(t);