From d2a622d0ed17bcdd5d33b77fded611d2fe5a90e9 Mon Sep 17 00:00:00 2001 From: Tom Kazimiers Date: Mon, 2 Dec 2024 22:29:37 +0100 Subject: [PATCH] Upgrade Django from v3.2 to v4.2 --- .../catmaid/control/authentication.py | 4 +- django/applications/catmaid/control/client.py | 4 +- .../applications/catmaid/control/deeplink.py | 12 +- .../catmaid/control/project_token.py | 4 +- .../control/suppressed_virtual_treenode.py | 2 +- .../catmaid/control/synapseclustering.py | 9 +- django/applications/catmaid/fields.py | 2 +- .../catmaid_update_project_configuration.py | 2 +- .../catmaid/static/libs/cytoscapejs/cola.js | 1 - .../catmaid/static/libs/pixi.js/pixi.min.js | 1 - .../static/libs/streamsaver/polyfill.min.js | 1 - django/applications/catmaid/tests/common.py | 28 +- .../applications/catmaid/tests/test_async.py | 56 ++ django/applications/catmaid/urls.py | 723 +++++++++--------- django/projects/mysite/settings_base.py | 1 + django/projects/mysite/urls.py | 17 +- django/requirements-async.txt | 6 +- django/requirements-test.txt | 6 +- django/requirements.txt | 22 +- 19 files changed, 494 insertions(+), 407 deletions(-) create mode 100644 django/applications/catmaid/tests/test_async.py diff --git a/django/applications/catmaid/control/authentication.py b/django/applications/catmaid/control/authentication.py index 7df092a1e6..74c0b8b2fd 100644 --- a/django/applications/catmaid/control/authentication.py +++ b/django/applications/catmaid/control/authentication.py @@ -26,7 +26,7 @@ from django.core.exceptions import ObjectDoesNotExist from django.shortcuts import _get_queryset, render from django.template import Context, Template -from django.utils.encoding import force_bytes, force_text +from django.utils.encoding import force_bytes, force_str from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode from django.core.mail import EmailMessage @@ -892,7 +892,7 @@ def register(request:HttpRequest) -> Union[HttpResponseRedirect, JsonResponse]: def activate(request:HttpRequest, uidb64, token): try: - uid = force_text(urlsafe_base64_decode(uidb64)) + uid = force_str(urlsafe_base64_decode(uidb64)) user = User.objects.get(pk=uid) except(TypeError, ValueError, OverflowError, User.DoesNotExist): user = None diff --git a/django/applications/catmaid/control/client.py b/django/applications/catmaid/control/client.py index 5258a7f49f..988ad91f38 100644 --- a/django/applications/catmaid/control/client.py +++ b/django/applications/catmaid/control/client.py @@ -32,7 +32,7 @@ class Meta: class ClientDatastoreList(APIView): @method_decorator(requires_user_role_for_any_project([UserRole.Browse, UserRole.Annotate])) - @never_cache + @method_decorator(never_cache) def get(self, request:Request, format=None) -> Response: """List key-value store datastores used by the client. --- @@ -96,7 +96,7 @@ class Meta: class ClientDataList(APIView): @method_decorator(requires_user_role_for_any_project([UserRole.Browse, UserRole.Annotate])) - @never_cache + @method_decorator(never_cache) def get(self, request:Request, name=None, format=None) -> Response: """List key-value data in a datastore for the client. diff --git a/django/applications/catmaid/control/deeplink.py b/django/applications/catmaid/control/deeplink.py index 648a296c07..243d577437 100644 --- a/django/applications/catmaid/control/deeplink.py +++ b/django/applications/catmaid/control/deeplink.py @@ -89,7 +89,7 @@ class Meta: class DeepLinkList(APIView): @method_decorator(requires_user_role([UserRole.Browse])) - @never_cache + @method_decorator(never_cache) def get(self, request:Request, project_id) -> Response: """List deep-links available to the client. --- @@ -227,7 +227,7 @@ def post(self, request:Request, project_id) -> Response: class DeepLinkSelector(APIView): - @never_cache + @method_decorator(never_cache) def get(self, request:Request, project_id, alias) -> Response: """Get a deep-links available to the client. @@ -242,7 +242,7 @@ def get(self, request:Request, project_id, alias) -> Response: return HttpResponseRedirect(url) @method_decorator(requires_user_role_for_any_project([UserRole.Browse])) - @never_cache + @method_decorator(never_cache) def head(self, request:Request, project_id, alias) -> Response: """Get a deep-links available to the client. --- @@ -257,7 +257,7 @@ def head(self, request:Request, project_id, alias) -> Response: return Response('Link not found', status=status.HTTP_404_NOT_FOUND) @method_decorator(requires_user_role_for_any_project([UserRole.Annotate])) - @never_cache + @method_decorator(never_cache) def delete(self, request:Request, project_id, alias) -> Response: """Delete a deep-links available to the client. --- @@ -278,7 +278,7 @@ def delete(self, request:Request, project_id, alias) -> Response: class DeepLinkDetails(APIView): @method_decorator(requires_user_role_for_any_project([UserRole.Browse])) - @never_cache + @method_decorator(never_cache) def get(self, request:Request, project_id, alias) -> Response: """Get details on a deep-link. --- @@ -297,7 +297,7 @@ def get(self, request:Request, project_id, alias) -> Response: class DeepLinkByIdSelector(APIView): @method_decorator(requires_user_role_for_any_project([UserRole.Annotate])) - @never_cache + @method_decorator(never_cache) def delete(self, request:Request, project_id, link_id) -> Response: """Delete a deep-links available to the client. --- diff --git a/django/applications/catmaid/control/project_token.py b/django/applications/catmaid/control/project_token.py index 933d8ea353..3a7dec3b05 100644 --- a/django/applications/catmaid/control/project_token.py +++ b/django/applications/catmaid/control/project_token.py @@ -84,7 +84,7 @@ class Meta: class ProjectTokenList(APIView): @method_decorator(requires_user_role([UserRole.Admin])) - @never_cache + @method_decorator(never_cache) def get(self, request:Request, project_id) -> Response: """List project tokens available for this project, if the user is an admin. @@ -130,7 +130,7 @@ def post(self, request:Request, project_id) -> Response: class UserProjectTokenList(APIView): - @never_cache + @method_decorator(never_cache) def get(self, request:Request, project_id) -> JsonResponse: """List project tokens available for this project and user. --- diff --git a/django/applications/catmaid/control/suppressed_virtual_treenode.py b/django/applications/catmaid/control/suppressed_virtual_treenode.py index bdea1a05de..64d406b636 100644 --- a/django/applications/catmaid/control/suppressed_virtual_treenode.py +++ b/django/applications/catmaid/control/suppressed_virtual_treenode.py @@ -24,7 +24,7 @@ class Meta: class SuppressedVirtualTreenodeList(APIView): @method_decorator(requires_user_role([UserRole.Browse, UserRole.Annotate])) - @never_cache + @method_decorator(never_cache) def get(self, request:Request, project_id=None, treenode_id=None, format=None) -> Response: """List suppressed virtual nodes along the edge to this node. --- diff --git a/django/applications/catmaid/control/synapseclustering.py b/django/applications/catmaid/control/synapseclustering.py index 611d36d937..26b7eccc84 100644 --- a/django/applications/catmaid/control/synapseclustering.py +++ b/django/applications/catmaid/control/synapseclustering.py @@ -104,8 +104,13 @@ def distanceMatrix(G, synNodes) -> Tuple[Any, Dict]: synNodes = set(synNodes) synIndices = tuple(i for i,node in enumerate(nodeList) if node in synNodes) - dmat = dijkstra(nx.to_scipy_sparse_matrix(G, nodeList), - directed=False, indices=synIndices) + # FIXME: The dtype paratmer and index overrides shouldn't be needed, but the + # Dijkstra implementation fails in SciPy >v1.10 and >16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,u=(n>>16&255)/255,h=(n>>8&255)/255,l=(255&n)/255,c=[.3,.59,.11,0,0,o,s,a,t,0,u,h,l,e,0,o-u,s-h,a-l,0,0];this._loadMatrix(c,i)},e.prototype.night=function(t,e){t=t||.1;var r=[-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},e.prototype.lsd=function(t){var e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(e,t)},e.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)},s(e,[{key:"matrix",get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t}},{key:"alpha",get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t}}]),e}(u.Filter));r.default=h,h.prototype.grayscale=h.prototype.greyscale},{"../../core":65,path:8}],151:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}r.__esModule=!0;var s=function(){function t(t,e){for(var r=0;r lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec2 fragCoord = vTextureCoord * filterArea.xy;\n\n vec4 color;\n\n color = fxaa(uSampler, fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n'))}return o(e,t),e}(a.Filter));r.default=u},{"../../core":65,path:8}],153:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}r.__esModule=!0;var i=t("./fxaa/FXAAFilter");Object.defineProperty(r,"FXAAFilter",{enumerable:!0,get:function(){return n(i).default}});var o=t("./noise/NoiseFilter");Object.defineProperty(r,"NoiseFilter",{enumerable:!0,get:function(){return n(o).default}});var s=t("./displacement/DisplacementFilter");Object.defineProperty(r,"DisplacementFilter",{enumerable:!0,get:function(){return n(s).default}});var a=t("./blur/BlurFilter");Object.defineProperty(r,"BlurFilter",{enumerable:!0,get:function(){return n(a).default}});var u=t("./blur/BlurXFilter");Object.defineProperty(r,"BlurXFilter",{enumerable:!0,get:function(){return n(u).default}});var h=t("./blur/BlurYFilter");Object.defineProperty(r,"BlurYFilter",{enumerable:!0,get:function(){return n(h).default}});var l=t("./colormatrix/ColorMatrixFilter");Object.defineProperty(r,"ColorMatrixFilter",{enumerable:!0,get:function(){return n(l).default}});var c=t("./alpha/AlphaFilter");Object.defineProperty(r,"AlphaFilter",{enumerable:!0,get:function(){return n(c).default}})},{"./alpha/AlphaFilter":143,"./blur/BlurFilter":144,"./blur/BlurXFilter":145,"./blur/BlurYFilter":146,"./colormatrix/ColorMatrixFilter":150,"./displacement/DisplacementFilter":151,"./fxaa/FXAAFilter":152,"./noise/NoiseFilter":154}],154:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}r.__esModule=!0;var s=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:.5,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Math.random();n(this,e);var s=i(this,t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n"));return s.noise=r,s.seed=o,s}return o(e,t),s(e,[{key:"noise",get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t}},{key:"seed",get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t}}]),e}(u.Filter));r.default=h},{"../../core":65,path:8}],155:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.__esModule=!0;var i=function(){function t(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:1;this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents()},e.prototype.addEvents=function(){this.interactionDOMElement&&(h.ticker.shared.add(this.update,this,h.UPDATE_PRIORITY.INTERACTION),window.navigator.msPointerEnabled?(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"):this.supportsPointerEvents&&(this.interactionDOMElement.style["touch-action"]="none"),this.supportsPointerEvents?(window.document.addEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,!0),window.addEventListener("pointercancel",this.onPointerCancel,!0),window.addEventListener("pointerup",this.onPointerUp,!0)):(window.document.addEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,!0),window.addEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,!0)),this.eventsAdded=!0)},e.prototype.removeEvents=function(){this.interactionDOMElement&&(h.ticker.shared.remove(this.update,this),window.navigator.msPointerEnabled?(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""):this.supportsPointerEvents&&(this.interactionDOMElement.style["touch-action"]=""),this.supportsPointerEvents?(window.document.removeEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,!0),window.removeEventListener("pointercancel",this.onPointerCancel,!0),window.removeEventListener("pointerup",this.onPointerUp,!0)):(window.document.removeEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,!0),window.removeEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,!0)),this.interactionDOMElement=null,this.eventsAdded=!1)},e.prototype.update=function(t){if(this._deltaTime+=t,!(this._deltaTime=0;l--){var c=h[l],d=this.processInteractive(t,c,r,n,a);if(d){if(!c.parent)continue;a=!1,d&&(t.target&&(n=!1),s=!0)}}return i&&(n&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},e.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&t.preventDefault();for(var r=e.length,n=0;ne?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._renderCanvas=function(t){var e=t.context,r=this.worldTransform,n=t.resolution,i=16777215!==this.tint,o=this._texture;i&&this._cachedTint!==this.tint&&(this._cachedTint=this.tint,this._tintedTexture=c.default.getTintedTexture(this,this.tint));var s=i?this._tintedTexture:o.baseTexture.source;this._canvasUvs||(this._canvasUvs=[0,0,0,0,0,0,0,0]);var a=this.vertices,u=this._canvasUvs,h=i?0:o.frame.x,l=i?0:o.frame.y,d=h+o.frame.width,f=l+o.frame.height;u[0]=h,u[1]=h+this._leftWidth,u[2]=d-this._rightWidth,u[3]=d,u[4]=l,u[5]=l+this._topHeight,u[6]=f-this._bottomHeight,u[7]=f;for(var p=0;p<8;p++)u[p]*=o.baseTexture.resolution;e.globalAlpha=this.worldAlpha,t.setBlendMode(this.blendMode),t.roundPixels?e.setTransform(r.a*n,r.b*n,r.c*n,r.d*n,r.tx*n|0,r.ty*n|0):e.setTransform(r.a*n,r.b*n,r.c*n,r.d*n,r.tx*n,r.ty*n);for(var v=0;v<3;v++)for(var g=0;g<3;g++){var y=2*g+8*v,m=Math.max(1,u[g+1]-u[g]),_=Math.max(1,u[v+5]-u[v+4]),b=Math.max(1,a[y+10]-a[y]),x=Math.max(1,a[y+11]-a[y+1]);e.drawImage(s,u[g],u[v+4],m,_,a[y],a[y+1],b,x)}},e.prototype._refresh=function(){t.prototype._refresh.call(this);var e=this.uvs,r=this._texture;this._origWidth=r.orig.width,this._origHeight=r.orig.height;var n=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=n*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-n*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.dirty++,this.multiplyUvs()},a(e,[{key:"width",get:function(){return this._width},set:function(t){this._width=t,this._refresh()}},{key:"height",get:function(){return this._height},set:function(t){this._height=t,this._refresh()}},{key:"leftWidth",get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()}},{key:"rightWidth",get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()}},{key:"topHeight",get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()}},{key:"bottomHeight",get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()}}]),e}(h.default);r.default=f},{"../core/sprites/canvas/CanvasTinter":104,"./Plane":168}],168:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}r.__esModule=!0;var s=t("./Mesh"),a=function(t){return t&&t.__esModule?t:{default:t}}(s),u=function(t){function e(r,o,s){n(this,e);var u=i(this,t.call(this,r));return u._ready=!0,u.verticesX=o||10,u.verticesY=s||10,u.drawMode=a.default.DRAW_MODES.TRIANGLES,u.refresh(),u}return o(e,t),e.prototype._refresh=function(){for(var t=this._texture,e=this.verticesX*this.verticesY,r=[],n=[],i=[],o=[],s=this.verticesX-1,a=this.verticesY-1,u=t.width/s,h=t.height/a,l=0;l1&&(l=1);var c=Math.sqrt(n*n+i*i),d=this._texture.height/2;n/=c,i/=c,n*=d,i*=d,o[h]=u.x+n,o[h+1]=u.y+i,o[h+2]=u.x-n,o[h+3]=u.y-i,e=u}},e.prototype.updateTransform=function(){this.autoUpdate&&this.refreshVertices(),this.containerUpdateTransform()},e}(a.default);r.default=u},{"./Mesh":166}],170:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.__esModule=!0;var i=t("../../core"),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(i),s=t("../Mesh"),a=function(t){return t&&t.__esModule?t:{default:t}}(s),u=function(){function t(e){n(this,t),this.renderer=e}return t.prototype.render=function(t){var e=this.renderer,r=e.context,n=t.worldTransform,i=e.resolution;e.roundPixels?r.setTransform(n.a*i,n.b*i,n.c*i,n.d*i,n.tx*i|0,n.ty*i|0):r.setTransform(n.a*i,n.b*i,n.c*i,n.d*i,n.tx*i,n.ty*i),e.context.globalAlpha=t.worldAlpha,e.setBlendMode(t.blendMode),t.drawMode===a.default.DRAW_MODES.TRIANGLE_MESH?this._renderTriangleMesh(t):this._renderTriangles(t)},t.prototype._renderTriangleMesh=function(t){for(var e=t.vertices.length/2,r=0;r0){var O=S/Math.abs(t.worldTransform.a),M=S/Math.abs(t.worldTransform.d),P=(_+b+x)/3,C=(T+w+E)/3,R=_-P,A=T-C,D=Math.sqrt(R*R+A*A);_=P+R/D*(D+O),T=C+A/D*(D+M),R=b-P,A=w-C,D=Math.sqrt(R*R+A*A),b=P+R/D*(D+O),w=C+A/D*(D+M),R=x-P,A=E-C,D=Math.sqrt(R*R+A*A),x=P+R/D*(D+O),E=C+A/D*(D+M)}i.save(),i.beginPath(),i.moveTo(_,T),i.lineTo(b,w),i.lineTo(x,E),i.closePath(),i.clip();var I=d*g+v*p+f*y-g*p-v*f-d*y,L=_*g+v*x+b*y-g*x-v*b-_*y,N=d*b+_*p+f*x-b*p-_*f-d*x,B=d*g*x+v*b*p+_*f*y-_*g*p-v*f*x-d*b*y,k=T*g+v*E+w*y-g*E-v*w-T*y,F=d*w+T*p+f*E-w*p-T*f-d*E,j=d*g*E+v*w*p+T*f*y-T*g*p-v*f*E-d*w*y;i.transform(L/I,k/I,N/I,F/I,B/I,j/I),i.drawImage(h,0,0,l*u.resolution,c*u.resolution,0,0,l,c),i.restore(),this.renderer.invalidateBlendMode()}},t.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.vertices,n=r.length/2;e.beginPath();for(var i=1;i0&&void 0!==arguments[0]?arguments[0]:1500,o=arguments[1],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16384,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];n(this,e);var h=i(this,t.call(this));return s>16384&&(s=16384),s>r&&(s=r),h._properties=[!1,!0,!1,!1,!1],h._maxSize=r,h._batchSize=s,h._glBuffers={},h._bufferUpdateIDs=[],h._updateID=0,h.interactiveChildren=!1,h.blendMode=u.BLEND_MODES.NORMAL,h.autoResize=a,h.roundPixels=!0,h.baseTexture=null,h.setProperties(o),h._tint=0,h.tintRgb=new Float32Array(4),h.tint=16777215,h}return o(e,t),e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},e.prototype.renderWebGL=function(t){var e=this ;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.hasLoaded||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&(o=r);var s=t._glBuffers[i.CONTEXT_UID];s||(s=t._glBuffers[i.CONTEXT_UID]=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.setBlendMode(u.utils.correctBlendMode(t.blendMode,a.premultipliedAlpha));var h=i.gl,l=t.worldTransform.copy(this.tempMatrix);l.prepend(i._activeRenderTarget.projectionMatrix),this.shader.uniforms.projectionMatrix=l.toArray(!0),this.shader.uniforms.uColor=u.utils.premultiplyRgba(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultipliedAlpha),this.shader.uniforms.uSampler=i.bindTexture(a);for(var c=!1,d=0,f=0;dn&&(p=n),f>=s.length){if(!t.autoResize)break;s.push(this._generateOneMoreBuffer(t))}var v=s[f];v.uploadDynamic(e,d,p);var g=t._bufferUpdateIDs[f]||0;c=c||v._updateID0?1:-1})},{}],179:[function(t,e,r){"use strict";Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t})},{}],180:[function(t,e,r){"use strict";var n=t("object-assign"),i=function(t){return t&&t.__esModule?t:{default:t}}(n);Object.assign||(Object.assign=i.default)},{"object-assign":6}],181:[function(t,e,r){"use strict";t("./Object.assign"),t("./requestAnimationFrame"),t("./Math.sign"),t("./Number.isInteger"),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array)},{"./Math.sign":178,"./Number.isInteger":179,"./Object.assign":180,"./requestAnimationFrame":182}],182:[function(t,e,r){(function(t){"use strict";if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var r=Date.now(),n=["ms","moz","webkit","o"],i=0;i=0;n--)this.add(t.children[n]);return this},t.prototype.destroy=function(){this.ticking&&v.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},t}();r.default=g},{"../core":65,"./limiters/CountLimiter":186}],184:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){if(e instanceof u.BaseTexture){var r=e.source,n=0===r.width?t.canvas.width:Math.min(t.canvas.width,r.width),i=0===r.height?t.canvas.height:Math.min(t.canvas.height,r.height);return t.ctx.drawImage(r,0,0,n,i,0,0,t.canvas.width,t.canvas.height),!0}return!1}r.__esModule=!0;var a=t("../../core"),u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(a),h=t("../BasePrepare"),l=function(t){return t&&t.__esModule?t:{default:t}}(h),c=16,d=function(t){function e(r){n(this,e);var o=i(this,t.call(this,r));return o.uploadHookHelper=o,o.canvas=document.createElement("canvas"),o.canvas.width=c,o.canvas.height=c,o.ctx=o.canvas.getContext("2d"),o.registerUploadHook(s),o}return o(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ctx=null,this.canvas=null},e}(l.default);r.default=d,u.CanvasRenderer.registerPlugin("prepare",d)},{"../../core":65,"../BasePrepare":183}],185:[function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}r.__esModule=!0;var i=t("./webgl/WebGLPrepare");Object.defineProperty(r,"webgl",{enumerable:!0,get:function(){return n(i).default}});var o=t("./canvas/CanvasPrepare");Object.defineProperty(r,"canvas",{enumerable:!0,get:function(){return n(o).default}});var s=t("./BasePrepare");Object.defineProperty(r,"BasePrepare",{enumerable:!0,get:function(){return n(s).default}});var a=t("./limiters/CountLimiter");Object.defineProperty(r,"CountLimiter",{enumerable:!0,get:function(){return n(a).default}});var u=t("./limiters/TimeLimiter");Object.defineProperty(r,"TimeLimiter",{enumerable:!0,get:function(){return n(u).default}})},{"./BasePrepare":183,"./canvas/CanvasPrepare":184,"./limiters/CountLimiter":186,"./limiters/TimeLimiter":187,"./webgl/WebGLPrepare":188}],186:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.__esModule=!0;var i=function(){function t(e){n(this,t),this.maxItemsPerFrame=e,this.itemsLeft=0}return t.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},t.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},t}();r.default=i},{}],187:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.__esModule=!0;var i=function(){function t(e){n(this,t),this.maxMilliseconds=e,this.frameStart=0}return t.prototype.beginFrame=function(){this.frameStart=Date.now()},t.prototype.allowedToUpload=function(){return Date.now()-this.frameStart0)return Promise.reject(new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled"));if(!1===this._preventCancel){var t=Le(r,e);return Me(r),t.then(function(){return qe(e,!0,!0)})}return Me(r),Promise.resolve(qe(e,!0,!0))}};function be(e,r){void 0===r&&(r=!1);var t=new Be(e);return t._forAuthorCode=r,t}function pe(e,r,t,o,n){void 0===o&&(o=1),void 0===n&&(n=function(){return 1});var i=Object.create(he.prototype);return me(i),Xe(i,Object.create(Ne.prototype),e,r,t,o,n),i}function me(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function ye(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")}function ve(e){return void 0!==e._reader}function we(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorReader")}function ge(e,r,t,o,n,i){var a=be(e),s=P(r),u=!1,l=Promise.resolve();return new Promise(function(c,f){var d;if(void 0!==i){if(d=function(){var t=new DOMException("Aborted","AbortError"),i=[];!1===o&&i.push(function(){return"writable"===r._state?E(r,t):Promise.resolve()}),!1===n&&i.push(function(){return"readable"===e._state?Pe(e,t):Promise.resolve()}),y(function(){return function(e,r,t){var o,n;void 0===t&&(t=void 0);var i=new Promise(function(e,r){o=e,n=r});return void 0===t&&(t=function(e){throw e}),p(e,function(e){try{var t=r(e);o(t)}catch(e){n(e)}},function(e){try{var r=t(e);o(r)}catch(e){n(e)}}),i}(i.map(function(e){return e()}),function(e){return e})},!0,t)},!0===i.aborted)return void d();i.addEventListener("abort",d)}if(b(e,a._closedPromise,function(e){!1===o?y(function(){return E(r,e)},!0,e):v(!0,e)}),b(r,s._closedPromise,function(r){!1===n?y(function(){return Pe(e,r)},!0,r):v(!0,r)}),function(e,r,t){"closed"===e._state?t():r.then(t).catch(m)}(e,a._closedPromise,function(){!1===t?y(function(){return function(e){var r=e._ownerWritableStream,t=r._state;return!0===W(r)||"closed"===t?Promise.resolve():"errored"===t?Promise.reject(r._storedError):F(e)}(s)}):v()}),!0===W(r)||"closed"===r._state){var h=new TypeError("the destination writable stream closed before all data could be piped to it");!1===n?y(function(){return Pe(e,h)},!0,h):v(!0,h)}function _(){var e=l;return l.then(function(){return e!==l?_():void 0})}function b(e,r,t){"errored"===e._state?t(e._storedError):r.catch(t).catch(m)}function y(e,t,o){function n(){e().then(function(){return w(t,o)},function(e){return w(!0,e)}).catch(m)}!0!==u&&(u=!0,"writable"===r._state&&!1===W(r)?_().then(n):n())}function v(e,t){!0!==u&&(u=!0,"writable"===r._state&&!1===W(r)?_().then(function(){return w(e,t)}).catch(m):w(e,t))}function w(e,r){D(s),Me(a),void 0!==i&&i.removeEventListener("abort",d),e?f(r):c(void 0)}new Promise(function(e,r){!function t(o){o?e():(!0===u?Promise.resolve(!0):s._readyPromise.then(function(){return De(a).then(function(e){var r=e.value,t=e.done;return!0===t||(l=N(s,r).catch(function(){}),!1)})})).then(t,r)}(!1)}).catch(m)})}function Se(e){return new Promise(function(r,t){var o={_resolve:r,_reject:t};e._reader._readIntoRequests.push(o)})}function Re(e){return new Promise(function(r,t){var o={_resolve:r,_reject:t};e._reader._readRequests.push(o)})}function Pe(e,r){return e._disturbed=!0,"closed"===e._state?Promise.resolve(void 0):"errored"===e._state?Promise.reject(e._storedError):(Te(e),e._readableStreamController[fe](r).then(function(){}))}function Te(e){e._state="closed";var r=e._reader;if(void 0!==r){if(Ie(r)){for(var t=0,o=r._readRequests;t0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Me(this)}},e}(),ze=function(){function e(e){if(!ye(e))throw new TypeError("ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a byte source");if(!1===er(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");if(ve(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");Fe(this,e),this._readIntoRequests=[]}return Object.defineProperty(e.prototype,"closed",{get:function(){return ke(this)?this._closedPromise:Promise.reject(Tr("closed"))},enumerable:!0,configurable:!0}),e.prototype.cancel=function(e){return ke(this)?void 0===this._ownerReadableStream?Promise.reject(vr("cancel")):Le(this,e):Promise.reject(Tr("cancel"))},e.prototype.read=function(e){return ke(this)?void 0===this._ownerReadableStream?Promise.reject(vr("read from")):ArrayBuffer.isView(e)?(e.buffer,0===e.byteLength?Promise.reject(new TypeError("view must have non-zero byteLength")):function(e,r){var t=e._ownerReadableStream;if(t._disturbed=!0,"errored"===t._state)return Promise.reject(t._storedError);return function(e,r){var t=e._controlledReadableByteStream,o=1;r.constructor!==DataView&&(o=r.constructor.BYTES_PER_ELEMENT);var n=r.constructor,i={buffer:h(r.buffer),byteOffset:r.byteOffset,byteLength:r.byteLength,bytesFilled:0,elementSize:o,ctor:n,readerType:"byob"};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(i),Se(t);if("closed"===t._state){var a=new n(i.buffer,i.byteOffset,0);return Promise.resolve(qe(a,!0,t._reader._forAuthorCode))}if(e._queueTotalSize>0){if(!0===ar(e,i)){var s=nr(i);return ur(e),Promise.resolve(qe(s,!1,t._reader._forAuthorCode))}if(!0===e._closeRequested){var u=new TypeError("Insufficient bytes to fill elements in the given buffer");return _r(e,u),Promise.reject(u)}}e._pendingPullIntos.push(i);var l=Se(t);return tr(e),l}(t._readableStreamController,r)}(this,e)):Promise.reject(new TypeError("view must be an array buffer view")):Promise.reject(Tr("read"))},e.prototype.releaseLock=function(){if(!ke(this))throw Tr("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");Me(this)}},e}();function ke(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")}function Ie(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")}function Fe(e,r){e._forAuthorCode=!0,e._ownerReadableStream=r,r._reader=e,"readable"===r._state?gr(e):"closed"===r._state?function(e){gr(e),Pr(e)}(e):Sr(e,r._storedError)}function Le(e,r){return Pe(e._ownerReadableStream,r)}function Me(e){"readable"===e._ownerReadableStream._state?Rr(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,r){Sr(e,r)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function De(e){var r=e._ownerReadableStream;return r._disturbed=!0,"closed"===r._state?Promise.resolve(qe(void 0,!0,e._forAuthorCode)):"errored"===r._state?Promise.reject(r._storedError):r._readableStreamController[de]()}var Ne=function(){function e(){throw new TypeError}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!1===xe(this))throw qr("desiredSize");return Je(this)},enumerable:!0,configurable:!0}),e.prototype.close=function(){if(!1===xe(this))throw qr("close");if(!1===Ke(this))throw new TypeError("The stream is not in a state that permits close");Ve(this)},e.prototype.enqueue=function(e){if(!1===xe(this))throw qr("enqueue");if(!1===Ke(this))throw new TypeError("The stream is not in a state that permits enqueue");return Qe(this,e)},e.prototype.error=function(e){if(!1===xe(this))throw qr("error");Ge(this,e)},e.prototype[fe]=function(e){w(this);var r=this._cancelAlgorithm(e);return Ue(this),r},e.prototype[de]=function(){var e=this._controlledReadableStream;if(this._queue.length>0){var r=y(this);return!0===this._closeRequested&&0===this._queue.length?(Ue(this),Te(e)):Ye(this),Promise.resolve(qe(r,!1,e._reader._forAuthorCode))}var t=Re(e);return Ye(this),t},e}();function xe(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")}function Ye(e){!1!==He(e)&&(!0!==e._pulling?(e._pulling=!0,e._pullAlgorithm().then(function(){e._pulling=!1,!0===e._pullAgain&&(e._pullAgain=!1,Ye(e))},function(r){Ge(e,r)}).catch(m)):e._pullAgain=!0)}function He(e){var r=e._controlledReadableStream;return!1!==Ke(e)&&(!1!==e._started&&(!0===ve(r)&&Ae(r)>0||Je(e)>0))}function Ue(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Ve(e){var r=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(Ue(e),Te(r))}function Qe(e,r){var t=e._controlledReadableStream;if(!0===ve(t)&&Ae(t)>0)Ee(t,r,!1);else{var o=void 0;try{o=e._strategySizeAlgorithm(r)}catch(r){throw Ge(e,r),r}try{v(e,r,o)}catch(r){throw Ge(e,r),r}}Ye(e)}function Ge(e,r){var t=e._controlledReadableStream;"readable"===t._state&&(w(e),Ue(e),je(t,r))}function Je(e){var r=e._controlledReadableStream._state;return"errored"===r?null:"closed"===r?0:e._strategyHWM-e._queueTotalSize}function Ke(e){var r=e._controlledReadableStream._state;return!1===e._closeRequested&&"readable"===r}function Xe(e,r,t,o,n,i,a){r._controlledReadableStream=e,r._queue=void 0,r._queueTotalSize=void 0,w(r),r._started=!1,r._closeRequested=!1,r._pullAgain=!1,r._pulling=!1,r._strategySizeAlgorithm=a,r._strategyHWM=i,r._pullAlgorithm=o,r._cancelAlgorithm=n,e._readableStreamController=r;var s=t();Promise.resolve(s).then(function(){r._started=!0,Ye(r)},function(e){Ge(r,e)}).catch(m)}var Ze=function(){function e(){throw new TypeError("ReadableStreamBYOBRequest cannot be used directly")}return Object.defineProperty(e.prototype,"view",{get:function(){if(!1===rr(this))throw jr("view");return this._view},enumerable:!0,configurable:!0}),e.prototype.respond=function(e){if(!1===rr(this))throw jr("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(e,r){if(!1===u(r=Number(r)))throw new RangeError("bytesWritten must be a finite");fr(e,r)}(this._associatedReadableByteStreamController,e)},e.prototype.respondWithNewView=function(e){if(!1===rr(this))throw jr("respond");if(void 0===this._associatedReadableByteStreamController)throw new TypeError("This BYOB request has been invalidated");if(!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");e.buffer,function(e,r){var t=e._pendingPullIntos[0];if(t.byteOffset+t.bytesFilled!==r.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(t.byteLength!==r.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");t.buffer=r.buffer,fr(e,r.byteLength)}(this._associatedReadableByteStreamController,e)},e}(),$e=function(){function e(){throw new TypeError("ReadableByteStreamController constructor cannot be used directly")}return Object.defineProperty(e.prototype,"byobRequest",{get:function(){if(!1===er(this))throw Er("byobRequest");if(void 0===this._byobRequest&&this._pendingPullIntos.length>0){var e=this._pendingPullIntos[0],r=new Uint8Array(e.buffer,e.byteOffset+e.bytesFilled,e.byteLength-e.bytesFilled),t=Object.create(Ze.prototype);!function(e,r,t){e._associatedReadableByteStreamController=r,e._view=t}(t,this,r),this._byobRequest=t}return this._byobRequest},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!1===er(this))throw Er("desiredSize");return br(this)},enumerable:!0,configurable:!0}),e.prototype.close=function(){if(!1===er(this))throw Er("close");if(!0===this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");var e=this._controlledReadableByteStream._state;if("readable"!==e)throw new TypeError("The stream (in "+e+" state) is not in the readable state and cannot be closed");!function(e){var r=e._controlledReadableByteStream;if(e._queueTotalSize>0)return void(e._closeRequested=!0);if(e._pendingPullIntos.length>0){var t=e._pendingPullIntos[0];if(t.bytesFilled>0){var o=new TypeError("Insufficient bytes to fill elements in the given buffer");throw _r(e,o),o}}hr(e),Te(r)}(this)},e.prototype.enqueue=function(e){if(!1===er(this))throw Er("enqueue");if(!0===this._closeRequested)throw new TypeError("stream is closed or draining");var r=this._controlledReadableByteStream._state;if("readable"!==r)throw new TypeError("The stream (in "+r+" state) is not in the readable state and cannot be enqueued to");if(!ArrayBuffer.isView(e))throw new TypeError("You can only enqueue array buffer views when using a ReadableByteStreamController");e.buffer,function(e,r){var t=e._controlledReadableByteStream,o=r.buffer,n=r.byteOffset,i=r.byteLength,a=h(o);if(!0===We(t))if(0===Ae(t))ir(e,a,n,i);else{var s=new Uint8Array(a,n,i);Ee(t,s,!1)}else!0===Oe(t)?(ir(e,a,n,i),cr(e)):ir(e,a,n,i);tr(e)}(this,e)},e.prototype.error=function(e){if(!1===er(this))throw Er("error");_r(this,e)},e.prototype[fe]=function(e){this._pendingPullIntos.length>0&&(this._pendingPullIntos[0].bytesFilled=0);w(this);var r=this._cancelAlgorithm(e);return hr(this),r},e.prototype[de]=function(){var e=this._controlledReadableByteStream;if(this._queueTotalSize>0){var r=this._queue.shift();this._queueTotalSize-=r.byteLength,ur(this);var t=void 0;try{t=new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}catch(e){return Promise.reject(e)}return Promise.resolve(qe(t,!1,e._reader._forAuthorCode))}var o=this._autoAllocateChunkSize;if(void 0!==o){var n=void 0;try{n=new ArrayBuffer(o)}catch(e){return Promise.reject(e)}var i={buffer:n,byteOffset:0,byteLength:o,bytesFilled:0,elementSize:1,ctor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(i)}var a=Re(e);return tr(this),a},e}();function er(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")}function rr(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")}function tr(e){!1!==function(e){var r=e._controlledReadableByteStream;if("readable"!==r._state)return!1;if(!0===e._closeRequested)return!1;if(!1===e._started)return!1;if(!0===We(r)&&Ae(r)>0)return!0;if(!0===Oe(r)&&Ce(r)>0)return!0;if(br(e)>0)return!0;return!1}(e)&&(!0!==e._pulling?(e._pulling=!0,e._pullAlgorithm().then(function(){e._pulling=!1,!0===e._pullAgain&&(e._pullAgain=!1,tr(e))},function(r){_r(e,r)}).catch(m)):e._pullAgain=!0)}function or(e,r){var t=!1;"closed"===e._state&&(t=!0);var o=nr(r);"default"===r.readerType?Ee(e,o,t):function(e,r,t){var o=e._reader;o._readIntoRequests.shift()._resolve(qe(r,t,o._forAuthorCode))}(e,o,t)}function nr(e){var r=e.bytesFilled,t=e.elementSize;return new e.ctor(e.buffer,e.byteOffset,r/t)}function ir(e,r,t,o){e._queue.push({buffer:r,byteOffset:t,byteLength:o}),e._queueTotalSize+=o}function ar(e,r){var t=r.elementSize,o=r.bytesFilled-r.bytesFilled%t,n=Math.min(e._queueTotalSize,r.byteLength-r.bytesFilled),i=r.bytesFilled+n,a=i-i%t,u=n,l=!1;a>o&&(u=a-r.bytesFilled,l=!0);for(var c=e._queue;u>0;){var f=c[0],d=Math.min(u,f.byteLength),h=r.byteOffset+r.bytesFilled;s(r.buffer,h,f.buffer,f.byteOffset,d),f.byteLength===d?c.shift():(f.byteOffset+=d,f.byteLength-=d),e._queueTotalSize-=d,sr(e,d,r),u-=d}return l}function sr(e,r,t){lr(e),t.bytesFilled+=r}function ur(e){0===e._queueTotalSize&&!0===e._closeRequested?(hr(e),Te(e._controlledReadableByteStream)):tr(e)}function lr(e){void 0!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=void 0,e._byobRequest=void 0)}function cr(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;var r=e._pendingPullIntos[0];!0===ar(e,r)&&(dr(e),or(e._controlledReadableByteStream,r))}}function fr(e,r){var t=e._pendingPullIntos[0];if("closed"===e._controlledReadableByteStream._state){if(0!==r)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream");!function(e,r){r.buffer=h(r.buffer);var t=e._controlledReadableByteStream;if(!0===Oe(t))for(;Ce(t)>0;)or(t,dr(e))}(e,t)}else!function(e,r,t){if(t.bytesFilled+r>t.byteLength)throw new RangeError("bytesWritten out of range");if(sr(e,r,t),!(t.bytesFilled0){var n=t.byteOffset+t.bytesFilled,i=t.buffer.slice(n-o,n);ir(e,i,0,i.byteLength)}t.buffer=h(t.buffer),t.bytesFilled-=o,or(e._controlledReadableByteStream,t),cr(e)}}(e,r,t);tr(e)}function dr(e){var r=e._pendingPullIntos.shift();return lr(e),r}function hr(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function _r(e,r){var t=e._controlledReadableByteStream;"readable"===t._state&&(!function(e){lr(e),e._pendingPullIntos=[]}(e),w(e),hr(e),je(t,r))}function br(e){var r=e._controlledReadableByteStream._state;return"errored"===r?null:"closed"===r?0:e._strategyHWM-e._queueTotalSize}function pr(e){if("object"!=typeof e||null===e)return!1;var r=Object.getOwnPropertyDescriptor(AbortSignal.prototype,"aborted").get;try{return r.call(e),!0}catch(e){return!1}}function mr(e){return new TypeError("ReadableStream.prototype."+e+" can only be used on a ReadableStream")}function yr(e){return new TypeError("ReadableStreamAsyncIterator."+e+" can only be used on a ReadableSteamAsyncIterator")}function vr(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function wr(e){return new TypeError("ReadableStreamDefaultReader.prototype."+e+" can only be used on a ReadableStreamDefaultReader")}function gr(e){e._closedPromise=new Promise(function(r,t){e._closedPromise_resolve=r,e._closedPromise_reject=t})}function Sr(e,r){gr(e),Rr(e,r)}function Rr(e,r){e._closedPromise.catch(function(){}),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0}function Pr(e){e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0}function Tr(e){return new TypeError("ReadableStreamBYOBReader.prototype."+e+" can only be used on a ReadableStreamBYOBReader")}function qr(e){return new TypeError("ReadableStreamDefaultController.prototype."+e+" can only be used on a ReadableStreamDefaultController")}function jr(e){return new TypeError("ReadableStreamBYOBRequest.prototype."+e+" can only be used on a ReadableStreamBYOBRequest")}function Er(e){return new TypeError("ReadableByteStreamController.prototype."+e+" can only be used on a ReadableByteStreamController")}var Cr=function(){function e(e){i(this,"highWaterMark",e.highWaterMark)}return e.prototype.size=function(e){return e.byteLength},e}(),Ar=function(){function e(e){i(this,"highWaterMark",e.highWaterMark)}return e.prototype.size=function(){return 1},e}(),Or=function(){function e(e,r,t){void 0===e&&(e={}),void 0===r&&(r={}),void 0===t&&(t={});var o=r.size,n=r.highWaterMark,i=t.size,a=t.highWaterMark;if(void 0!==e.writableType)throw new RangeError("Invalid writable type specified");var s=b(o);if(void 0===n&&(n=1),n=_(n),void 0!==e.readableType)throw new RangeError("Invalid readable type specified");var u,l=b(i);void 0===a&&(a=0),a=_(a),function(e,r,t,o,n,i){function a(){return r}e._writable=function(e,r,t,o,n,i){void 0===n&&(n=1),void 0===i&&(i=function(){return 1});var a=Object.create(R.prototype);return T(a),Y(a,Object.create(x.prototype),e,r,t,o,n,i),a}(a,function(r){return function(e,r){var t=e._transformStreamController;if(!0===e._backpressure){var o=e._backpressureChangePromise;return o.then(function(){var o=e._writable,n=o._state;if("erroring"===n)throw o._storedError;return Dr(t,r)})}return Dr(t,r)}(e,r)},function(){return function(e){var r=e._readable,t=e._transformStreamController,o=t._flushAlgorithm();return Lr(t),o.then(function(){if("errored"===r._state)throw r._storedError;var e=r._readableStreamController;!0===Ke(e)&&Ve(e)}).catch(function(t){throw Br(e,t),r._storedError})}(e)},function(r){return function(e,r){return Br(e,r),Promise.resolve()}(e,r)},t,o),e._readable=pe(a,function(){return function(e){return kr(e,!1),e._backpressureChangePromise}(e)},function(r){return zr(e,r),Promise.resolve()},n,i),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,kr(e,!0),e._transformStreamController=void 0}(this,new Promise(function(e){u=e}),n,s,a,l),function(e,r){var t=Object.create(Ir.prototype),o=function(e){try{return Mr(t,e),Promise.resolve()}catch(e){return Promise.reject(e)}},n=r.transform;if(void 0!==n){if("function"!=typeof n)throw new TypeError("transform is not a method");o=function(e){return d(n,r,[e,t])}}var i=c(r,"flush",0,[t]);!function(e,r,t,o){r._controlledTransformStream=e,e._transformStreamController=r,r._transformAlgorithm=t,r._flushAlgorithm=o}(e,t,o,i)}(this,e);var h=f(e,"start",[this._transformStreamController]);u(h)}return Object.defineProperty(e.prototype,"readable",{get:function(){if(!1===Wr(this))throw xr("readable");return this._readable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"writable",{get:function(){if(!1===Wr(this))throw xr("writable");return this._writable},enumerable:!0,configurable:!0}),e}();function Wr(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")}function Br(e,r){Ge(e._readable._readableStreamController,r),zr(e,r)}function zr(e,r){Lr(e._transformStreamController),Q(e._writable._writableStreamController,r),!0===e._backpressure&&kr(e,!1)}function kr(e,r){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=new Promise(function(r){e._backpressureChangePromise_resolve=r}),e._backpressure=r}var Ir=function(){function e(){throw new TypeError("TransformStreamDefaultController instances cannot be created directly")}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!1===Fr(this))throw Nr("desiredSize");return Je(this._controlledTransformStream._readable._readableStreamController)},enumerable:!0,configurable:!0}),e.prototype.enqueue=function(e){if(!1===Fr(this))throw Nr("enqueue");Mr(this,e)},e.prototype.error=function(e){if(!1===Fr(this))throw Nr("error");!function(e,r){Br(e._controlledTransformStream,r)}(this,e)},e.prototype.terminate=function(){if(!1===Fr(this))throw Nr("terminate");!function(e){var r=e._controlledTransformStream,t=r._readable._readableStreamController;!0===Ke(t)&&Ve(t);var o=new TypeError("TransformStream terminated");zr(r,o)}(this)},e}();function Fr(e){return!!n(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")}function Lr(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Mr(e,r){var t=e._controlledTransformStream,o=t._readable._readableStreamController;if(!1===Ke(o))throw new TypeError("Readable side is not in a state that permits enqueue");try{Qe(o,r)}catch(e){throw zr(t,e),t._readable._storedError}(function(e){return!0!==He(e)})(o)!==t._backpressure&&kr(t,!0)}function Dr(e,r){return e._transformAlgorithm(r).catch(function(r){throw Br(e._controlledTransformStream,r),r})}function Nr(e){return new TypeError("TransformStreamDefaultController.prototype."+e+" can only be used on a TransformStreamDefaultController")}function xr(e){return new TypeError("TransformStream.prototype."+e+" can only be used on a TransformStream")}var Yr=Object.assign||function(e){for(var r=[],t=1;t\d+)/all-usernames$', authentication.all_usernames), - url(r'^permissions$', authentication.user_project_permissions), - url(r'^classinstance/(?P\d+)/permissions$', authentication.get_object_permissions), - url(r'^register$', authentication.register, name="register"), + re_path(r'^accounts/login$', authentication.login_user), + re_path(r'^accounts/logout$', authentication.logout_user), + re_path(r'^accounts/anonymous-api-token$', authentication.get_anonymous_token), + re_path(r'^accounts/remote-login-api-token$', authentication.get_remote_login_token), + re_path(r'^accounts/is-remote-login$', authentication.is_remote_login), + re_path(r'^accounts/(?P\d+)/all-usernames$', authentication.all_usernames), + re_path(r'^permissions$', authentication.user_project_permissions), + re_path(r'^classinstance/(?P\d+)/permissions$', authentication.get_object_permissions), + re_path(r'^register$', authentication.register, name="register"), path('activate///', authentication.activate, name='activate'), ] # Users urlpatterns += [ - url(r'^user-list$', user.user_list), - url(r'^user-table-list$', user.user_list_datatable), - url(r'^user-profile/update$', user.update_user_profile), - url(r'^user/password_change/$', user.NonAnonymousPasswordChangeView.as_view( + re_path(r'^user-list$', user.user_list), + re_path(r'^user-table-list$', user.user_list_datatable), + re_path(r'^user-profile/update$', user.update_user_profile), + re_path(r'^user/password_change/$', user.NonAnonymousPasswordChangeView.as_view( success_url=reverse_lazy('catmaid:home'), raise_exception=False)), ] # Groups urlpatterns += [ - url(r'^groups/$', group.GroupList.as_view()), - url(r'^(?P\d+)/groups/memberships/$', group.GroupMemberships.as_view()), + re_path(r'^groups/$', group.GroupList.as_view()), + re_path(r'^(?P\d+)/groups/memberships/$', group.GroupMemberships.as_view()), ] # Log urlpatterns += [ - url(r'^(?P\d+)/logs/list$', log.list_logs), - url(r'^log/(?P(info|error|debug))$', log.log_frontent_event), + re_path(r'^(?P\d+)/logs/list$', log.list_logs), + re_path(r'^log/(?P(info|error|debug))$', log.log_frontent_event), ] # Transaction history urlpatterns += [ - url(r'^(?P\d+)/transactions/$', transaction.transaction_collection), - url(r'^(?P\d+)/transactions/location$', transaction.get_location), + re_path(r'^(?P\d+)/transactions/$', transaction.transaction_collection), + re_path(r'^(?P\d+)/transactions/location$', transaction.get_location), ] # Project permissions urlpatterns += [ - url(r'^permissions/$', authentication.list_project_permissions), - url(r'^(?P\d+)/permissions/project-user$', authentication.project_user_permission_set), - url(r'^(?P\d+)/permissions/project-group$', authentication.project_group_permission_set), + re_path(r'^permissions/$', authentication.list_project_permissions), + re_path(r'^(?P\d+)/permissions/project-user$', authentication.project_user_permission_set), + re_path(r'^(?P\d+)/permissions/project-group$', authentication.project_group_permission_set), ] # Project permissions urlpatterns += [ - url(r'^(?P\d+)/project-tokens/$', project_token.ProjectTokenList.as_view()), - url(r'^(?P\d+)/user-project-tokens/$', project_token.UserProjectTokenList.as_view()), - url(r'^(?P\d+)/project-tokens/revoke$', project_token.ProjectTokenRevoker.as_view()), - url(r'^project-tokens/apply$', project_token.ProjectTokenApplicator.as_view()), + re_path(r'^(?P\d+)/project-tokens/$', project_token.ProjectTokenList.as_view()), + re_path(r'^(?P\d+)/user-project-tokens/$', project_token.UserProjectTokenList.as_view()), + re_path(r'^(?P\d+)/project-tokens/revoke$', project_token.ProjectTokenRevoker.as_view()), + re_path(r'^project-tokens/apply$', project_token.ProjectTokenApplicator.as_view()), ] # Messages urlpatterns += [ - url(r'^messages/list$', message.list_messages), - url(r'^messages/(?P\d+)/mark_read$', message.read_message), - url(r'^messages/latestunreaddate', message.get_latest_unread_date), + re_path(r'^messages/list$', message.list_messages), + re_path(r'^messages/(?P\d+)/mark_read$', message.read_message), + re_path(r'^messages/latestunreaddate', message.get_latest_unread_date), ] # CATMAID client datastore and data access urlpatterns += [ - url(r'^client/datastores/$', client.ClientDatastoreList.as_view()), - url(r'^client/datastores/(?P[\w-]+)$', client.ClientDatastoreDetail.as_view()), - url(r'^client/datastores/(?P[\w-]+)/$', client.ClientDataList.as_view()), + re_path(r'^client/datastores/$', client.ClientDatastoreList.as_view()), + re_path(r'^client/datastores/(?P[\w-]+)$', client.ClientDatastoreDetail.as_view()), + re_path(r'^client/datastores/(?P[\w-]+)/$', client.ClientDataList.as_view()), ] # General project model access urlpatterns += [ - url(r'^projects/$', project.projects), - url(r'^projects/export$', project.export_projects), - url(r'^(?P\d+)/$', project.ProjectDetail.as_view()), - url(r'^(?P\d+)/interpolatable-sections/$', project.interpolatable_sections), - url(r'^(?P\d+)/fork$', project.fork), - url(r'^(?P\d+)/favorite$', project.ProjectFavorite.as_view()), + re_path(r'^projects/$', project.projects), + re_path(r'^projects/export$', project.export_projects), + re_path(r'^(?P\d+)/$', project.ProjectDetail.as_view()), + re_path(r'^(?P\d+)/interpolatable-sections/$', project.interpolatable_sections), + re_path(r'^(?P\d+)/fork$', project.fork), + re_path(r'^(?P\d+)/favorite$', project.ProjectFavorite.as_view()), ] # Deep links urlpatterns += [ - url(r'^(?P\d+)/links/$', deeplink.DeepLinkList.as_view()), - url(r'^(?P\d+)/links/(?P[0-9A-Za-z_\-]+)$', deeplink.DeepLinkSelector.as_view()), - url(r'^(?P\d+)/links/(?P[0-9A-Za-z_\-]+)/details$', deeplink.DeepLinkDetails.as_view()), - url(r'^(?P\d+)/links/by-id/(?P[0-9]+)$', deeplink.DeepLinkByIdSelector.as_view()), + re_path(r'^(?P\d+)/links/$', deeplink.DeepLinkList.as_view()), + re_path(r'^(?P\d+)/links/(?P[0-9A-Za-z_\-]+)$', deeplink.DeepLinkSelector.as_view()), + re_path(r'^(?P\d+)/links/(?P[0-9A-Za-z_\-]+)/details$', deeplink.DeepLinkDetails.as_view()), + re_path(r'^(?P\d+)/links/by-id/(?P[0-9]+)$', deeplink.DeepLinkByIdSelector.as_view()), ] # General stack model access urlpatterns += [ - url(r'^(?P\d+)/stacks$', stack.stacks), - url(r'^(?P\d+)/stack/(?P\d+)/info$', stack.stack_info), - url(r'^(?P\d+)/stack/(?P\d+)/groups$', stack.stack_groups), + re_path(r'^(?P\d+)/stacks$', stack.stacks), + re_path(r'^(?P\d+)/stack/(?P\d+)/info$', stack.stack_info), + re_path(r'^(?P\d+)/stack/(?P\d+)/groups$', stack.stack_groups), ] # General stack group access urlpatterns += [ - url(r'^(?P\d+)/stackgroup/(?P\d+)/info$', stackgroup.get_stackgroup_info), + re_path(r'^(?P\d+)/stackgroup/(?P\d+)/info$', stackgroup.get_stackgroup_info), ] # Tile access urlpatterns += [ - url(r'^(?P\d+)/stack/(?P\d+)/tile$', tile.get_tile), - url(r'^(?P\d+)/stack/(?P\d+)/put_tile$', tile.put_tile), + re_path(r'^(?P\d+)/stack/(?P\d+)/tile$', tile.get_tile), + re_path(r'^(?P\d+)/stack/(?P\d+)/put_tile$', tile.put_tile), ] # Tracing general urlpatterns += [ - url(r'^(?P\d+)/tracing/setup/rebuild$', tracing.rebuild_tracing_setup_view), - url(r'^(?P\d+)/tracing/setup/test$', tracing.check_tracing_setup_view), - url(r'^(?P\d+)/tracing/setup/validate$', tracing.validate_tracing_setup), + re_path(r'^(?P\d+)/tracing/setup/rebuild$', tracing.rebuild_tracing_setup_view), + re_path(r'^(?P\d+)/tracing/setup/test$', tracing.check_tracing_setup_view), + re_path(r'^(?P\d+)/tracing/setup/validate$', tracing.validate_tracing_setup), ] # Reconstruction sampling urlpatterns += [ - url(r'^(?P\d+)/samplers/$', sampler.list_samplers), - url(r'^(?P\d+)/samplers/add$', sampler.add_sampler), - url(r'^(?P\d+)/samplers/domains/types/$', sampler.list_domain_types), - url(r'^(?P\d+)/samplers/domains/intervals/states/$', sampler.list_interval_states), - url(r'^(?P\d+)/samplers/domains/(?P\d+)/details$', sampler.get_domain_details), - url(r'^(?P\d+)/samplers/domains/(?P\d+)/intervals/$', sampler.list_domain_intervals), - url(r'^(?P\d+)/samplers/domains/(?P\d+)/intervals/add-all$', sampler.add_all_intervals), - url(r'^(?P\d+)/samplers/domains/intervals/(?P\d+)/details$', sampler.get_interval_details), - url(r'^(?P\d+)/samplers/domains/intervals/(?P\d+)/set-state$', sampler.set_interval_state), - url(r'^(?P\d+)/samplers/(?P\d+)/$', sampler.SamplerDetail.as_view()), - url(r'^(?P\d+)/samplers/(?P\d+)/delete$', sampler.delete_sampler), - url(r'^(?P\d+)/samplers/(?P\d+)/domains/$', sampler.list_sampler_domains), - url(r'^(?P\d+)/samplers/(?P\d+)/domains/add$', sampler.add_sampler_domain), - url(r'^(?P\d+)/samplers/(?P\d+)/domains/add-all$', sampler.add_multiple_sampler_domains), - url(r'^(?P\d+)/samplers/connectors/$', sampler.list_connectors), - url(r'^(?P\d+)/samplers/connectors/states/$', sampler.list_connector_states), - url(r'^(?P\d+)/samplers/domains/intervals/(?P\d+)/connectors/(?P\d+)/set-state$', + re_path(r'^(?P\d+)/samplers/$', sampler.list_samplers), + re_path(r'^(?P\d+)/samplers/add$', sampler.add_sampler), + re_path(r'^(?P\d+)/samplers/domains/types/$', sampler.list_domain_types), + re_path(r'^(?P\d+)/samplers/domains/intervals/states/$', sampler.list_interval_states), + re_path(r'^(?P\d+)/samplers/domains/(?P\d+)/details$', sampler.get_domain_details), + re_path(r'^(?P\d+)/samplers/domains/(?P\d+)/intervals/$', sampler.list_domain_intervals), + re_path(r'^(?P\d+)/samplers/domains/(?P\d+)/intervals/add-all$', sampler.add_all_intervals), + re_path(r'^(?P\d+)/samplers/domains/intervals/(?P\d+)/details$', sampler.get_interval_details), + re_path(r'^(?P\d+)/samplers/domains/intervals/(?P\d+)/set-state$', sampler.set_interval_state), + re_path(r'^(?P\d+)/samplers/(?P\d+)/$', sampler.SamplerDetail.as_view()), + re_path(r'^(?P\d+)/samplers/(?P\d+)/delete$', sampler.delete_sampler), + re_path(r'^(?P\d+)/samplers/(?P\d+)/domains/$', sampler.list_sampler_domains), + re_path(r'^(?P\d+)/samplers/(?P\d+)/domains/add$', sampler.add_sampler_domain), + re_path(r'^(?P\d+)/samplers/(?P\d+)/domains/add-all$', sampler.add_multiple_sampler_domains), + re_path(r'^(?P\d+)/samplers/connectors/$', sampler.list_connectors), + re_path(r'^(?P\d+)/samplers/connectors/states/$', sampler.list_connector_states), + re_path(r'^(?P\d+)/samplers/domains/intervals/(?P\d+)/connectors/(?P\d+)/set-state$', sampler.set_connector_state), - url(r'^(?P\d+)/samplers/states/$', sampler.list_sampler_states), + re_path(r'^(?P\d+)/samplers/states/$', sampler.list_sampler_states), ] # Statistics urlpatterns += [ - url(r'^(?P\d+)/stats/aggregates$', stats.ProjectAggStats.as_view()), - url(r'^(?P\d+)/stats/cable-length$', stats.stats_cable_length), - url(r'^(?P\d+)/stats/nodecount$', stats.stats_nodecount), - url(r'^(?P\d+)/stats/editor$', stats.stats_editor), - url(r'^(?P\d+)/stats/summary$', stats.stats_summary), - url(r'^(?P\d+)/stats/history$', stats.stats_history), - url(r'^(?P\d+)/stats/user-history$', stats.stats_user_history), - url(r'^(?P\d+)/stats/user-activity$', stats.stats_user_activity), - url(r'^(?P\d+)/stats/server$', stats.ServerStats.as_view()), + re_path(r'^(?P\d+)/stats/aggregates$', stats.ProjectAggStats.as_view()), + re_path(r'^(?P\d+)/stats/cable-length$', stats.stats_cable_length), + re_path(r'^(?P\d+)/stats/nodecount$', stats.stats_nodecount), + re_path(r'^(?P\d+)/stats/editor$', stats.stats_editor), + re_path(r'^(?P\d+)/stats/summary$', stats.stats_summary), + re_path(r'^(?P\d+)/stats/history$', stats.stats_history), + re_path(r'^(?P\d+)/stats/user-history$', stats.stats_user_history), + re_path(r'^(?P\d+)/stats/user-activity$', stats.stats_user_activity), + re_path(r'^(?P\d+)/stats/server$', stats.ServerStats.as_view()), ] # Annotations urlpatterns += [ - url(r'^(?P\d+)/annotations/$', annotation.list_annotations), - url(r'^(?P\d+)/annotations/query$', annotation.annotations_for_entities), - url(r'^(?P\d+)/annotations/forskeletons$', annotation.annotations_for_skeletons), - url(r'^(?P\d+)/annotations/table-list$', annotation.list_annotations_datatable), - url(r'^(?P\d+)/annotations/add$', record_view("annotations.add")(annotation.annotate_entities)), - url(r'^(?P\d+)/annotations/add-neuron-names$', record_view("annotations.addneuronname")(annotation.add_neuron_name_annotations)), - url(r'^(?P\d+)/annotations/remove$', record_view("annotations.remove")(annotation.remove_annotations)), - url(r'^(?P\d+)/annotations/replace$', record_view("annotations.replace")(annotation.replace_annotations)), - url(r'^(?P\d+)/annotations/(?P\d+)/remove$', record_view("annotations.remove")(annotation.remove_annotation)), - url(r'^(?P\d+)/annotations/query-targets$', annotation.query_annotated_classinstances), + re_path(r'^(?P\d+)/annotations/$', annotation.list_annotations), + re_path(r'^(?P\d+)/annotations/query$', annotation.annotations_for_entities), + re_path(r'^(?P\d+)/annotations/forskeletons$', annotation.annotations_for_skeletons), + re_path(r'^(?P\d+)/annotations/table-list$', annotation.list_annotations_datatable), + re_path(r'^(?P\d+)/annotations/add$', record_view("annotations.add")(annotation.annotate_entities)), + re_path(r'^(?P\d+)/annotations/add-neuron-names$', record_view("annotations.addneuronname")(annotation.add_neuron_name_annotations)), + re_path(r'^(?P\d+)/annotations/remove$', record_view("annotations.remove")(annotation.remove_annotations)), + re_path(r'^(?P\d+)/annotations/replace$', record_view("annotations.replace")(annotation.replace_annotations)), + re_path(r'^(?P\d+)/annotations/(?P\d+)/remove$', record_view("annotations.remove")(annotation.remove_annotation)), + re_path(r'^(?P\d+)/annotations/query-targets$', annotation.query_annotated_classinstances), ] # Text labels urlpatterns += [ - url(r'^(?P\d+)/textlabel/create$', record_view("textlabels.create")(textlabel.create_textlabel)), - url(r'^(?P\d+)/textlabel/delete$', record_view("textlabels.delete")(textlabel.delete_textlabel)), - url(r'^(?P\d+)/textlabel/update$', record_view("textlabels.update")(textlabel.update_textlabel)), - url(r'^(?P\d+)/textlabel/all', textlabel.textlabels), + re_path(r'^(?P\d+)/textlabel/create$', record_view("textlabels.create")(textlabel.create_textlabel)), + re_path(r'^(?P\d+)/textlabel/delete$', record_view("textlabels.delete")(textlabel.delete_textlabel)), + re_path(r'^(?P\d+)/textlabel/update$', record_view("textlabels.update")(textlabel.update_textlabel)), + re_path(r'^(?P\d+)/textlabel/all', textlabel.textlabels), ] # Treenode labels urlpatterns += [ - url(r'^(?P\d+)/labels/$', label.labels_all), - url(r'^(?P\d+)/labels/detail$', label.labels_all_detail), - url(r'^(?P\d+)/labels/stats$', label.get_label_stats), - url(r'^(?P\d+)/labels-for-nodes$', label.labels_for_nodes), - url(r'^(?P\d+)/labels/(?P(treenode|location|connector))/(?P\d+)/$', label.labels_for_node), - url(r'^(?P\d+)/label/(?P(treenode|location|connector))/(?P\d+)/update$', record_view("labels.update")(label.label_update)), - url(r'^(?P\d+)/label/(?P(treenode|location|connector))/(?P\d+)/remove$', record_view("labels.remove")(label.remove_label_link)), - url(r'^(?P\d+)/label/remove$', record_view("labels.remove_unused")(label.label_remove)), + re_path(r'^(?P\d+)/labels/$', label.labels_all), + re_path(r'^(?P\d+)/labels/detail$', label.labels_all_detail), + re_path(r'^(?P\d+)/labels/stats$', label.get_label_stats), + re_path(r'^(?P\d+)/labels-for-nodes$', label.labels_for_nodes), + re_path(r'^(?P\d+)/labels/(?P(treenode|location|connector))/(?P\d+)/$', label.labels_for_node), + re_path(r'^(?P\d+)/label/(?P(treenode|location|connector))/(?P\d+)/update$', record_view("labels.update")(label.label_update)), + re_path(r'^(?P\d+)/label/(?P(treenode|location|connector))/(?P\d+)/remove$', record_view("labels.remove")(label.remove_label_link)), + re_path(r'^(?P\d+)/label/remove$', record_view("labels.remove_unused")(label.label_remove)), ] # Links urlpatterns += [ - url(r'^(?P\d+)/link/create$', record_view("links.create")(link.create_link)), - url(r'^(?P\d+)/link/delete$', record_view("links.remove")(link.delete_link)), + re_path(r'^(?P\d+)/link/create$', record_view("links.create")(link.create_link)), + re_path(r'^(?P\d+)/link/delete$', record_view("links.remove")(link.delete_link)), ] # Connector access urlpatterns += [ - url(r'^(?P\d+)/connector/create$', record_view("connectors.create")(connector.create_connector)), - url(r'^(?P\d+)/connector/delete$', record_view("connectors.remove")(connector.delete_connector)), - url(r'^(?P\d+)/connector/list/graphedge$', connector.graphedge_list), - url(r'^(?P\d+)/connector/list/one_to_many$', connector.one_to_many_synapses), - url(r'^(?P\d+)/connector/list/many_to_many$', connector.many_to_many_synapses), - url(r'^(?P\d+)/connector/list/completed$', connector.list_completed), - url(r'^(?P\d+)/connector/list/linked-to-nodes$', connector.connectors_from_treenodes), - url(r'^(?P\d+)/connector/skeletons$', connector.connector_skeletons), - url(r'^(?P\d+)/connector/edgetimes$', connector.connector_associated_edgetimes), - url(r'^(?P\d+)/connector/info$', connector.connectors_info), - url(r'^(?P\d+)/connectors/$', connector.list_connectors), - url(r'^(?P\d+)/connectors/links/$', connector.list_connector_links), - url(r'^(?P\d+)/connectors/link-pairs/$', connector.list_connector_link_pairs), - url(r'^(?P\d+)/connectors/(?P\d+)/$', + re_path(r'^(?P\d+)/connector/create$', record_view("connectors.create")(connector.create_connector)), + re_path(r'^(?P\d+)/connector/delete$', record_view("connectors.remove")(connector.delete_connector)), + re_path(r'^(?P\d+)/connector/list/graphedge$', connector.graphedge_list), + re_path(r'^(?P\d+)/connector/list/one_to_many$', connector.one_to_many_synapses), + re_path(r'^(?P\d+)/connector/list/many_to_many$', connector.many_to_many_synapses), + re_path(r'^(?P\d+)/connector/list/completed$', connector.list_completed), + re_path(r'^(?P\d+)/connector/list/linked-to-nodes$', connector.connectors_from_treenodes), + re_path(r'^(?P\d+)/connector/skeletons$', connector.connector_skeletons), + re_path(r'^(?P\d+)/connector/edgetimes$', connector.connector_associated_edgetimes), + re_path(r'^(?P\d+)/connector/info$', connector.connectors_info), + re_path(r'^(?P\d+)/connectors/$', connector.list_connectors), + re_path(r'^(?P\d+)/connectors/links/$', connector.list_connector_links), + re_path(r'^(?P\d+)/connectors/link-pairs/$', connector.list_connector_link_pairs), + re_path(r'^(?P\d+)/connectors/(?P\d+)/$', connector.connector_detail), - url(r'^(?P\d+)/connectors/user-info$', connector.connector_user_info), - url(r'^(?P\d+)/connectors/types/$', connector.connector_types), - url(r'^(?P\d+)/connectors/in-bounding-box$', connector.connectors_in_bounding_box), + re_path(r'^(?P\d+)/connectors/user-info$', connector.connector_user_info), + re_path(r'^(?P\d+)/connectors/types/$', connector.connector_types), + re_path(r'^(?P\d+)/connectors/in-bounding-box$', connector.connectors_in_bounding_box), ] # Neuron access urlpatterns += [ - url(r'^(?P\d+)/neuron/(?P\d+)/get-all-skeletons$', neuron.get_all_skeletons_of_neuron), - url(r'^(?P\d+)/neuron/(?P\d+)/give-to-user$', record_view("neurons.give_to_user")(neuron.give_neuron_to_other_user)), - url(r'^(?P\d+)/neuron/(?P\d+)/delete$', record_view("neurons.remove")(neuron.delete_neuron)), - url(r'^(?P\d+)/neurons/(?P\d+)/rename$', record_view("neurons.rename")(neuron.rename_neuron)), - url(r'^(?P\d+)/neurons/$', neuron.list_neurons), - url(r'^(?P\d+)/neurons/from-models$', neuron.get_neuron_ids_from_models), - url(r'^(?P\d+)/neurons/rename$', neuron.rename_neurons), - url(r'^(?P\d+)/neurons/all-skeletons$', neuron.list_all_skeletons), + re_path(r'^(?P\d+)/neuron/(?P\d+)/get-all-skeletons$', neuron.get_all_skeletons_of_neuron), + re_path(r'^(?P\d+)/neuron/(?P\d+)/give-to-user$', record_view("neurons.give_to_user")(neuron.give_neuron_to_other_user)), + re_path(r'^(?P\d+)/neuron/(?P\d+)/delete$', record_view("neurons.remove")(neuron.delete_neuron)), + re_path(r'^(?P\d+)/neurons/(?P\d+)/rename$', record_view("neurons.rename")(neuron.rename_neuron)), + re_path(r'^(?P\d+)/neurons/$', neuron.list_neurons), + re_path(r'^(?P\d+)/neurons/from-models$', neuron.get_neuron_ids_from_models), + re_path(r'^(?P\d+)/neurons/rename$', neuron.rename_neurons), + re_path(r'^(?P\d+)/neurons/all-skeletons$', neuron.list_all_skeletons), ] # Node access urlpatterns += [ - url(r'^(?P\d+)/node/(?P\d+)/reviewed$', record_view("nodes.add_or_update_review")(node.update_location_reviewer)), - url(r'^(?P\d+)/nodes/most-recent$', node.most_recent_treenode), - url(r'^(?P\d+)/nodes/location$', node.get_locations), - url(r'^(?P\d+)/nodes/nearest$', node.node_nearest), - url(r'^(?P\d+)/node/update$', record_view("nodes.update_location")(node.node_update)), - url(r'^(?P\d+)/node/list$', node.node_list_tuples), - url(r'^(?P\d+)/node/get_location$', node.get_location), - url(r'^(?P\d+)/node/user-info$', node.user_info), - url(r'^(?P\d+)/nodes/find-labels$', node.find_labels), - url(r'^(?P\d+)/nodes/$', api_view(['POST'])(node.node_list_tuples)), + re_path(r'^(?P\d+)/node/(?P\d+)/reviewed$', record_view("nodes.add_or_update_review")(node.update_location_reviewer)), + re_path(r'^(?P\d+)/nodes/most-recent$', node.most_recent_treenode), + re_path(r'^(?P\d+)/nodes/location$', node.get_locations), + re_path(r'^(?P\d+)/nodes/nearest$', node.node_nearest), + re_path(r'^(?P\d+)/node/update$', record_view("nodes.update_location")(node.node_update)), + re_path(r'^(?P\d+)/node/list$', node.node_list_tuples), + re_path(r'^(?P\d+)/node/get_location$', node.get_location), + re_path(r'^(?P\d+)/node/user-info$', node.user_info), + re_path(r'^(?P\d+)/nodes/find-labels$', node.find_labels), + re_path(r'^(?P\d+)/nodes/$', api_view(['POST'])(node.node_list_tuples)), ] # Treenode access urlpatterns += [ - url(r'^(?P\d+)/treenode/create$', record_view("treenodes.create")(treenode.create_treenode)), - url(r'^(?P\d+)/treenode/insert$', record_view("treenodes.insert")(treenode.insert_treenode)), - url(r'^(?P\d+)/treenode/delete$', record_view("treenodes.remove")(treenode.delete_treenode)), - url(r'^(?P\d+)/treenodes/compact-detail$', treenode.compact_detail_list), - url(r'^(?P\d+)/treenodes/(?P\d+)/info$', treenode.treenode_info), - url(r'^(?P\d+)/treenodes/(?P\d+)/compact-detail$', treenode.compact_detail), - url(r'^(?P\d+)/treenodes/(?P\d+)/children$', treenode.find_children), - url(r'^(?P\d+)/treenodes/(?P\d+)/confidence$', record_view("treenodes.update_confidence")(treenode.update_confidence)), - url(r'^(?P\d+)/treenodes/(?P\d+)/parent$', record_view("treenodes.update_parent")(treenode.update_parent)), - url(r'^(?P\d+)/treenode/(?P\d+)/radius$', record_view("treenodes.update_radius")(treenode.update_radius)), - url(r'^(?P\d+)/treenodes/radius$', record_view("treenodes.update_radius")(treenode.update_radii)), - url(r'^(?P\d+)/treenodes/(?P\d+)/previous-branch-or-root$', treenode.find_previous_branchnode_or_root), - url(r'^(?P\d+)/treenodes/(?P\d+)/next-branch-or-end$', treenode.find_next_branchnode_or_end), - url(r'^(?P\d+)/treenodes/(?P\d+)/importing-user$', treenode.importing_user), + re_path(r'^(?P\d+)/treenode/create$', record_view("treenodes.create")(treenode.create_treenode)), + re_path(r'^(?P\d+)/treenode/insert$', record_view("treenodes.insert")(treenode.insert_treenode)), + re_path(r'^(?P\d+)/treenode/delete$', record_view("treenodes.remove")(treenode.delete_treenode)), + re_path(r'^(?P\d+)/treenodes/compact-detail$', treenode.compact_detail_list), + re_path(r'^(?P\d+)/treenodes/(?P\d+)/info$', treenode.treenode_info), + re_path(r'^(?P\d+)/treenodes/(?P\d+)/compact-detail$', treenode.compact_detail), + re_path(r'^(?P\d+)/treenodes/(?P\d+)/children$', treenode.find_children), + re_path(r'^(?P\d+)/treenodes/(?P\d+)/confidence$', record_view("treenodes.update_confidence")(treenode.update_confidence)), + re_path(r'^(?P\d+)/treenodes/(?P\d+)/parent$', record_view("treenodes.update_parent")(treenode.update_parent)), + re_path(r'^(?P\d+)/treenode/(?P\d+)/radius$', record_view("treenodes.update_radius")(treenode.update_radius)), + re_path(r'^(?P\d+)/treenodes/radius$', record_view("treenodes.update_radius")(treenode.update_radii)), + re_path(r'^(?P\d+)/treenodes/(?P\d+)/previous-branch-or-root$', treenode.find_previous_branchnode_or_root), + re_path(r'^(?P\d+)/treenodes/(?P\d+)/next-branch-or-end$', treenode.find_next_branchnode_or_end), + re_path(r'^(?P\d+)/treenodes/(?P\d+)/importing-user$', treenode.importing_user), ] # Suppressed virtual treenode access urlpatterns += [ - url(r'^(?P\d+)/treenodes/(?P\d+)/suppressed-virtual/$', + re_path(r'^(?P\d+)/treenodes/(?P\d+)/suppressed-virtual/$', record_view("treenodes.suppress_virtual_node", "POST")(suppressed_virtual_treenode.SuppressedVirtualTreenodeList.as_view())), - url(r'^(?P\d+)/treenodes/(?P\d+)/suppressed-virtual/(?P\d+)$', + re_path(r'^(?P\d+)/treenodes/(?P\d+)/suppressed-virtual/(?P\d+)$', record_view("treenodes.unsuppress_virtual_node", "DELETE")(suppressed_virtual_treenode.SuppressedVirtualTreenodeDetail.as_view())), ] # General skeleton access urlpatterns += [ - url(r'^(?P\d+)/skeletons/$', skeleton.list_skeletons), - url(r'^(?P\d+)/skeletons/cable-length$', skeleton.cable_lengths), - url(r'^(?P\d+)/skeletons/summary$', skeleton.summary), - url(r'^(?P\d+)/skeletons/connectivity-counts$', skeleton.connectivity_counts), - url(r'^(?P\d+)/skeletons/completeness$', skeleton.completeness), - url(r'^(?P\d+)/skeletons/validity$', skeleton.validity), - url(r'^(?P\d+)/skeleton/(?P\d+)/node_count$', skeleton.node_count), - url(r'^(?P\d+)/skeleton/(?P\d+)/neuronname$', skeleton.neuronname), - url(r'^(?P\d+)/skeleton/neuronnames$', skeleton.neuronnames), - url(r'^(?P\d+)/skeleton/node/(?P\d+)/node_count$', skeleton.node_count), - url(r'^(?P\d+)/skeleton/(?P\d+)/review/reset-own$', record_view("skeletons.reset_own_reviews")(skeleton.reset_own_reviewer_ids)), - url(r'^(?P\d+)/skeletons/connectivity$', skeleton.skeleton_info_raw), - url(r'^(?P\d+)/skeletons/in-bounding-box$', skeleton.skeletons_in_bounding_box), - url(r'^(?P\d+)/skeleton/connectivity_matrix$', skeleton.connectivity_matrix), - url(r'^(?P\d+)/skeletons/connectivity_matrix/csv$', skeleton.connectivity_matrix_csv), - url(r'^(?P\d+)/skeletons/review-status$', skeleton.review_status), - url(r'^(?P\d+)/skeletons/from-origin$', skeleton.from_origin), - url(r'^(?P\d+)/skeletons/origin$', skeleton.origin_info), - url(r'^(?P\d+)/skeletons/import-info$', skeleton.import_info), - url(r'^(?P\d+)/skeleton/(?P\d+)/statistics$', skeleton.skeleton_statistics), - url(r'^(?P\d+)/skeleton/(?P\d+)/contributor_statistics$', skeleton.contributor_statistics), - url(r'^(?P\d+)/skeleton/contributor_statistics_multiple$', skeleton.contributor_statistics_multiple), - url(r'^(?P\d+)/skeletons/(?P\d+)/id$', record_view('skeletons.update_id')(skeleton.SkeletonIdDetails.as_view())), - url(r'^(?P\d+)/skeletons/(?P\d+)/find-labels$', skeleton.find_labels), - url(r'^(?P\d+)/skeletons/(?P\d+)/open-leaves$', skeleton.open_leaves), - url(r'^(?P\d+)/skeletons/(?P\d+)/root$', skeleton.root_for_skeleton), - url(r'^(?P\d+)/skeletons/(?P\d+)/sampler-count$', skeleton.sampler_count), - url(r'^(?P\d+)/skeletons/(?P\d+)/cable-length$', skeleton.cable_length), - url(r'^(?P\d+)/skeletons/(?P\d+)/neuron-details$', skeleton.neurondetails), - url(r'^(?P\d+)/skeleton/split$', record_view("skeletons.split")(skeleton.split_skeleton)), - url(r'^(?P\d+)/skeleton/ancestry$', skeleton.skeleton_ancestry), - url(r'^(?P\d+)/skeleton/join$', record_view("skeletons.merge")(skeleton.join_skeleton)), - url(r'^(?P\d+)/skeleton/reroot$', record_view("skeletons.reroot")(skeleton.reroot_skeleton)), - url(r'^(?P\d+)/skeletons/sampler-count$', skeleton.list_sampler_count), - url(r'^(?P\d+)/skeleton/(?P\d+)/permissions$', skeleton.get_skeleton_permissions), - url(r'^(?P\d+)/skeletons/import$', record_view("skeletons.import")(skeleton.import_skeleton)), - url(r'^(?P\d+)/skeleton/annotationlist$', skeleton.annotation_list), - url(r'^(?P\d+)/skeletons/within-spatial-distance$', skeleton.within_spatial_distance), - url(r'^(?P\d+)/skeletons/node-labels$', skeleton.skeletons_by_node_labels), - url(r'^(?P\d+)/skeletons/change-history$', skeleton.change_history), - url(r'^(?P\d+)/skeletongroup/adjacency_matrix$', skeleton.adjacency_matrix), - url(r'^(?P\d+)/skeletongroup/skeletonlist_subgraph', skeleton.skeletonlist_subgraph), - url(r'^(?P\d+)/skeletongroup/all_shared_connectors', skeleton.all_shared_connectors), -] - -urlpatterns += [ - url(r'^(?P\d+)/origins/$', origin.OriginCollection.as_view()), + re_path(r'^(?P\d+)/skeletons/$', skeleton.list_skeletons), + re_path(r'^(?P\d+)/skeletons/cable-length$', skeleton.cable_lengths), + re_path(r'^(?P\d+)/skeletons/summary$', skeleton.summary), + re_path(r'^(?P\d+)/skeletons/connectivity-counts$', skeleton.connectivity_counts), + re_path(r'^(?P\d+)/skeletons/completeness$', skeleton.completeness), + re_path(r'^(?P\d+)/skeletons/validity$', skeleton.validity), + re_path(r'^(?P\d+)/skeleton/(?P\d+)/node_count$', skeleton.node_count), + re_path(r'^(?P\d+)/skeleton/(?P\d+)/neuronname$', skeleton.neuronname), + re_path(r'^(?P\d+)/skeleton/neuronnames$', skeleton.neuronnames), + re_path(r'^(?P\d+)/skeleton/node/(?P\d+)/node_count$', skeleton.node_count), + re_path(r'^(?P\d+)/skeleton/(?P\d+)/review/reset-own$', record_view("skeletons.reset_own_reviews")(skeleton.reset_own_reviewer_ids)), + re_path(r'^(?P\d+)/skeletons/connectivity$', skeleton.skeleton_info_raw), + re_path(r'^(?P\d+)/skeletons/in-bounding-box$', skeleton.skeletons_in_bounding_box), + re_path(r'^(?P\d+)/skeleton/connectivity_matrix$', skeleton.connectivity_matrix), + re_path(r'^(?P\d+)/skeletons/connectivity_matrix/csv$', skeleton.connectivity_matrix_csv), + re_path(r'^(?P\d+)/skeletons/review-status$', skeleton.review_status), + re_path(r'^(?P\d+)/skeletons/from-origin$', skeleton.from_origin), + re_path(r'^(?P\d+)/skeletons/origin$', skeleton.origin_info), + re_path(r'^(?P\d+)/skeletons/import-info$', skeleton.import_info), + re_path(r'^(?P\d+)/skeleton/(?P\d+)/statistics$', skeleton.skeleton_statistics), + re_path(r'^(?P\d+)/skeleton/(?P\d+)/contributor_statistics$', skeleton.contributor_statistics), + re_path(r'^(?P\d+)/skeleton/contributor_statistics_multiple$', skeleton.contributor_statistics_multiple), + re_path(r'^(?P\d+)/skeletons/(?P\d+)/id$', record_view('skeletons.update_id')(skeleton.SkeletonIdDetails.as_view())), + re_path(r'^(?P\d+)/skeletons/(?P\d+)/find-labels$', skeleton.find_labels), + re_path(r'^(?P\d+)/skeletons/(?P\d+)/open-leaves$', skeleton.open_leaves), + re_path(r'^(?P\d+)/skeletons/(?P\d+)/root$', skeleton.root_for_skeleton), + re_path(r'^(?P\d+)/skeletons/(?P\d+)/sampler-count$', skeleton.sampler_count), + re_path(r'^(?P\d+)/skeletons/(?P\d+)/cable-length$', skeleton.cable_length), + re_path(r'^(?P\d+)/skeletons/(?P\d+)/neuron-details$', skeleton.neurondetails), + re_path(r'^(?P\d+)/skeleton/split$', record_view("skeletons.split")(skeleton.split_skeleton)), + re_path(r'^(?P\d+)/skeleton/ancestry$', skeleton.skeleton_ancestry), + re_path(r'^(?P\d+)/skeleton/join$', record_view("skeletons.merge")(skeleton.join_skeleton)), + re_path(r'^(?P\d+)/skeleton/reroot$', record_view("skeletons.reroot")(skeleton.reroot_skeleton)), + re_path(r'^(?P\d+)/skeletons/sampler-count$', skeleton.list_sampler_count), + re_path(r'^(?P\d+)/skeleton/(?P\d+)/permissions$', skeleton.get_skeleton_permissions), + re_path(r'^(?P\d+)/skeletons/import$', record_view("skeletons.import")(skeleton.import_skeleton)), + re_path(r'^(?P\d+)/skeleton/annotationlist$', skeleton.annotation_list), + re_path(r'^(?P\d+)/skeletons/within-spatial-distance$', skeleton.within_spatial_distance), + re_path(r'^(?P\d+)/skeletons/node-labels$', skeleton.skeletons_by_node_labels), + re_path(r'^(?P\d+)/skeletons/change-history$', skeleton.change_history), + re_path(r'^(?P\d+)/skeletongroup/adjacency_matrix$', skeleton.adjacency_matrix), + re_path(r'^(?P\d+)/skeletongroup/skeletonlist_subgraph', skeleton.skeletonlist_subgraph), + re_path(r'^(?P\d+)/skeletongroup/all_shared_connectors', skeleton.all_shared_connectors), +] + +urlpatterns += [ + re_path(r'^(?P\d+)/origins/$', origin.OriginCollection.as_view()), ] # Skeleton export urlpatterns += [ - url(r'^(?P\d+)/neuroml/neuroml_level3_v181$', skeletonexport.export_neuroml_level3_v181), - url(r'^(?P\d+)/skeleton/(?P\d+)/swc$', skeletonexport.skeleton_swc), - url(r'^(?P\d+)/skeleton/(?P\d+)/eswc$', skeletonexport.skeleton_eswc), - url(r'^(?P\d+)/skeleton/(?P\d+)/neuroml$', skeletonexport.skeletons_neuroml), - url(r'^(?P\d+)/skeleton/(?P\d+)/json$', skeletonexport.skeleton_with_metadata), - url(r'^(?P\d+)/skeleton/(?P\d+)/compact-json$', skeletonexport.skeleton_for_3d_viewer), - url(r'^(?P\d+)/skeleton/(?P\d+)/nrrd$', nat.r.export_nrrd), - url(r'^(?P\d+)/(?P\d+)/(?P\d)/(?P\d)/(?P\d)/compact-arbor$', skeletonexport.compact_arbor), - url(r'^(?P\d+)/(?P\d+)/(?P\d)/(?P\d)/(?P\d)/compact-arbor-with-minutes$', skeletonexport.compact_arbor_with_minutes), - url(r'^(?P\d+)/skeletons/(?P\d+)/review$', skeletonexport.export_review_skeleton), - url(r'^(?P\d+)/skeleton/(?P\d+)/reviewed-nodes$', skeletonexport.export_skeleton_reviews), - url(r'^(?P\d+)/skeletons/measure$', skeletonexport.measure_skeletons), - url(r'^(?P\d+)/skeleton/connectors-by-partner$', skeletonexport.skeleton_connectors_by_partner), - url(r'^(?P\d+)/skeletons/partners-by-connector$', skeletonexport.partners_by_connector), - url(r'^(?P\d+)/skeletons/connector-polyadicity$', skeletonexport.connector_polyadicity), - url(r'^(?P\d+)/skeletons/(?P\d+)/compact-detail$', skeletonexport.compact_skeleton_detail), - url(r'^(?P\d+)/skeletons/(?P\d+)/neuroglancer$', skeletonexport.neuroglancer_skeleton), - url(r'^(?P\d+)/skeletons/(?P\d+)/node-overview$', skeletonexport.treenode_overview), - url(r'^(?P\d+)/skeletons/compact-detail$', skeletonexport.compact_skeleton_detail_many), + re_path(r'^(?P\d+)/neuroml/neuroml_level3_v181$', skeletonexport.export_neuroml_level3_v181), + re_path(r'^(?P\d+)/skeleton/(?P\d+)/swc$', skeletonexport.skeleton_swc), + re_path(r'^(?P\d+)/skeleton/(?P\d+)/eswc$', skeletonexport.skeleton_eswc), + re_path(r'^(?P\d+)/skeleton/(?P\d+)/neuroml$', skeletonexport.skeletons_neuroml), + re_path(r'^(?P\d+)/skeleton/(?P\d+)/json$', skeletonexport.skeleton_with_metadata), + re_path(r'^(?P\d+)/skeleton/(?P\d+)/compact-json$', skeletonexport.skeleton_for_3d_viewer), + re_path(r'^(?P\d+)/skeleton/(?P\d+)/nrrd$', nat.r.export_nrrd), + re_path(r'^(?P\d+)/(?P\d+)/(?P\d)/(?P\d)/(?P\d)/compact-arbor$', skeletonexport.compact_arbor), + re_path(r'^(?P\d+)/(?P\d+)/(?P\d)/(?P\d)/(?P\d)/compact-arbor-with-minutes$', skeletonexport.compact_arbor_with_minutes), + re_path(r'^(?P\d+)/skeletons/(?P\d+)/review$', skeletonexport.export_review_skeleton), + re_path(r'^(?P\d+)/skeleton/(?P\d+)/reviewed-nodes$', skeletonexport.export_skeleton_reviews), + re_path(r'^(?P\d+)/skeletons/measure$', skeletonexport.measure_skeletons), + re_path(r'^(?P\d+)/skeleton/connectors-by-partner$', skeletonexport.skeleton_connectors_by_partner), + re_path(r'^(?P\d+)/skeletons/partners-by-connector$', skeletonexport.partners_by_connector), + re_path(r'^(?P\d+)/skeletons/connector-polyadicity$', skeletonexport.connector_polyadicity), + re_path(r'^(?P\d+)/skeletons/(?P\d+)/compact-detail$', skeletonexport.compact_skeleton_detail), + re_path(r'^(?P\d+)/skeletons/(?P\d+)/neuroglancer$', skeletonexport.neuroglancer_skeleton), + re_path(r'^(?P\d+)/skeletons/(?P\d+)/node-overview$', skeletonexport.treenode_overview), + re_path(r'^(?P\d+)/skeletons/compact-detail$', skeletonexport.compact_skeleton_detail_many), # Marked as deprecated, but kept for backwards compatibility - url(r'^(?P\d+)/(?P\d+)/(?P\d)/(?P\d)/compact-skeleton$', skeletonexport.compact_skeleton), + re_path(r'^(?P\d+)/(?P\d+)/(?P\d)/(?P\d)/compact-skeleton$', skeletonexport.compact_skeleton), ] # Treenode and Connector image stack archive export urlpatterns += [ - url(r'^(?P\d+)/connectorarchive/export$', treenodeexport.export_connectors), - url(r'^(?P\d+)/treenodearchive/export$', treenodeexport.export_treenodes), + re_path(r'^(?P\d+)/connectorarchive/export$', treenodeexport.export_connectors), + re_path(r'^(?P\d+)/treenodearchive/export$', treenodeexport.export_treenodes), ] # Pointclouds urlpatterns += [ - url(r'^(?P\d+)/pointclouds/$', pointcloud.PointCloudList.as_view()), - url(r'^(?P\d+)/pointclouds/(?P\d+)/$', pointcloud.PointCloudDetail.as_view()), - url(r'^(?P\d+)/pointclouds/(?P\d+)/images/(?P\d+)/$', pointcloud.PointCloudImageDetail.as_view()), + re_path(r'^(?P\d+)/pointclouds/$', pointcloud.PointCloudList.as_view()), + re_path(r'^(?P\d+)/pointclouds/(?P\d+)/$', pointcloud.PointCloudDetail.as_view()), + re_path(r'^(?P\d+)/pointclouds/(?P\d+)/images/(?P\d+)/$', pointcloud.PointCloudImageDetail.as_view()), ] # Pointsets urlpatterns += [ - url(r'^(?P\d+)/pointsets/$', pointset.PointSetList.as_view()), - url(r'^(?P\d+)/pointsets/(?P\d+)/$', pointset.PointSetDetail.as_view()), + re_path(r'^(?P\d+)/pointsets/$', pointset.PointSetList.as_view()), + re_path(r'^(?P\d+)/pointsets/(?P\d+)/$', pointset.PointSetDetail.as_view()), ] urlpatterns += [ - url(r'^(?P\d+)/similarity/configs/$', similarity.ConfigurationList.as_view()), - url(r'^(?P\d+)/similarity/configs/(?P\d+)/$', similarity.ConfigurationDetail.as_view()), - url(r'^(?P\d+)/similarity/configs/(?P\d+)/recompute$', similarity.recompute_config), - url(r'^(?P\d+)/similarity/queries/$', similarity.SimilarityList.as_view()), - url(r'^(?P\d+)/similarity/queries/similarity$', similarity.compare_skeletons), - url(r'^(?P\d+)/similarity/queries/(?P\d+)/$', similarity.SimilarityDetail.as_view()), - url(r'^(?P\d+)/similarity/queries/(?P\d+)/recompute$', similarity.recompute_similarity), - url(r'^(?P\d+)/similarity/test-setup$', similarity.test_setup), + re_path(r'^(?P\d+)/similarity/configs/$', similarity.ConfigurationList.as_view()), + re_path(r'^(?P\d+)/similarity/configs/(?P\d+)/$', similarity.ConfigurationDetail.as_view()), + re_path(r'^(?P\d+)/similarity/configs/(?P\d+)/recompute$', similarity.recompute_config), + re_path(r'^(?P\d+)/similarity/queries/$', similarity.SimilarityList.as_view()), + re_path(r'^(?P\d+)/similarity/queries/similarity$', similarity.compare_skeletons), + re_path(r'^(?P\d+)/similarity/queries/(?P\d+)/$', similarity.SimilarityDetail.as_view()), + re_path(r'^(?P\d+)/similarity/queries/(?P\d+)/recompute$', similarity.recompute_similarity), + re_path(r'^(?P\d+)/similarity/test-setup$', similarity.test_setup), ] # Cropping urlpatterns += [ - url(r'^(?P\d+)/crop', cropping.crop), - url(r'^crop/download/(?P.*)/$', cropping.download_crop) + re_path(r'^(?P\d+)/crop', cropping.crop), + re_path(r'^crop/download/(?P.*)/$', cropping.download_crop) ] # Tagging urlpatterns += [ - url(r'^(?P\d+)/tags/list$', project.list_project_tags), - url(r'^(?P\d+)/tags/clear$', record_view("projects.clear_tags")(project.update_project_tags)), - url(r'^(?P\d+)/tags/(?P.*)/update$', record_view("projects.update_tags")(project.update_project_tags)), + re_path(r'^(?P\d+)/tags/list$', project.list_project_tags), + re_path(r'^(?P\d+)/tags/clear$', record_view("projects.clear_tags")(project.update_project_tags)), + re_path(r'^(?P\d+)/tags/(?P.*)/update$', record_view("projects.update_tags")(project.update_project_tags)), ] urlpatterns += [ - url(r'^(?P\d+)/stack/(?P\d+)/tags/list$', stack.list_stack_tags), - url(r'^(?P\d+)/stack/(?P\d+)/tags/clear$', record_view("stacks.clear_tags")(stack.update_stack_tags)), - url(r'^(?P\d+)/stack/(?P\d+)/tags/(?P.*)/update$', record_view("stacks.update_tags")(stack.update_stack_tags)), + re_path(r'^(?P\d+)/stack/(?P\d+)/tags/list$', stack.list_stack_tags), + re_path(r'^(?P\d+)/stack/(?P\d+)/tags/clear$', record_view("stacks.clear_tags")(stack.update_stack_tags)), + re_path(r'^(?P\d+)/stack/(?P\d+)/tags/(?P.*)/update$', record_view("stacks.update_tags")(stack.update_stack_tags)), ] # Data views urlpatterns += [ - url(r'^dataviews/list$', data_view.get_available_data_views, name='list_dataviews'), - url(r'^dataviews/default$', data_view.get_default_properties, name='default_dataview'), - url(r'^dataviews/(?P\d+)/$', data_view.get_detail, name='detail_dataview'), - url(r'^dataviews/(?P\d+)/make-home-view$', data_view.make_home_view, name='make_home_view'), - url(r'^dataviews/show/(?P\d+)$', data_view.get_data_view, name='show_dataview'), - url(r'^dataviews/show/default$', data_view.get_default_data_view, name='show_default_dataview'), - url(r'^dataviews/type/comment$', data_view.get_data_view_type_comment, name='get_dataview_type_comment'), - url(r'^dataviews/type/(?P\d+)$', data_view.get_data_view_type, name='get_dataview_type'), + re_path(r'^dataviews/list$', data_view.get_available_data_views, name='list_dataviews'), + re_path(r'^dataviews/default$', data_view.get_default_properties, name='default_dataview'), + re_path(r'^dataviews/(?P\d+)/$', data_view.get_detail, name='detail_dataview'), + re_path(r'^dataviews/(?P\d+)/make-home-view$', data_view.make_home_view, name='make_home_view'), + re_path(r'^dataviews/show/(?P\d+)$', data_view.get_data_view, name='show_dataview'), + re_path(r'^dataviews/show/default$', data_view.get_default_data_view, name='show_default_dataview'), + re_path(r'^dataviews/type/comment$', data_view.get_data_view_type_comment, name='get_dataview_type_comment'), + re_path(r'^dataviews/type/(?P\d+)$', data_view.get_data_view_type, name='get_dataview_type'), ] # Ontologies urlpatterns += [ - url(r'^ontology/knownroots$', ontology.get_known_ontology_roots), - url(r'^(?P%s)/ontology/roots/$' % (integer), ontology.get_existing_roots), - url(r'^(?P%s)/ontology/list$' % (integer), ontology.list_ontology), - url(r'^(?P%s)/ontology/relations$' % (integer), ontology.get_available_relations), - url(r'^(?P%s)/ontology/relations/add$' % (integer), record_view("ontologies.add_relation")(ontology.add_relation_to_ontology)), - url(r'^(?P%s)/ontology/relations/rename$' % (integer), record_view("ontologies.rename_relation")(ontology.rename_relation)), - url(r'^(?P%s)/ontology/relations/remove$' % (integer), record_view("ontologies.remove_relation")(ontology.remove_relation_from_ontology)), - url(r'^(?P%s)/ontology/relations/removeall$' % (integer), record_view("ontologies.remove_all_relations")(ontology.remove_all_relations_from_ontology)), - url(r'^(?P%s)/ontology/relations/list$' % (integer), ontology.list_available_relations), - url(r'^(?P%s)/ontology/classes$' % (integer), ontology.get_available_classes), - url(r'^(?P%s)/ontology/classes/add$' % (integer), record_view("ontologies.add_class")(ontology.add_class_to_ontology)), - url(r'^(?P%s)/ontology/classes/rename$' % (integer), record_view("ontologies.rename_class")(ontology.rename_class)), - url(r'^(?P%s)/ontology/classes/remove$' % (integer), record_view("ontologies.remove_class")(ontology.remove_class_from_ontology)), - url(r'^(?P%s)/ontology/classes/removeall$' % (integer), record_view("ontologies.remove_all_classes")(ontology.remove_all_classes_from_ontology)), - url(r'^(?P%s)/ontology/classes/list$' % (integer), ontology.list_available_classes), - url(r'^(?P%s)/ontology/links/add$' % (integer), record_view("ontologies.add_link")(ontology.add_link_to_ontology)), - url(r'^(?P%s)/ontology/links/remove$' % (integer), record_view("ontologies.remove_link")(ontology.remove_link_from_ontology)), - url(r'^(?P%s)/ontology/links/removeselected$' % (integer), record_view("ontologies.remove_link")(ontology.remove_selected_links_from_ontology)), - url(r'^(?P%s)/ontology/links/removeall$' % (integer), record_view("ontologies.remove_all_links")(ontology.remove_all_links_from_ontology)), - url(r'^(?P%s)/ontology/restrictions/add$' % (integer), record_view("ontologies.add_restriction")(ontology.add_restriction)), - url(r'^(?P%s)/ontology/restrictions/remove$' % (integer), record_view("ontologies.remove_restriction")(ontology.remove_restriction)), - url(r'^(?P%s)/ontology/restrictions/(?P[^/]*)/types$' % (integer), ontology.get_restriction_types), + re_path(r'^ontology/knownroots$', ontology.get_known_ontology_roots), + re_path(r'^(?P%s)/ontology/roots/$' % (integer), ontology.get_existing_roots), + re_path(r'^(?P%s)/ontology/list$' % (integer), ontology.list_ontology), + re_path(r'^(?P%s)/ontology/relations$' % (integer), ontology.get_available_relations), + re_path(r'^(?P%s)/ontology/relations/add$' % (integer), record_view("ontologies.add_relation")(ontology.add_relation_to_ontology)), + re_path(r'^(?P%s)/ontology/relations/rename$' % (integer), record_view("ontologies.rename_relation")(ontology.rename_relation)), + re_path(r'^(?P%s)/ontology/relations/remove$' % (integer), record_view("ontologies.remove_relation")(ontology.remove_relation_from_ontology)), + re_path(r'^(?P%s)/ontology/relations/removeall$' % (integer), record_view("ontologies.remove_all_relations")(ontology.remove_all_relations_from_ontology)), + re_path(r'^(?P%s)/ontology/relations/list$' % (integer), ontology.list_available_relations), + re_path(r'^(?P%s)/ontology/classes$' % (integer), ontology.get_available_classes), + re_path(r'^(?P%s)/ontology/classes/add$' % (integer), record_view("ontologies.add_class")(ontology.add_class_to_ontology)), + re_path(r'^(?P%s)/ontology/classes/rename$' % (integer), record_view("ontologies.rename_class")(ontology.rename_class)), + re_path(r'^(?P%s)/ontology/classes/remove$' % (integer), record_view("ontologies.remove_class")(ontology.remove_class_from_ontology)), + re_path(r'^(?P%s)/ontology/classes/removeall$' % (integer), record_view("ontologies.remove_all_classes")(ontology.remove_all_classes_from_ontology)), + re_path(r'^(?P%s)/ontology/classes/list$' % (integer), ontology.list_available_classes), + re_path(r'^(?P%s)/ontology/links/add$' % (integer), record_view("ontologies.add_link")(ontology.add_link_to_ontology)), + re_path(r'^(?P%s)/ontology/links/remove$' % (integer), record_view("ontologies.remove_link")(ontology.remove_link_from_ontology)), + re_path(r'^(?P%s)/ontology/links/removeselected$' % (integer), record_view("ontologies.remove_link")(ontology.remove_selected_links_from_ontology)), + re_path(r'^(?P%s)/ontology/links/removeall$' % (integer), record_view("ontologies.remove_all_links")(ontology.remove_all_links_from_ontology)), + re_path(r'^(?P%s)/ontology/restrictions/add$' % (integer), record_view("ontologies.add_restriction")(ontology.add_restriction)), + re_path(r'^(?P%s)/ontology/restrictions/remove$' % (integer), record_view("ontologies.remove_restriction")(ontology.remove_restriction)), + re_path(r'^(?P%s)/ontology/restrictions/(?P[^/]*)/types$' % (integer), ontology.get_restriction_types), ] # Classification urlpatterns += [ - url(rf'^(?P{integer})/classification/(?P{integer})/roots/$', + re_path(rf'^(?P{integer})/classification/(?P{integer})/roots/$', classification.get_classification_roots), - url(rf'^(?P{integer})/classification/(?P{integer})/setup/test$', + re_path(rf'^(?P{integer})/classification/(?P{integer})/setup/test$', classification.check_classification_setup_view, name='test_classification_setup'), - url(rf'^(?P{integer})/classification/(?P{integer})/setup/rebuild$', + re_path(rf'^(?P{integer})/classification/(?P{integer})/setup/rebuild$', record_view("classifications.rebuild_env")(classification.rebuild_classification_setup_view), name='rebuild_classification_setup'), - url(rf'^(?P{integer})/classification/(?P{integer})/new$', + re_path(rf'^(?P{integer})/classification/(?P{integer})/new$', record_view("classifications.add_graph")(classification.add_classification_graph), name='add_classification_graph'), - url(rf'^(?P{integer})/classification/(?P{integer})/list$', + re_path(rf'^(?P{integer})/classification/(?P{integer})/list$', classification.list_classification_graph, name='list_classification_graph'), - url(rf'^(?P{integer})/classification/(?P{integer})/list/(?P\d+)$', + re_path(rf'^(?P{integer})/classification/(?P{integer})/list/(?P\d+)$', classification.list_classification_graph, name='list_classification_graph'), - url(rf'^(?P{integer})/classification/(?P{integer})/(?P\d+)/remove$', + re_path(rf'^(?P{integer})/classification/(?P{integer})/(?P\d+)/remove$', record_view("classifications.remove_graph")(classification.remove_classification_graph), name='remove_classification_graph'), - url(rf'^(?P{integer})/classification/(?P{integer})/instance-operation$', + re_path(rf'^(?P{integer})/classification/(?P{integer})/instance-operation$', record_view("classifications.update_graph")(classification.classification_instance_operation), name='classification_instance_operation'), - url(rf'^(?P{integer})/classification/(?P{integer})/(?P\d+)/autofill$', + re_path(rf'^(?P{integer})/classification/(?P{integer})/(?P\d+)/autofill$', record_view("classifications.autofill_graph")(classification.autofill_classification_graph), name='autofill_classification_graph'), - url(rf'^(?P{integer})/classification/(?P{integer})/link$', + re_path(rf'^(?P{integer})/classification/(?P{integer})/link$', record_view("classifications.link_graph")(classification.link_classification_graph), name='link_classification_graph'), - url(rf'^(?P{integer})/classification/(?P{integer})/stack/(?P{integer})/linkroi/(?P{integer})/$', + re_path(rf'^(?P{integer})/classification/(?P{integer})/stack/(?P{integer})/linkroi/(?P{integer})/$', record_view("classifications.link_roi")(classification.link_roi_to_classification), name='link_roi_to_classification'), - url(rf'^classification/(?P{integer})/export$', + re_path(rf'^classification/(?P{integer})/export$', classification.export, name='export_classification'), - url(rf'^classification/(?P{integer})/export/excludetags/(?P{wordlist})/$', + re_path(rf'^classification/(?P{integer})/export/excludetags/(?P{wordlist})/$', classification.export, name='export_classification'), - url(rf'^classification/(?P{integer})/search$', + re_path(rf'^classification/(?P{integer})/search$', classification.search, name='search_classifications'), - url(rf'^classification/(?P{integer})/export_ontology$', + re_path(rf'^classification/(?P{integer})/export_ontology$', classification.export_ontology, name='export_ontology'), ] # Notifications urlpatterns += [ - url(r'^(?P\d+)/notifications/list$', notifications.list_notifications), - url(r'^(?P\d+)/changerequest/approve$', record_view("change_requests.approve")(notifications.approve_change_request)), - url(r'^(?P\d+)/changerequest/reject$', record_view("change_requests.reject")(notifications.reject_change_request)), + re_path(r'^(?P\d+)/notifications/list$', notifications.list_notifications), + re_path(r'^(?P\d+)/changerequest/approve$', record_view("change_requests.approve")(notifications.approve_change_request)), + re_path(r'^(?P\d+)/changerequest/reject$', record_view("change_requests.reject")(notifications.reject_change_request)), ] # Regions of interest urlpatterns += [ - url(rf'^(?P{integer})/roi/(?P{integer})/info$', roi.get_roi_info, name='get_roi_info'), - url(rf'^(?P{integer})/roi/link/(?P{integer})/stack/(?P{integer})/ci/(?P{integer})/$', + re_path(rf'^(?P{integer})/roi/(?P{integer})/info$', roi.get_roi_info, name='get_roi_info'), + re_path(rf'^(?P{integer})/roi/link/(?P{integer})/stack/(?P{integer})/ci/(?P{integer})/$', record_view("rois.create_link")(roi.link_roi_to_class_instance), name='link_roi_to_class_instance'), - url(rf'^(?P{integer})/roi/(?P{integer})/remove$', record_view("rois.remove_link")(roi.remove_roi_link), name='remove_roi_link'), - url(rf'^(?P{integer})/roi/(?P{integer})/image$', roi.get_roi_image, name='get_roi_image'), - url(rf'^(?P{integer})/roi/add$', record_view("rois.create")(roi.add_roi), name='add_roi'), + re_path(rf'^(?P{integer})/roi/(?P{integer})/remove$', record_view("rois.remove_link")(roi.remove_roi_link), name='remove_roi_link'), + re_path(rf'^(?P{integer})/roi/(?P{integer})/image$', roi.get_roi_image, name='get_roi_image'), + re_path(rf'^(?P{integer})/roi/add$', record_view("rois.create")(roi.add_roi), name='add_roi'), ] # General points urlpatterns += [ - url(rf'^(?P{integer})/points/$', point.PointList.as_view()), - url(rf'^(?P{integer})/points/(?P[0-9]+)/$', point.PointDetail.as_view()), + re_path(rf'^(?P{integer})/points/$', point.PointList.as_view()), + re_path(rf'^(?P{integer})/points/(?P[0-9]+)/$', point.PointDetail.as_view()), ] # Landmarks urlpatterns += [ - url(rf'^(?P{integer})/landmarks/$', landmarks.LandmarkList.as_view()), - url(rf'^(?P{integer})/landmarks/(?P[0-9]+)/$', landmarks.LandmarkDetail.as_view()), - url(rf'^(?P{integer})/landmarks/(?P[0-9]+)/locations/$', + re_path(rf'^(?P{integer})/landmarks/$', landmarks.LandmarkList.as_view()), + re_path(rf'^(?P{integer})/landmarks/(?P[0-9]+)/$', landmarks.LandmarkDetail.as_view()), + re_path(rf'^(?P{integer})/landmarks/(?P[0-9]+)/locations/$', landmarks.LandmarkLocationList.as_view()), - url(rf'^(?P{integer})/landmarks/(?P[0-9]+)/locations/(?P[0-9]+)/$', + re_path(rf'^(?P{integer})/landmarks/(?P[0-9]+)/locations/(?P[0-9]+)/$', landmarks.LandmarkLocationDetail.as_view()), - url(rf'^(?P{integer})/landmarks/(?P[0-9]+)/groups/(?P[0-9]+)/$', + re_path(rf'^(?P{integer})/landmarks/(?P[0-9]+)/groups/(?P[0-9]+)/$', landmarks.LandmarkAndGroupkLocationDetail.as_view()), - url(rf'^(?P{integer})/landmarks/groups/$', landmarks.LandmarkGroupList.as_view()), - url(rf'^(?P{integer})/landmarks/groups/import$', landmarks.LandmarkGroupImport.as_view()), - url(rf'^(?P{integer})/landmarks/groups/materialize$', landmarks.LandmarkGroupMaterializer.as_view()), - url(rf'^(?P{integer})/landmarks/groups/links/$', landmarks.LandmarkGroupLinks.as_view()), - url(rf'^(?P{integer})/landmarks/groups/links/(?P[0-9]+)/$', + re_path(rf'^(?P{integer})/landmarks/groups/$', landmarks.LandmarkGroupList.as_view()), + re_path(rf'^(?P{integer})/landmarks/groups/import$', landmarks.LandmarkGroupImport.as_view()), + re_path(rf'^(?P{integer})/landmarks/groups/materialize$', landmarks.LandmarkGroupMaterializer.as_view()), + re_path(rf'^(?P{integer})/landmarks/groups/links/$', landmarks.LandmarkGroupLinks.as_view()), + re_path(rf'^(?P{integer})/landmarks/groups/links/(?P[0-9]+)/$', landmarks.LandmarkGroupLinkDetail.as_view()), - url(rf'^(?P{integer})/landmarks/groups/(?P[0-9]+)/$', landmarks.LandmarkGroupDetail.as_view()), - url(rf'^(?P{integer})/landmarks/groups/(?P[0-9]+)/transitively-linked$', + re_path(rf'^(?P{integer})/landmarks/groups/(?P[0-9]+)/$', landmarks.LandmarkGroupDetail.as_view()), + re_path(rf'^(?P{integer})/landmarks/groups/(?P[0-9]+)/transitively-linked$', landmarks.LandmarkGroupLinkage.as_view()), - url(rf'^(?P{integer})/landmarks/groups/(?P[0-9]+)/locations/(?P[0-9]+)/$', + re_path(rf'^(?P{integer})/landmarks/groups/(?P[0-9]+)/locations/(?P[0-9]+)/$', landmarks.LandmarkGroupLocationList.as_view()), ] # Clustering urlpatterns += [ - url(r'^clustering/(?P\d+)/setup$', + re_path(r'^clustering/(?P\d+)/setup$', record_view("clusterings.setup_env")(clustering.setup_clustering), name='clustering_setup'), - url(r'^clustering/(?P\d+)/show$', + re_path(r'^clustering/(?P\d+)/show$', TemplateView.as_view(template_name="catmaid/clustering/display.html"), name="clustering_display"), ] # Volumes urlpatterns += [ - url(r'^(?P\d+)/volumes/$', volume.volume_collection), - url(r'^(?P\d+)/volumes/add$', record_view("volumes.create")(volume.add_volume)), - url(r'^(?P\d+)/volumes/from-origin$', volume.from_origin), - url(r'^(?P\d+)/volumes/from-entities$', volume.from_entities), - url(r'^(?P\d+)/volumes/import$', record_view("volumes.create")(volume.import_volumes)), - url(r'^(?P\d+)/volumes/entities/$', volume.get_volume_entities), - url(r'^(?P\d+)/volumes/skeleton-innervations$', volume.get_skeleton_innervations), - url(r'^(?P\d+)/volumes/(?P\d+)/$', volume.VolumeDetail.as_view()), - url(r'^(?P\d+)/volumes/(?P\d+)/intersect$', volume.intersects), - url(r'^(?P\d+)/volumes/(?P\d+)/export\.(?P\w+)', volume.export_volume), - url(r'^(?P\d+)/volumes/(?P\d+)/update-meta-info$', volume.update_meta_information), + re_path(r'^(?P\d+)/volumes/$', volume.volume_collection), + re_path(r'^(?P\d+)/volumes/add$', record_view("volumes.create")(volume.add_volume)), + re_path(r'^(?P\d+)/volumes/from-origin$', volume.from_origin), + re_path(r'^(?P\d+)/volumes/from-entities$', volume.from_entities), + re_path(r'^(?P\d+)/volumes/import$', record_view("volumes.create")(volume.import_volumes)), + re_path(r'^(?P\d+)/volumes/entities/$', volume.get_volume_entities), + re_path(r'^(?P\d+)/volumes/skeleton-innervations$', volume.get_skeleton_innervations), + re_path(r'^(?P\d+)/volumes/(?P\d+)/$', volume.VolumeDetail.as_view()), + re_path(r'^(?P\d+)/volumes/(?P\d+)/intersect$', volume.intersects), + re_path(r'^(?P\d+)/volumes/(?P\d+)/export\.(?P\w+)', volume.export_volume), + re_path(r'^(?P\d+)/volumes/(?P\d+)/update-meta-info$', volume.update_meta_information), ] # Analytics urlpatterns += [ - url(r'^(?P\d+)/analytics/skeletons$', analytics.analyze_skeletons), - url(r'^(?P\d+)/analytics/broken-section-nodes$', analytics.list_broken_section_nodes) + re_path(r'^(?P\d+)/analytics/skeletons$', analytics.analyze_skeletons), + re_path(r'^(?P\d+)/analytics/broken-section-nodes$', analytics.list_broken_section_nodes) ] # Front-end tests, disabled by default if settings.FRONT_END_TESTS_ENABLED: urlpatterns += [ - url(r'^tests$', login_required(CatmaidView.as_view(template_name="catmaid/tests.html")), name="frontend_tests"), + re_path(r'^tests$', login_required(CatmaidView.as_view(template_name="catmaid/tests.html")), name="frontend_tests"), ] # Collection of various parts of the CATMAID API. These methods are usually @@ -593,32 +594,32 @@ # readability. Therefore, they are all declared in this general statement. urlpatterns += [ # User analytics and proficiency - url(r'^(?P\d+)/useranalytics$', useranalytics.plot_useranalytics), - url(r'^(?P\d+)/useranalytics/data$', useranalytics.get_useranalytics_data), - url(r'^(?P\d+)/userproficiency$', user_evaluation.evaluate_user), + re_path(r'^(?P\d+)/useranalytics$', useranalytics.plot_useranalytics), + re_path(r'^(?P\d+)/useranalytics/data$', useranalytics.get_useranalytics_data), + re_path(r'^(?P\d+)/userproficiency$', user_evaluation.evaluate_user), - url(r'^(?P\d+)/graphexport/json$', graphexport.export_jsongraph), + re_path(r'^(?P\d+)/graphexport/json$', graphexport.export_jsongraph), # Graphs - url(r'^(?P\d+)/skeletons/confidence-compartment-subgraph', graph2.skeleton_graph), + re_path(r'^(?P\d+)/skeletons/confidence-compartment-subgraph', graph2.skeleton_graph), # Circles - url(r'^(?P\d+)/graph/circlesofhell', circles.circles_of_hell), - url(r'^(?P\d+)/graph/directedpaths', circles.find_directed_paths), - url(r'^(?P\d+)/graph/dps', circles.find_directed_path_skeletons), + re_path(r'^(?P\d+)/graph/circlesofhell', circles.circles_of_hell), + re_path(r'^(?P\d+)/graph/directedpaths', circles.find_directed_paths), + re_path(r'^(?P\d+)/graph/dps', circles.find_directed_path_skeletons), # Review - url(r'^(?P\d+)/user/reviewer-whitelist$', review.reviewer_whitelist), + re_path(r'^(?P\d+)/user/reviewer-whitelist$', review.reviewer_whitelist), # Search - url(r'^(?P\d+)/search$', search.search), + re_path(r'^(?P\d+)/search$', search.search), # Wiring diagram export - url(r'^(?P\d+)/wiringdiagram/json$', wiringdiagram.export_wiring_diagram), - url(r'^(?P\d+)/wiringdiagram/nx_json$', wiringdiagram.export_wiring_diagram_nx), + re_path(r'^(?P\d+)/wiringdiagram/json$', wiringdiagram.export_wiring_diagram), + re_path(r'^(?P\d+)/wiringdiagram/nx_json$', wiringdiagram.export_wiring_diagram_nx), # Annotation graph export - url(r'^(?P\d+)/annotationdiagram/nx_json$', object.convert_annotations_to_networkx), + re_path(r'^(?P\d+)/annotationdiagram/nx_json$', object.convert_annotations_to_networkx), ] # Patterns for Janelia render web service access @@ -627,26 +628,26 @@ review as janelia_render_review, stack as janelia_render_stack) urlpatterns += [ - url(r'^janelia-render/projects/$', janelia_render_project.projects), - url(r'^(?P.+)/user/reviewer-whitelist$', janelia_render_review.reviewer_whitelist), - url(r'^(?P.+)/interpolatable-sections/$', noop.interpolatable_sections), - url(r'^janelia-render/(?P.+)/stack/(?P.+)/info$', janelia_render_stack.stack_info), - url(r'^janelia-render/(?P.+)/stacks$', janelia_render_stack.stacks), - url(r'^janelia-render/(?P.+)/annotations/$', noop.list_annotations), - url(r'^janelia-render/(?P.+)/annotations/query-targets$', noop.query_annotation_targets), - url(r'^janelia-render/client/datastores/(?P[\w-]+)/$', noop.datastore_settings), + re_path(r'^janelia-render/projects/$', janelia_render_project.projects), + re_path(r'^(?P.+)/user/reviewer-whitelist$', janelia_render_review.reviewer_whitelist), + re_path(r'^(?P.+)/interpolatable-sections/$', noop.interpolatable_sections), + re_path(r'^janelia-render/(?P.+)/stack/(?P.+)/info$', janelia_render_stack.stack_info), + re_path(r'^janelia-render/(?P.+)/stacks$', janelia_render_stack.stacks), + re_path(r'^janelia-render/(?P.+)/annotations/$', noop.list_annotations), + re_path(r'^janelia-render/(?P.+)/annotations/query-targets$', noop.query_annotation_targets), + re_path(r'^janelia-render/client/datastores/(?P[\w-]+)/$', noop.datastore_settings), ] # Patterns for DVID access from catmaid.control.dvid import (project as dvidproject, review as dvidreview, stack as dvidstack) urlpatterns += [ - url(r'^dvid/projects/$', dvidproject.projects), - url(r'^(?P.+)/user/reviewer-whitelist$', dvidreview.reviewer_whitelist), - url(r'^(?P.+)/interpolatable-sections/$', noop.interpolatable_sections), - url(r'^dvid/(?P.+)/stack/(?P.+)/info$', dvidstack.stack_info), - url(r'^dvid/(?P.+)/stacks$', dvidstack.stacks), - url(r'^dvid/(?P.+)/annotations/$', noop.list_annotations), - url(r'^dvid/(?P.+)/annotations/query-targets$', noop.query_annotation_targets), - url(r'^dvid/client/datastores/(?P[\w-]+)/$', noop.datastore_settings), + re_path(r'^dvid/projects/$', dvidproject.projects), + re_path(r'^(?P.+)/user/reviewer-whitelist$', dvidreview.reviewer_whitelist), + re_path(r'^(?P.+)/interpolatable-sections/$', noop.interpolatable_sections), + re_path(r'^dvid/(?P.+)/stack/(?P.+)/info$', dvidstack.stack_info), + re_path(r'^dvid/(?P.+)/stacks$', dvidstack.stacks), + re_path(r'^dvid/(?P.+)/annotations/$', noop.list_annotations), + re_path(r'^dvid/(?P.+)/annotations/query-targets$', noop.query_annotation_targets), + re_path(r'^dvid/client/datastores/(?P[\w-]+)/$', noop.datastore_settings), ] diff --git a/django/projects/mysite/settings_base.py b/django/projects/mysite/settings_base.py index e140ec3552..c7d6894b26 100644 --- a/django/projects/mysite/settings_base.py +++ b/django/projects/mysite/settings_base.py @@ -64,6 +64,7 @@ 'django.contrib.messages.middleware.MessageMiddleware', 'catmaid.middleware.AnonymousAuthenticationMiddleware', 'catmaid.middleware.AjaxExceptionMiddleware', + 'allauth.account.middleware.AccountMiddleware', ] ROOT_URLCONF = 'mysite.urls' diff --git a/django/projects/mysite/urls.py b/django/projects/mysite/urls.py index 28ff7e22f0..8d13b86b18 100644 --- a/django/projects/mysite/urls.py +++ b/django/projects/mysite/urls.py @@ -5,7 +5,8 @@ from adminplus.sites import AdminSitePlus from django.conf import settings -from django.conf.urls import include, url +from django.conf.urls import include +from django.urls import re_path from django.contrib import admin from django.views.static import serve @@ -27,31 +28,31 @@ # CATMAID urlpatterns = [ - url(r'^', include('catmaid.urls')), - url(r'^accounts/', include('allauth.urls')), + re_path(r'^', include('catmaid.urls')), + re_path(r'^accounts/', include('allauth.urls')), ] # CATMAID extensions urlpatterns += [ - url(r'^ext/{}/'.format(extension), include('{}.urls'.format(extension))) + re_path(r'^ext/{}/'.format(extension), include('{}.urls'.format(extension))) for extension in settings.INSTALLED_EXTENSIONS ] # Admin site urlpatterns += [ - url(r'^admin/', admin.site.urls) + re_path(r'^admin/', admin.site.urls) ] # API Documentation urlpatterns += [ - url(r'^apis/', schema_view), - url(r'^api-token-auth/', ObtainAuthToken.as_view()), + re_path(r'^apis/', schema_view), + re_path(r'^api-token-auth/', ObtainAuthToken.as_view()), ] # Serve static files in debug mode and if explicitely requested if settings.DEBUG or settings.SERVE_STATIC: def serve_static(prefix, root): - return url(r'^%s(?P.*)$' % re.escape(prefix), serve, + return re_path(r'^%s(?P.*)$' % re.escape(prefix), serve, kwargs={'document_root': root}) urlpatterns += [ diff --git a/django/requirements-async.txt b/django/requirements-async.txt index e2f68ddf7e..796764b275 100644 --- a/django/requirements-async.txt +++ b/django/requirements-async.txt @@ -1,3 +1,3 @@ -channels_rabbitmq==4.0.0 -channels_redis==3.3.1 -daphne==3.0.2 +channels_rabbitmq==4.0.1 +channels_redis==4.2.1 +daphne==4.1.2 diff --git a/django/requirements-test.txt b/django/requirements-test.txt index c6d18797fc..3326f28b78 100644 --- a/django/requirements-test.txt +++ b/django/requirements-test.txt @@ -1,5 +1,5 @@ django-migration-testcase==0.0.15 -selenium==3.141.0 +selenium==4.27.1 sauceclient==1.0.0 -mypy==0.761; platform_python_implementation != 'PyPy' -flake8==3.7.9 +mypy==1.13; platform_python_implementation != 'PyPy' +flake8==7.1.1 diff --git a/django/requirements.txt b/django/requirements.txt index 10fe454fb8..c11eaa5372 100644 --- a/django/requirements.txt +++ b/django/requirements.txt @@ -1,18 +1,18 @@ aggdraw==1.3.12; platform_python_implementation != 'PyPy' -celery==5.2.7 -channels==3.0.4 +celery==5.4.0 +channels==4.2.0 cssmin==0.2.0 Cython==0.29.30 -Django==3.2.18 -django-adminplus==0.5 -django-allauth==0.51.0 -django-formtools==2.3 +Django==4.2.16 +django-adminplus==0.6 +django-allauth==65.3.0 +django-formtools==2.5.1 django-guardian==2.4.0 -django-pipeline==2.0.8 +django-pipeline==3.1.0 django-rest-swagger==2.2.0 -django-taggit==3.0.0 -djangorestframework==3.13.1 -kombu==5.2.3 +django-taggit==6.1.0 +djangorestframework==3.15.2 +kombu==5.4.2 matplotlib==3.5.2; platform_python_implementation != 'PyPy' mock==4.0.3 msgpack==1.0.4; platform_python_implementation != 'PyPy' @@ -28,7 +28,7 @@ python-dateutil==2.8.2 pytz==2022.1 PyYAML==6.0.0 requests==2.32.3 -scipy==1.8.1; platform_python_implementation != 'PyPy' +scipy==1.14.1; platform_python_implementation != 'PyPy' scipy==1.5.4; platform_python_implementation == 'PyPy' trimesh==3.12.7 ujson==5.4.0; platform_python_implementation != 'PyPy'