diff --git a/demo/demo/bootstrap_app.py b/demo/demo/bootstrap_app.py index cfa180af..207df220 100644 --- a/demo/demo/bootstrap_app.py +++ b/demo/demo/bootstrap_app.py @@ -22,7 +22,6 @@ SOFTWARE. ''' -import dash import dash_bootstrap_components as dbc import dash_html_components as html @@ -33,8 +32,7 @@ dd.layout = html.Div( [ - dbc.Alert("This is an alert", color="primary"), - dbc.Alert("Danger", color="danger"), - ] + dbc.Alert("This is an alert", color="primary"), + dbc.Alert("Danger", color="danger"), + ] ) - diff --git a/django_plotly_dash/dash_wrapper.py b/django_plotly_dash/dash_wrapper.py index c7dceae4..bfb93fa8 100644 --- a/django_plotly_dash/dash_wrapper.py +++ b/django_plotly_dash/dash_wrapper.py @@ -83,11 +83,12 @@ class DjangoDash: To use, construct an instance of DjangoDash() in place of a Dash() one. ''' + #pylint: disable=too-many-instance-attributes def __init__(self, name=None, serve_locally=False, expanded_callbacks=False, add_bootstrap_links=False, suppress_callback_exceptions=False, - **kwargs): # pylint: disable=unused-argument + **kwargs): # pylint: disable=unused-argument, too-many-arguments if name is None: global uid_counter # pylint: disable=global-statement uid_counter += 1 diff --git a/django_plotly_dash/finders.py b/django_plotly_dash/finders.py index 96a05fe8..2c23a911 100644 --- a/django_plotly_dash/finders.py +++ b/django_plotly_dash/finders.py @@ -33,13 +33,15 @@ from django.core.files.storage import FileSystemStorage from django.conf import settings -from django.apps import apps +from django.apps import apps #pylint: disable=unused-import from django_plotly_dash.dash_wrapper import all_apps class DashComponentFinder(BaseFinder): 'Find static files in components' + #pylint: disable=abstract-method, redefined-builtin + def __init__(self): self.locations = [] @@ -87,7 +89,9 @@ def find(self, path, all=False): return matches + # pylint: disable=inconsistent-return-statements, no-self-use def find_location(self, path): + 'Return location, if it exists' if os.path.exists(path): return path @@ -95,12 +99,14 @@ def list(self, ignore_patterns): for component_name in self.locations: storage = self.storages[component_name] for path in get_files(storage, ignore_patterns + self.ignore_patterns): - print("DashAssetFinder",path,storage) + print("DashAssetFinder", path, storage) yield path, storage class DashAssetFinder(BaseFinder): 'Find static files in asset directories' + #pylint: disable=unused-import, unused-variable, no-name-in-module, import-error, abstract-method + def __init__(self): # Get all registered apps @@ -120,7 +126,7 @@ def __init__(self): for app_slug, obj in self.apps.items(): caller_module = obj.caller_module location = obj.caller_module_location - path_directory = os.path.join(os.path.dirname(location),self.subdir) + path_directory = os.path.join(os.path.dirname(location), self.subdir) if os.path.isdir(path_directory): @@ -134,6 +140,7 @@ def __init__(self): super(DashAssetFinder, self).__init__() + #pylint: disable=redefined-builtin def find(self, path, all=False): return [] diff --git a/django_plotly_dash/version.py b/django_plotly_dash/version.py index e0bb46dc..4e925193 100644 --- a/django_plotly_dash/version.py +++ b/django_plotly_dash/version.py @@ -4,4 +4,4 @@ This addresses issue #81 ''' -__version__ = "0.9.5" +__version__ = "0.9.6" diff --git a/django_plotly_dash/views.py b/django_plotly_dash/views.py index 5f24649c..814eed71 100644 --- a/django_plotly_dash/views.py +++ b/django_plotly_dash/views.py @@ -101,6 +101,7 @@ def main_view(request, ident, stateless=False, cache_id=None, **kwargs): return HttpResponse(resp) def component_component_suites(request, resource=None, component=None, **kwargs): + 'Return part of a client-side component, served locally for some reason' return component_suites(request, resource=resource, component=component, @@ -116,7 +117,7 @@ def component_suites(request, resource=None, component=None, extra_element="", * else: redone_url = "/static/dash/component/%s/%s%s" %(component, extra_element, resource) - print("Redirecting to :",redone_url) + print("Redirecting to :", redone_url) return HttpResponseRedirect(redirect_to=redone_url)