From ba33edbc3de92615a7c47d3d8216f71a481b69f5 Mon Sep 17 00:00:00 2001 From: mt Date: Thu, 23 Jan 2020 13:24:53 +0100 Subject: [PATCH] Insitu changes --- scanimation/LocalServer.js | 2 + scanimation/package-lock.json | 138 +++++++++++++++--------------- sorteerhoed/central_management.py | 2 +- sorteerhoed/webserver.py | 5 +- www/backend/script.js | 6 +- www/backend/style.css | 10 ++- www/index.html | 4 +- 7 files changed, 87 insertions(+), 80 deletions(-) diff --git a/scanimation/LocalServer.js b/scanimation/LocalServer.js index 76e0151..153056f 100644 --- a/scanimation/LocalServer.js +++ b/scanimation/LocalServer.js @@ -31,6 +31,7 @@ let LocalServer = (config) => { socket.on('animationInit', function(){ fs.readdir(config.frames_folder, (err, files) => { + files = files.filter(file => file.endsWith('.jpg')) socket.emit('frameData', {frames: files}) console.log('starting animation') }) @@ -38,6 +39,7 @@ let LocalServer = (config) => { watch(config.frames_folder, function(e, name){ fs.readdir(config.frames_folder, (err, files) => { + files = files.filter(file => file.endsWith('.jpg')) socket.emit('frameData', {frames: files}) console.log(`frames changed => ${name}`) }) diff --git a/scanimation/package-lock.json b/scanimation/package-lock.json index ccd1873..51f1e1e 100644 --- a/scanimation/package-lock.json +++ b/scanimation/package-lock.json @@ -9,7 +9,7 @@ "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", "requires": { - "mime-types": "~2.1.24", + "mime-types": "2.1.24", "negotiator": "0.6.2" } }, @@ -67,15 +67,15 @@ "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", "requires": { "bytes": "3.1.0", - "content-type": "~1.0.4", + "content-type": "1.0.4", "debug": "2.6.9", - "depd": "~1.1.2", + "depd": "1.1.2", "http-errors": "1.7.2", "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", + "on-finished": "2.3.0", "qs": "6.7.0", "raw-body": "2.4.0", - "type-is": "~1.6.17" + "type-is": "1.6.18" }, "dependencies": { "debug": { @@ -146,7 +146,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" } }, "depd": { @@ -174,12 +174,12 @@ "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.4.0.tgz", "integrity": "sha512-XCyYVWzcHnK5cMz7G4VTu2W7zJS7SM1QkcelghyIk/FmobWBtXE7fwhBusEKvCSqc3bMh8fNFMlUkCKTFRxH2w==", "requires": { - "accepts": "~1.3.4", + "accepts": "1.3.7", "base64id": "2.0.0", "cookie": "0.3.1", - "debug": "~4.1.0", - "engine.io-parser": "~2.2.0", - "ws": "^7.1.2" + "debug": "4.1.1", + "engine.io-parser": "2.2.0", + "ws": "7.1.2" } }, "engine.io-client": { @@ -189,14 +189,14 @@ "requires": { "component-emitter": "1.2.1", "component-inherit": "0.0.3", - "debug": "~4.1.0", - "engine.io-parser": "~2.2.0", + "debug": "4.1.1", + "engine.io-parser": "2.2.0", "has-cors": "1.1.0", "indexof": "0.0.1", "parseqs": "0.0.5", "parseuri": "0.0.5", - "ws": "~6.1.0", - "xmlhttprequest-ssl": "~1.5.4", + "ws": "6.1.4", + "xmlhttprequest-ssl": "1.5.5", "yeast": "0.1.2" }, "dependencies": { @@ -205,7 +205,7 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", "requires": { - "async-limiter": "~1.0.0" + "async-limiter": "1.0.1" } } } @@ -216,10 +216,10 @@ "integrity": "sha512-6I3qD9iUxotsC5HEMuuGsKA0cXerGz+4uGcXQEkfBidgKf0amsjrrtwcbwK/nzpZBxclXlV7gGl9dgWvu4LF6w==", "requires": { "after": "0.8.2", - "arraybuffer.slice": "~0.0.7", + "arraybuffer.slice": "0.0.7", "base64-arraybuffer": "0.1.5", "blob": "0.0.5", - "has-binary2": "~1.0.2" + "has-binary2": "1.0.3" } }, "escape-html": { @@ -237,36 +237,36 @@ "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", "requires": { - "accepts": "~1.3.7", + "accepts": "1.3.7", "array-flatten": "1.1.1", "body-parser": "1.19.0", "content-disposition": "0.5.3", - "content-type": "~1.0.4", + "content-type": "1.0.4", "cookie": "0.4.0", "cookie-signature": "1.0.6", "debug": "2.6.9", - "depd": "~1.1.2", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "~1.1.2", + "depd": "1.1.2", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.1.2", "fresh": "0.5.2", "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.3", "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", + "proxy-addr": "2.0.5", "qs": "6.7.0", - "range-parser": "~1.2.1", + "range-parser": "1.2.1", "safe-buffer": "5.1.2", "send": "0.17.1", "serve-static": "1.14.1", "setprototypeof": "1.1.1", - "statuses": "~1.5.0", - "type-is": "~1.6.18", + "statuses": "1.5.0", + "type-is": "1.6.18", "utils-merge": "1.0.1", - "vary": "~1.1.2" + "vary": "1.1.2" }, "dependencies": { "cookie": { @@ -295,12 +295,12 @@ "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", "requires": { "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.3", + "statuses": "1.5.0", + "unpipe": "1.0.0" }, "dependencies": { "debug": { @@ -346,10 +346,10 @@ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", "requires": { - "depd": "~1.1.2", + "depd": "1.1.2", "inherits": "2.0.3", "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", + "statuses": "1.5.0", "toidentifier": "1.0.0" } }, @@ -358,7 +358,7 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "requires": { - "safer-buffer": ">= 2.1.2 < 3" + "safer-buffer": "2.1.2" } }, "indexof": { @@ -447,7 +447,7 @@ "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", "requires": { - "better-assert": "~1.0.0" + "better-assert": "1.0.2" } }, "parseuri": { @@ -455,7 +455,7 @@ "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", "requires": { - "better-assert": "~1.0.0" + "better-assert": "1.0.2" } }, "parseurl": { @@ -473,7 +473,7 @@ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", "requires": { - "forwarded": "~0.1.2", + "forwarded": "0.1.2", "ipaddr.js": "1.9.0" } }, @@ -519,18 +519,18 @@ "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", "requires": { "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", + "depd": "1.1.2", + "destroy": "1.0.4", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", "fresh": "0.5.2", - "http-errors": "~1.7.2", + "http-errors": "1.7.2", "mime": "1.6.0", "ms": "2.1.1", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" + "on-finished": "2.3.0", + "range-parser": "1.2.1", + "statuses": "1.5.0" }, "dependencies": { "debug": { @@ -560,9 +560,9 @@ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "parseurl": "1.3.3", "send": "0.17.1" } }, @@ -576,12 +576,12 @@ "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.3.0.tgz", "integrity": "sha512-2A892lrj0GcgR/9Qk81EaY2gYhCBxurV0PfmmESO6p27QPrUK1J3zdns+5QPqvUYK2q657nSj0guoIil9+7eFg==", "requires": { - "debug": "~4.1.0", - "engine.io": "~3.4.0", - "has-binary2": "~1.0.2", - "socket.io-adapter": "~1.1.0", + "debug": "4.1.1", + "engine.io": "3.4.0", + "has-binary2": "1.0.3", + "socket.io-adapter": "1.1.1", "socket.io-client": "2.3.0", - "socket.io-parser": "~3.4.0" + "socket.io-parser": "3.4.0" } }, "socket.io-adapter": { @@ -598,15 +598,15 @@ "base64-arraybuffer": "0.1.5", "component-bind": "1.0.0", "component-emitter": "1.2.1", - "debug": "~4.1.0", - "engine.io-client": "~3.4.0", - "has-binary2": "~1.0.2", + "debug": "4.1.1", + "engine.io-client": "3.4.0", + "has-binary2": "1.0.3", "has-cors": "1.1.0", "indexof": "0.0.1", "object-component": "0.0.3", "parseqs": "0.0.5", "parseuri": "0.0.5", - "socket.io-parser": "~3.3.0", + "socket.io-parser": "3.3.0", "to-array": "0.1.4" }, "dependencies": { @@ -621,7 +621,7 @@ "integrity": "sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng==", "requires": { "component-emitter": "1.2.1", - "debug": "~3.1.0", + "debug": "3.1.0", "isarray": "2.0.1" }, "dependencies": { @@ -643,7 +643,7 @@ "integrity": "sha512-/G/VOI+3DBp0+DJKW4KesGnQkQPFmUCbA/oO2QGT6CWxU7hLGWqU3tyuzeSK/dqcyeHsQg1vTe9jiZI8GU9SCQ==", "requires": { "component-emitter": "1.2.1", - "debug": "~4.1.0", + "debug": "4.1.1", "isarray": "2.0.1" } }, @@ -668,7 +668,7 @@ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "requires": { "media-typer": "0.3.0", - "mime-types": "~2.1.24" + "mime-types": "2.1.24" } }, "unpipe": { @@ -691,7 +691,7 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-7.1.2.tgz", "integrity": "sha512-gftXq3XI81cJCgkUiAVixA0raD9IVmXqsylCrjRygw4+UOOGzPoxnQ6r/CnVL9i+mDncJo94tSkyrtuuQVBmrg==", "requires": { - "async-limiter": "^1.0.0" + "async-limiter": "1.0.1" } }, "xmlhttprequest-ssl": { diff --git a/sorteerhoed/central_management.py b/sorteerhoed/central_management.py index e6ebd43..52f0c70 100644 --- a/sorteerhoed/central_management.py +++ b/sorteerhoed/central_management.py @@ -342,7 +342,7 @@ class CentralManagement(): #{'event': {'HITGroupId': '301G7MYOAJ85NEW128ZDGF5DSBW53S', 'EventType': 'AssignmentAbandoned', 'EventTimestamp': '2019-10-23T20:23:06Z', 'HITId': '3JHB4BPSFKKFQ263K4EFULI3LC79QJ', 'AssignmentId': '3U088ZLJVL450PB6MJZUIIUCB6VW0Y', 'WorkerId': 'A1CK46PK9VEUH5', 'HITTypeId': '3EYXOXDEN7RX0YSMN4UMVN01AYKZJ0'}} sqsAssignment.abandoned_at = datetime.datetime.strptime(signal.params['event']['EventTimestamp'],"%Y-%m-%dT%H:%M:%SZ") # TODO temporarily dissable block for workers that abandon, until we're sure it works -# self.mturk.create_worker_block(WorkerId=signal.params['event']['WorkerId'], Reason='Accepted task without working on it.') + self.mturk.create_worker_block(WorkerId=signal.params['event']['WorkerId'], Reason='Accepted task without working on it.') elif signal.name == 'sqs.AssignmentReturned': self.logger.info(f'Set status progress to returned') diff --git a/sorteerhoed/webserver.py b/sorteerhoed/webserver.py index 8236947..1cfa0a9 100644 --- a/sorteerhoed/webserver.py +++ b/sorteerhoed/webserver.py @@ -268,7 +268,10 @@ class StatusWebSocketHandler(tornado.websocket.WebSocketHandler): def update_for_all(cls, data): logger.debug(f"update for all {data}") for connection in cls.connections: - connection.write_message(json.dumps(data, cls=DateTimeEncoder)) + try: + connection.write_message(json.dumps(data, cls=DateTimeEncoder)) + except Exception as e: + logger.exception(e) def strokes2D(strokes): # strokes to a d attribute for a path diff --git a/www/backend/script.js b/www/backend/script.js index 92a2378..0365702 100644 --- a/www/backend/script.js +++ b/www/backend/script.js @@ -50,11 +50,11 @@ setInterval(function(e){ app.hit['visible'] = true; let wrapperEl = document.getElementById("collaborators"); let innerEl = document.getElementById("collab_items"); - let size = 100; + let size = 80; do { innerEl.style.fontSize = size + "%"; size --; - } while(innerEl.clientHeight > wrapperEl.clientHeight && size > 10); + } while(innerEl.clientHeight > wrapperEl.clientHeight && size > 27); }, 1100); -}, 4000); \ No newline at end of file +}, 7000); diff --git a/www/backend/style.css b/www/backend/style.css index 9702d9d..c644165 100644 --- a/www/backend/style.css +++ b/www/backend/style.css @@ -98,16 +98,16 @@ body{ /* color: #fff; */ /* font-family: 'freesans'; text-transform: lowercase; */ - font-size: calc(var(--base-font-size)/2); + font-size: 50%; vertical-align: 67%; margin-left: -5px; - margin-right: 15px; + margin-right: .4em; } .country::before{content:'(';} .country::after{content:')';} #collaborators{ - height: 32vh; + height: 27vh; width: 800px; margin: 0 auto; } @@ -123,5 +123,7 @@ body{ text-transform: lowercase; } #collaborators .credit{ - margin-right:10px; + margin-right:.1em; + white-space: nowrap; + display: inline-block; } diff --git a/www/index.html b/www/index.html index d6786ef..5e17494 100644 --- a/www/index.html +++ b/www/index.html @@ -145,8 +145,8 @@