From 0ef661f1c6dcd06788808c37fe0fd55beddc7d13 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Sun, 23 Apr 2023 08:10:09 +0200 Subject: [PATCH] maint: import Callable traitlet from jupyterhub --- oauthenticator/generic.py | 2 +- oauthenticator/traitlets.py | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 oauthenticator/traitlets.py diff --git a/oauthenticator/generic.py b/oauthenticator/generic.py index 127fcdaf..9f946f96 100644 --- a/oauthenticator/generic.py +++ b/oauthenticator/generic.py @@ -5,11 +5,11 @@ from functools import reduce from jupyterhub.auth import LocalAuthenticator +from jupyterhub.traitlets import Callable from tornado.httpclient import AsyncHTTPClient from traitlets import Bool, Dict, List, Unicode, Union, default from .oauth2 import OAuthenticator -from .traitlets import Callable class GenericOAuthenticator(OAuthenticator): diff --git a/oauthenticator/traitlets.py b/oauthenticator/traitlets.py deleted file mode 100644 index ed8204bd..00000000 --- a/oauthenticator/traitlets.py +++ /dev/null @@ -1,17 +0,0 @@ -from traitlets import TraitType - - -class Callable(TraitType): - """ - A trait which is callable. - Classes are callable, as are instances - with a __call__() method. - """ - - info_text = 'a callable' - - def validate(self, obj, value): - if callable(value): - return value - else: - self.error(obj, value)