Commit a9681e59e2b600b16271238d9bd82ebd539f4b4a

Authored by Gust
1 parent b588f3b4
Exists in proxy_hotspot

Fix import_data

colab/proxy/management/commands/import_proxy_data.py
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 import importlib 3 import importlib
  4 +import inspect
4 5
5 from django.core.management.base import BaseCommand 6 from django.core.management.base import BaseCommand
6 from django.conf import settings 7 from django.conf import settings
@@ -20,7 +21,10 @@ class Command(BaseCommand): @@ -20,7 +21,10 @@ class Command(BaseCommand):
20 21
21 for module_item_name in dir(module): 22 for module_item_name in dir(module):
22 module_item = getattr(module, module_item_name) 23 module_item = getattr(module, module_item_name)
  24 + if not inspect.isclass(module_item):
  25 + continue
23 if issubclass(module_item, ProxyDataAPI): 26 if issubclass(module_item, ProxyDataAPI):
24 if module_item != ProxyDataAPI: 27 if module_item != ProxyDataAPI:
25 api = module_item() 28 api = module_item()
26 api.fetchData() 29 api.fetchData()
  30 + break
colab/proxy/utils/plugin.py
@@ -34,7 +34,7 @@ class ColabPlugin(object): @@ -34,7 +34,7 @@ class ColabPlugin(object):
34 34
35 Example of code hotspot, might be called somewhere in the code from: 35 Example of code hotspot, might be called somewhere in the code from:
36 36
37 - from colab.proxy.proxy.plugin import plugin_hotspot 37 + from colab.proxy.utils.plugin import plugin_hotspot
38 from colab.settings import PROXIED_APPS 38 from colab.settings import PROXIED_APPS
39 39
40 40