summarylogtreecommitdiffstats
path: root/octoprint-deps.patch
blob: 73e2fde4e00338c98edd8013f4609e01567801d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
diff --git a/setup.py b/setup.py
index c6eabbd0..24ed0f8b 100644
--- a/setup.py
+++ b/setup.py
@@ -14,34 +14,34 @@ import octoprint_setuptools
 
 # Requirements for our application
 INSTALL_REQUIRES = [
-	"flask>=0.9,<0.11",
+	"flask>=0.11,<0.12",
 	"Jinja2>=2.8,<2.9", # Jinja 2.9 has breaking changes WRT template scope - we can't
 	                    # guarantee backwards compatibility for plugins and such with that
 	                    # version, hence we need to pin to a lower version for now. See #1697
-	"werkzeug>=0.8.3,<0.9",
-	"tornado==4.0.2", # pinned for now, we need to migrate to a newer tornado, but due
+	"werkzeug>=0.11.1,<0.12",
+	"tornado>=4.4.2,<4.5", # pinned for now, we need to migrate to a newer tornado, but due
 	                  # to some voodoo needed to get large streamed uploads and downloads
 	                  # to work that is probably not completely straightforward and therefore
 	                  # something for post-1.3.0-stable release
 	"sockjs-tornado>=1.0.2,<1.1",
-	"PyYAML>=3.10,<3.11",
-	"Flask-Login>=0.2.2,<0.3",
-	"Flask-Principal>=0.3.5,<0.4",
-	"Flask-Babel>=0.9,<0.10",
-	"Flask-Assets>=0.10,<0.11",
+	"PyYAML>=3.12,<3.13",
+	"Flask-Login>=0.3,<0.4",
+	"Flask-Principal>=0.4,<0.5",
+	"Flask-Babel>=0.11,<0.12",
+	"Flask-Assets>=0.12,<0.13",
 	"markdown>=2.6.4,<2.7",
-	"pyserial>=2.7,<2.8",
+	"pyserial>=3.1.1,<3.2",
 	"netaddr>=0.7.17,<0.8",
 	"watchdog>=0.8.3,<0.9",
 	"sarge>=0.1.4,<0.2",
 	"netifaces>=0.10,<0.11",
 	"pylru>=1.0.9,<1.1",
-	"rsa>=3.2,<3.3",
-	"pkginfo>=1.2.1,<1.3",
-	"requests>=2.7,<2.8",
-	"semantic_version>=2.4.2,<2.5",
-	"psutil>=3.2.1,<3.3",
-	"Click>=6.2,<6.3",
+	"rsa>=3.4,<3.5",
+	"pkginfo>=1.3.2,<1.4",
+	"requests>=2.11.1,<2.12",
+	"semantic_version>=2.6.0,<2.7",
+	"psutil>=4.3.1,<4.4",
+	"Click>=6.6,<6.7",
 	"awesome-slugify>=1.6.5,<1.7",
 	"feedparser>=5.2.1,<5.3",
 	"chainmap>=1.0.2,<1.1",
diff --git a/src/octoprint/plugin/types.py b/src/octoprint/plugin/types.py
index 098688f6..be69dbc6 100644
--- a/src/octoprint/plugin/types.py
+++ b/src/octoprint/plugin/types.py
@@ -1417,7 +1417,7 @@ class SettingsPlugin(OctoPrintPlugin):
 
 		:return: the current settings of the plugin, as a dictionary
 		"""
-		from flask.ext.login import current_user
+		from flask_login import current_user
 		import copy
 
 		data = copy.deepcopy(self._settings.get_all_data(merged=True))
@@ -1462,8 +1462,8 @@ class SettingsPlugin(OctoPrintPlugin):
 					else:
 						node[key] = None
 
-		conditions = dict(user=lambda: current_user is not None and not current_user.is_anonymous(),
-		                  admin=lambda: current_user is not None and not current_user.is_anonymous() and current_user.is_admin(),
+		conditions = dict(user=lambda: current_user is not None and not current_user.is_anonymous,
+		                  admin=lambda: current_user is not None and not current_user.is_anonymous and current_user.is_admin,
 		                  never=lambda: False)
 
 		for level, condition in conditions.items():
@@ -1937,4 +1937,3 @@ class AppPlugin(OctoPrintPlugin):
 
 	def get_additional_apps(self):
 		return []
-
diff --git a/src/octoprint/plugins/announcements/__init__.py b/src/octoprint/plugins/announcements/__init__.py
index 74bc192a..7f73efb2 100644
--- a/src/octoprint/plugins/announcements/__init__.py
+++ b/src/octoprint/plugins/announcements/__init__.py
@@ -22,7 +22,7 @@ from collections import OrderedDict
 
 from octoprint.server import admin_permission
 from octoprint.server.util.flask import restricted_access, with_revalidation_checking, check_etag
-from flask.ext.babel import gettext
+from flask_babel import gettext
 
 class AnnouncementPlugin(octoprint.plugin.AssetPlugin,
                          octoprint.plugin.SettingsPlugin,
diff --git a/src/octoprint/plugins/corewizard/__init__.py b/src/octoprint/plugins/corewizard/__init__.py
index d9c61f67..77c89a05 100644
--- a/src/octoprint/plugins/corewizard/__init__.py
+++ b/src/octoprint/plugins/corewizard/__init__.py
@@ -9,7 +9,7 @@ __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms
 import octoprint.plugin
 
 
-from flask.ext.babel import gettext
+from flask_babel import gettext
 
 
 class CoreWizardPlugin(octoprint.plugin.AssetPlugin,
diff --git a/src/octoprint/plugins/discovery/__init__.py b/src/octoprint/plugins/discovery/__init__.py
index 988d4840..7d5b5f44 100644
--- a/src/octoprint/plugins/discovery/__init__.py
+++ b/src/octoprint/plugins/discovery/__init__.py
@@ -12,7 +12,7 @@ The SSDP/UPNP implementations has been largely inspired by https://gist.github.c
 import logging
 import os
 import flask
-from flask.ext.babel import gettext
+from flask_babel import gettext
 from builtins import range
 
 import octoprint.plugin
diff --git a/src/octoprint/plugins/pluginmanager/__init__.py b/src/octoprint/plugins/pluginmanager/__init__.py
index 47365b2e..03b81a40 100644
--- a/src/octoprint/plugins/pluginmanager/__init__.py
+++ b/src/octoprint/plugins/pluginmanager/__init__.py
@@ -15,7 +15,7 @@ from octoprint.server import admin_permission, VERSION
 from octoprint.util.pip import LocalPipCaller, UnknownPip
 
 from flask import jsonify, make_response
-from flask.ext.babel import gettext
+from flask_babel import gettext
 from collections import OrderedDict
 
 import logging
diff --git a/src/octoprint/plugins/softwareupdate/__init__.py b/src/octoprint/plugins/softwareupdate/__init__.py
index 507c5593..bd46a054 100644
--- a/src/octoprint/plugins/softwareupdate/__init__.py
+++ b/src/octoprint/plugins/softwareupdate/__init__.py
@@ -18,7 +18,7 @@ import hashlib
 
 from . import version_checks, updaters, exceptions, util, cli
 
-from flask.ext.babel import gettext
+from flask_babel import gettext
 
 from octoprint.server.util.flask import restricted_access, with_revalidation_checking, check_etag
 from octoprint.server import admin_permission, VERSION, REVISION, BRANCH
@@ -549,7 +549,7 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin,
 	##~~ TemplatePlugin API
 
 	def get_template_configs(self):
-		from flask.ext.babel import gettext
+		from flask_babel import gettext
 		return [
 			dict(type="settings", name=gettext("Software Update"))
 		]
@@ -882,7 +882,7 @@ class SoftwareUpdatePlugin(octoprint.plugin.BlueprintPlugin,
 		result = dict(check)
 
 		if target == "octoprint":
-			from flask.ext.babel import gettext
+			from flask_babel import gettext
 
 			result["displayName"] = to_unicode(check.get("displayName"), errors="replace")
 			if result["displayName"] is None:
@@ -1074,5 +1074,3 @@ def __plugin_load__():
 	__plugin_hooks__ = {
 		"octoprint.cli.commands": cli.commands
 	}
-
-
diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py
index 94b9bab5..e418d594 100644
--- a/src/octoprint/server/__init__.py
+++ b/src/octoprint/server/__init__.py
@@ -8,10 +8,10 @@ __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms
 import uuid
 from sockjs.tornado import SockJSRouter
 from flask import Flask, g, request, session, Blueprint, Request, Response
-from flask.ext.login import LoginManager, current_user
-from flask.ext.principal import Principal, Permission, RoleNeed, identity_loaded, UserNeed
-from flask.ext.babel import Babel, gettext, ngettext
-from flask.ext.assets import Environment, Bundle
+from flask_login import LoginManager, current_user
+from flask_principal import Principal, Permission, RoleNeed, identity_loaded, UserNeed
+from flask_babel import Babel, gettext, ngettext
+from flask_assets import Environment, Bundle
 from babel import Locale
 from watchdog.observers import Observer
 from watchdog.observers.polling import PollingObserver
@@ -89,9 +89,9 @@ def on_identity_loaded(sender, identity):
 		return
 
 	identity.provides.add(UserNeed(user.get_id()))
-	if user.is_user():
+	if user.is_user:
 		identity.provides.add(RoleNeed("user"))
-	if user.is_admin():
+	if user.is_admin:
 		identity.provides.add(RoleNeed("admin"))
 
 def load_user(id):
@@ -170,8 +170,7 @@ class Server(object):
 		self._logger = logging.getLogger(__name__)
 		pluginManager = self._plugin_manager
 
-		# monkey patch a bunch of stuff
-		util.tornado.fix_ioloop_scheduling()
+		# monkey patch some stuff
 		util.flask.enable_additional_translations(additional_folders=[self._settings.getBaseFolder("translations")])
 
 		# setup app
diff --git a/src/octoprint/server/api/__init__.py b/src/octoprint/server/api/__init__.py
index 35401e45..6d056fe0 100644
--- a/src/octoprint/server/api/__init__.py
+++ b/src/octoprint/server/api/__init__.py
@@ -10,8 +10,8 @@ import netaddr
 import sarge
 
 from flask import Blueprint, request, jsonify, abort, current_app, session, make_response, g
-from flask.ext.login import login_user, logout_user, current_user
-from flask.ext.principal import Identity, identity_changed, AnonymousIdentity
+from flask_login import login_user, logout_user, current_user
+from flask_principal import Identity, identity_changed, AnonymousIdentity
 
 import octoprint.util as util
 import octoprint.users
@@ -62,7 +62,7 @@ def pluginData(name):
 		return make_response("More than one api provider registered for {name}, can't proceed".format(name=name), 500)
 
 	api_plugin = api_plugins[0]
-	if api_plugin.is_api_adminonly() and not current_user.is_admin():
+	if api_plugin.is_api_adminonly() and not current_user.is_admin:
 		return make_response("Forbidden", 403)
 
 	response = api_plugin.on_api_get(request)
@@ -89,7 +89,7 @@ def pluginCommand(name):
 	if valid_commands is None:
 		return make_response("Method not allowed", 405)
 
-	if api_plugin.is_api_adminonly() and not current_user.is_admin():
+	if api_plugin.is_api_adminonly() and not current_user.is_admin:
 		return make_response("Forbidden", 403)
 
 	command, data, response = get_json_command_from_request(request, valid_commands)
diff --git a/src/octoprint/server/api/languages.py b/src/octoprint/server/api/languages.py
index e0749658..3d5f1f2c 100644
--- a/src/octoprint/server/api/languages.py
+++ b/src/octoprint/server/api/languages.py
@@ -26,7 +26,7 @@ from octoprint.server.util.flask import restricted_access
 
 from octoprint.plugin import plugin_manager
 
-from flask.ext.babel import Locale
+from flask_babel import Locale
 
 @api.route("/languages", methods=["GET"])
 @restricted_access
diff --git a/src/octoprint/server/api/settings.py b/src/octoprint/server/api/settings.py
index 02880093..b53e889f 100644
--- a/src/octoprint/server/api/settings.py
+++ b/src/octoprint/server/api/settings.py
@@ -8,7 +8,7 @@ __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms
 import logging
 
 from flask import request, jsonify, make_response
-from flask.ext.login import current_user
+from flask_login import current_user
 from werkzeug.exceptions import BadRequest
 
 from octoprint.events import eventManager, Events
@@ -39,7 +39,7 @@ def _etag(lm=None):
 	for key in sorted(plugin_settings.keys()):
 		sorted_plugin_settings[key] = plugin_settings.get(key, dict())
 
-	if current_user is not None and not current_user.is_anonymous():
+	if current_user is not None and not current_user.is_anonymous:
 		roles = sorted(current_user.roles)
 	else:
 		roles = []
diff --git a/src/octoprint/server/api/system.py b/src/octoprint/server/api/system.py
index 058476d3..14a0e084 100644
--- a/src/octoprint/server/api/system.py
+++ b/src/octoprint/server/api/system.py
@@ -9,7 +9,7 @@ import logging
 import sarge
 
 from flask import request, make_response, jsonify, url_for
-from flask.ext.babel import gettext
+from flask_babel import gettext
 
 from octoprint.settings import settings as s
 
diff --git a/src/octoprint/server/api/users.py b/src/octoprint/server/api/users.py
index 73233f5e..fbee5c16 100644
--- a/src/octoprint/server/api/users.py
+++ b/src/octoprint/server/api/users.py
@@ -7,7 +7,7 @@ __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms
 
 from flask import request, jsonify, abort, make_response
 from werkzeug.exceptions import BadRequest
-from flask.ext.login import current_user
+from flask_login import current_user
 
 import octoprint.users as users
 
@@ -72,7 +72,7 @@ def getUser(username):
 	if not userManager.enabled:
 		return jsonify(SUCCESS)
 
-	if current_user is not None and not current_user.is_anonymous() and (current_user.get_name() == username or current_user.is_admin()):
+	if current_user is not None and not current_user.is_anonymous and (current_user.get_name() == username or current_user.is_admin):
 		user = userManager.findUser(username)
 		if user is not None:
 			return jsonify(user.asDict())
@@ -133,7 +133,7 @@ def changePasswordForUser(username):
 	if not userManager.enabled:
 		return jsonify(SUCCESS)
 
-	if current_user is not None and not current_user.is_anonymous() and (current_user.get_name() == username or current_user.is_admin()):
+	if current_user is not None and not current_user.is_anonymous and (current_user.get_name() == username or current_user.is_admin):
 		if not "application/json" in request.headers["Content-Type"]:
 			return make_response("Expected content-type JSON", 400)
 
@@ -161,7 +161,7 @@ def getSettingsForUser(username):
 	if not userManager.enabled:
 		return jsonify(SUCCESS)
 
-	if current_user is None or current_user.is_anonymous() or (current_user.get_name() != username and not current_user.is_admin()):
+	if current_user is None or current_user.is_anonymous or (current_user.get_name() != username and not current_user.is_admin):
 		return make_response("Forbidden", 403)
 
 	try:
@@ -175,7 +175,7 @@ def changeSettingsForUser(username):
 	if not userManager.enabled:
 		return jsonify(SUCCESS)
 
-	if current_user is None or current_user.is_anonymous() or (current_user.get_name() != username and not current_user.is_admin()):
+	if current_user is None or current_user.is_anonymous or (current_user.get_name() != username and not current_user.is_admin):
 		return make_response("Forbidden", 403)
 
 	try:
@@ -195,7 +195,7 @@ def deleteApikeyForUser(username):
 	if not userManager.enabled:
 		return jsonify(SUCCESS)
 
-	if current_user is not None and not current_user.is_anonymous() and (current_user.get_name() == username or current_user.is_admin()):
+	if current_user is not None and not current_user.is_anonymous and (current_user.get_name() == username or current_user.is_admin):
 		try:
 			userManager.deleteApikey(username)
 		except users.UnknownUser:
@@ -211,7 +211,7 @@ def generateApikeyForUser(username):
 	if not userManager.enabled:
 		return jsonify(SUCCESS)
 
-	if current_user is not None and not current_user.is_anonymous() and (current_user.get_name() == username or current_user.is_admin()):
+	if current_user is not None and not current_user.is_anonymous and (current_user.get_name() == username or current_user.is_admin):
 		try:
 			apikey = userManager.generateApiKey(username)
 		except users.UnknownUser:
diff --git a/src/octoprint/server/util/__init__.py b/src/octoprint/server/util/__init__.py
index 5d202d16..0a084325 100644
--- a/src/octoprint/server/util/__init__.py
+++ b/src/octoprint/server/util/__init__.py
@@ -13,6 +13,7 @@ from octoprint.users import ApiUser
 from octoprint.util import deprecated
 
 import flask as _flask
+import flask_login
 
 from . import flask
 from . import sockjs
@@ -58,7 +59,7 @@ def loginFromApiKeyRequestHandler():
 
 	if apikey and apikey != octoprint.server.UI_API_KEY and not octoprint.server.appSessionManager.validate(apikey):
 		user = get_user_for_apikey(apikey)
-		if user is not None and _flask.ext.login.login_user(user, remember=False):
+		if user is not None and flask_login.login_user(user, remember=False):
 			_flask.ext.principal.identity_changed.send(_flask.current_app._get_current_object(),
 			                                           identity=_flask.ext.principal.Identity(user.get_id()))
 		else:
diff --git a/src/octoprint/server/util/flask.py b/src/octoprint/server/util/flask.py
index 5f41d661..9fc0defd 100644
--- a/src/octoprint/server/util/flask.py
+++ b/src/octoprint/server/util/flask.py
@@ -8,9 +8,9 @@ __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms
 
 import tornado.web
 import flask
-import flask.ext.login
-import flask.ext.principal
-import flask.ext.assets
+import flask_login
+import flask_principal
+import flask_assets
 import webassets.updater
 import webassets.utils
 import functools
@@ -40,7 +40,7 @@ def enable_additional_translations(default_locale="en", additional_folders=None)
 	import os
 	from flask import _request_ctx_stack
 	from babel import support, Locale
-	import flask.ext.babel
+	import flask_babel
 
 	if additional_folders is None:
 		additional_folders = []
@@ -91,7 +91,7 @@ def enable_additional_translations(default_locale="en", additional_folders=None)
 			return None
 		translations = getattr(ctx, 'babel_translations', None)
 		if translations is None:
-			locale = flask.ext.babel.get_locale()
+			locale = flask_babel.get_locale()
 			translations = support.Translations()
 
 			if str(locale) != default_locale:
@@ -129,8 +129,8 @@ def enable_additional_translations(default_locale="en", additional_folders=None)
 			ctx.babel_translations = translations
 		return translations
 
-	flask.ext.babel.Babel.list_translations = fixed_list_translations
-	flask.ext.babel.get_translations = fixed_get_translations
+	flask_babel.Babel.list_translations = fixed_list_translations
+	flask_babel.get_translations = fixed_get_translations
 
 def fix_webassets_cache():
 	from webassets import cache
@@ -478,12 +478,12 @@ class OctoPrintFlaskResponse(flask.Response):
 
 def passive_login():
 	if octoprint.server.userManager.enabled:
-		user = octoprint.server.userManager.login_user(flask.ext.login.current_user)
+		user = octoprint.server.userManager.login_user(flask_login.current_user)
 	else:
-		user = flask.ext.login.current_user
+		user = flask_login.current_user
 
-	if user is not None and not user.is_anonymous():
-		flask.ext.principal.identity_changed.send(flask.current_app._get_current_object(), identity=flask.ext.principal.Identity(user.get_id()))
+	if user is not None and not user.is_anonymous:
+		flask_principal.identity_changed.send(flask.current_app._get_current_object(), identity=flask_principal.Identity(user.get_id()))
 		if hasattr(user, "get_session"):
 			flask.session["usersession.id"] = user.get_session()
 		flask.g.user = user
@@ -505,8 +505,8 @@ def passive_login():
 					user = octoprint.server.userManager.login_user(user)
 					flask.session["usersession.id"] = user.get_session()
 					flask.g.user = user
-					flask.ext.login.login_user(user)
-					flask.ext.principal.identity_changed.send(flask.current_app._get_current_object(), identity=flask.ext.principal.Identity(user.get_id()))
+					flask_login.login_user(user)
+					flask_principal.identity_changed.send(flask.current_app._get_current_object(), identity=flask_principal.Identity(user.get_id()))
 					return flask.jsonify(user.asDict())
 		except:
 			logger = logging.getLogger(__name__)
@@ -1023,7 +1023,7 @@ def admin_validator(request):
 	"""
 
 	user = _get_flask_user_from_request(request)
-	if user is None or not user.is_authenticated() or not user.is_admin():
+	if user is None or not user.is_authenticated or not user.is_admin:
 		raise tornado.web.HTTPError(403)
 
 
@@ -1038,7 +1038,7 @@ def user_validator(request):
 	"""
 
 	user = _get_flask_user_from_request(request)
-	if user is None or not user.is_authenticated():
+	if user is None or not user.is_authenticated:
 		raise tornado.web.HTTPError(403)
 
 
@@ -1051,14 +1051,14 @@ def _get_flask_user_from_request(request):
 	:return: the user or None if no user could be determined
 	"""
 	import octoprint.server.util
-	import flask.ext.login
+	import flask_login
 	from octoprint.settings import settings
 
 	apikey = octoprint.server.util.get_api_key(request)
 	if settings().getBoolean(["api", "enabled"]) and apikey is not None:
 		user = octoprint.server.util.get_user_for_apikey(apikey)
 	else:
-		user = flask.ext.login.current_user
+		user = flask_login.current_user
 
 	return user
 
@@ -1103,7 +1103,7 @@ def restricted_access(func):
 		if settings().getBoolean(["server", "firstRun"]) and settings().getBoolean(["accessControl", "enabled"]) and (octoprint.server.userManager is None or not octoprint.server.userManager.hasBeenCustomized()):
 			return flask.make_response("OctoPrint isn't setup yet", 403)
 
-		return flask.ext.login.login_required(func)(*args, **kwargs)
+		return flask_login.login_required(func)(*args, **kwargs)
 
 	return decorated_view
 
@@ -1201,7 +1201,7 @@ def get_json_command_from_request(request, valid_commands):
 
 ##~~ Flask-Assets resolver with plugin asset support
 
-class PluginAssetResolver(flask.ext.assets.FlaskResolver):
+class PluginAssetResolver(flask_assets.FlaskResolver):
 
 	def split_prefix(self, ctx, item):
 		app = ctx.environment._app
@@ -1210,14 +1210,14 @@ class PluginAssetResolver(flask.ext.assets.FlaskResolver):
 				prefix, plugin, name = item.split("/", 2)
 				blueprint = prefix + "." + plugin
 
-				directory = flask.ext.assets.get_static_folder(app.blueprints[blueprint])
+				directory = flask_assets.get_static_folder(app.blueprints[blueprint])
 				item = name
 				endpoint = blueprint + ".static"
 				return directory, item, endpoint
 			except (ValueError, KeyError):
 				pass
 
-		return flask.ext.assets.FlaskResolver.split_prefix(self, ctx, item)
+		return flask_assets.FlaskResolver.split_prefix(self, ctx, item)
 
 	def resolve_output_to_path(self, ctx, target, bundle):
 		import os
diff --git a/src/octoprint/server/util/tornado.py b/src/octoprint/server/util/tornado.py
index 12ba3b9b..8325bcaf 100644
--- a/src/octoprint/server/util/tornado.py
+++ b/src/octoprint/server/util/tornado.py
@@ -29,36 +29,6 @@ import tornado.util
 import octoprint.util
 
 
-#~~ Monkey patching
-
-
-def fix_ioloop_scheduling():
-	"""
-	This monkey patches tornado's :meth:``tornado.ioloop.PeriodicCallback._schedule_next`` method so it no longer
-	blocks for long times on slow machines (RPi) when the system time happens to change by a large amount (e.g. due to
-	the first ever contact to an NTP server).
-
-	Patch by @nosyjoe on Github. See this PR against tornado: https://github.com/tornadoweb/tornado/pull/1290
-	"""
-
-	import math
-
-	# patched implementation taken from PR
-	def _schedule_next(self):
-		if self._running:
-			current_time = self.io_loop.time()
-
-			if self._next_timeout <= current_time:
-				callback_time_sec = self.callback_time / 1000.0
-				self._next_timeout += (math.floor((current_time - self._next_timeout) / callback_time_sec) + 1) * callback_time_sec
-
-			self._timeout = self.io_loop.add_timeout(self._next_timeout, self._run)
-
-	# replace original implementation with patched version
-	import tornado.ioloop
-	tornado.ioloop.PeriodicCallback._schedule_next = _schedule_next
-
-
 #~~ WSGI middleware
 
 
@@ -672,8 +642,10 @@ class CustomHTTPServer(tornado.httpserver.HTTPServer):
 
 	``default_max_body_size`` is the default maximum body size to apply if no specific one from ``max_body_sizes`` matches.
 	"""
+	def __init__(self, *args, **kwargs):
+		pass
 
-	def __init__(self, request_callback, no_keep_alive=False, io_loop=None,
+	def initialize(self, request_callback, no_keep_alive=False, io_loop=None,
 				 xheaders=False, ssl_options=None, protocol=None,
 				 decompress_request=False,
 				 chunk_size=None, max_header_size=None,
diff --git a/src/octoprint/users.py b/src/octoprint/users.py
index cec5a48f..a99e0582 100644
--- a/src/octoprint/users.py
+++ b/src/octoprint/users.py
@@ -5,8 +5,8 @@ __author__ = "Gina Häußge <osd@foosel.net>"
 __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
 __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
 
-from flask.ext.login import UserMixin
-from flask.ext.principal import Identity
+from flask_login import UserMixin
+from flask_principal import Identity
 from werkzeug.local import LocalProxy
 import hashlib
 import os
@@ -431,9 +431,9 @@ class User(UserMixin):
 	def asDict(self):
 		return {
 			"name": self._username,
-			"active": self.is_active(),
-			"admin": self.is_admin(),
-			"user": self.is_user(),
+			"active": self.is_active,
+			"admin": self.is_admin,
+			"user": self.is_user,
 			"apikey": self._apikey,
 			"settings": self._settings
 		}
@@ -447,12 +447,15 @@ class User(UserMixin):
 	def get_name(self):
 		return self._username
 
+	@property
 	def is_active(self):
 		return self._active
 
+	@property
 	def is_user(self):
 		return "user" in self._roles
 
+	@property
 	def is_admin(self):
 		return "admin" in self._roles
 
@@ -503,7 +506,7 @@ class User(UserMixin):
 		return True
 
 	def __repr__(self):
-		return "User(id=%s,name=%s,active=%r,user=%r,admin=%r)" % (self.get_id(), self.get_name(), self.is_active(), self.is_user(), self.is_admin())
+		return "User(id=%s,name=%s,active=%r,user=%r,admin=%r)" % (self.get_id(), self.get_name(), self.is_active, self.is_user, self.is_admin)
 
 class SessionUser(User):
 	def __init__(self, user):
@@ -535,7 +538,7 @@ class SessionUser(User):
 		self._user = user
 
 	def __repr__(self):
-		return "SessionUser(id=%s,name=%s,active=%r,user=%r,admin=%r,session=%s,created=%s)" % (self.get_id(), self.get_name(), self.is_active(), self.is_user(), self.is_admin(), self._session, self._created)
+		return "SessionUser(id=%s,name=%s,active=%r,user=%r,admin=%r,session=%s,created=%s)" % (self.get_id(), self.get_name(), self.is_active, self.is_user, self.is_admin, self._session, self._created)
 
 ##~~ DummyUser object to use when accessControl is disabled