Skip to content

Commit

Permalink
Update finishline.py according to slight change in dash_building_bloc…
Browse files Browse the repository at this point in the history
…ks latest api
  • Loading branch information
marcodlk committed Oct 30, 2018
1 parent 51476d7 commit 6d8abfe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
20 changes: 13 additions & 7 deletions finishline/finishline.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ def register_vis(self, name, layout):
}


def register_data(self, name, input=None, state=None, data=None, on_update=None):
def register_data(self, name, inputs=None, state=None, data=None, on_update=None):

self.client_data[name] = {
'data': data or {},
'src_file': self._curr_file
}

ret = self.store.register(name, input=input, state=state, initially=data)
ret = self.store.register(name, inputs=inputs, state=state, initially=data)

if on_update:
@self.app.callback(
Expand All @@ -93,7 +93,7 @@ def generate_layout(self, components=gc, layouts=None, cols=None):

@self.register_data(
page_config,
input=[Input(page_layout, 'layouts')],
inputs=[Input(page_layout, 'layouts')],
data=layouts,
on_update=self.on_layout_change
)
Expand Down Expand Up @@ -139,7 +139,7 @@ def load_plugins(self, plugins_path='plugins/*'):
modules = sorted(glob.glob(plugins_path))

for m in modules:
print(m)
# print(m)
fname = m + '/__init__.py'
if not os.path.isfile(fname):
continue
Expand All @@ -149,7 +149,7 @@ def load_plugins(self, plugins_path='plugins/*'):

self.extra_files.append(fname) #TODO walk all py files in dir
spec = importlib.util.spec_from_file_location(m, fname)
print(spec)
# print(spec)
plugin = importlib.util.module_from_spec(spec)

try:
Expand All @@ -158,7 +158,8 @@ def load_plugins(self, plugins_path='plugins/*'):
except:
traceback.print_exc()
print("Unexpected error in plugin, ", m, ": ", sys.exc_info()[0])
self.register_vis(m, html.Pre("Unexpected error in " + m + '\n' + traceback.format_exc()));
self.register_vis(m, html.Pre("Unexpected error in " + m + '\n' + traceback.format_exc()))
# TODO: register 'XXX' instead of 'plugin/XXX'

self.plugins[m] = plugin

Expand Down Expand Up @@ -202,5 +203,10 @@ def register(self, name, block):


def __getitem__(self, name):
print(self._blocks.keys())

return self._blocks[name]


def __getattr__(self, name):

return self._blocks[name]
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def readme():

configuration = {
'name' : 'finishline',
'version': '0.0.2',
'version': '0.0.3',
'description' : 'Framework for Building Beautiful and Functional Dashbords',
'long_description' : readme(),
'classifiers' : [
Expand Down Expand Up @@ -39,4 +39,4 @@ def readme():
'data_files' : ()
}

setup(**configuration)
setup(**configuration)

0 comments on commit 6d8abfe

Please sign in to comment.