Skip to content

Commit

Permalink
stop point
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Durant committed Oct 1, 2018
1 parent 80b7b52 commit e376122
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion intake/catalog/base.py
Expand Up @@ -103,7 +103,7 @@ def search(self, text, depth=2):
auth=self.auth,
metadata=(self.metadata or {}).copy(),
storage_options=self.storage_options)
cat.metadata['search_text'] = text
cat.metadata['search'] = {'text': text, 'upstream': self.name}
cat._entries = {k: v for k, v in self.walk(depth=depth).items()
if any(word in str(v.describe().values())
for word in words)}
Expand Down
Binary file modified intake/gui/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 27 additions & 6 deletions intake/gui/widgets.py
Expand Up @@ -8,7 +8,9 @@
here = os.path.abspath(os.path.dirname(__file__))
logo_file = os.path.join(here, 'logo.png')
logo = widgets.Box([widgets.Image.from_file(logo_file)],
layout=widgets.Layout(width='80px', height='80px'))
layout=widgets.Layout(width='46px', height='35px',
overflow_y='visible',
overflow_x='visible'))


@contextmanager
Expand Down Expand Up @@ -51,7 +53,7 @@ def __init__(self, cats=None):
self.ignore = False
self.exception = None
self.item_list = widgets.Select(rows=9)
self.detail = widgets.Textarea(disabled=True,
self.detail = widgets.Textarea(disabled=True, rows=7,
placeholder='Item Description')
self.add = widgets.Button(
icon='plus-square',
Expand All @@ -66,9 +68,25 @@ def __init__(self, cats=None):
tooltip='Open File Selector',
layout=widgets.Layout(flex='1 1 auto', width='auto'))
self.files.on_click(self.openfs)
self.mid = widgets.HBox(children=[logo, self.cat_list,
self.search = widgets.Button(
icon='search',
tooltip='Search entries',
layout=widgets.Layout(width='auto', height='auto',
overflow_y='visible', overflow_x='visible'))
self.search.on_click(self.opensearch)
self.remove = widgets.Button(
icon='minus-square',
tooltip='Remove cat',
layout=widgets.Layout(width='auto', height='auto',
overflow_y='visible', overflow_x='visible'))
self.logobox = widgets.VBox(children=[logo, self.search, self.remove],
layout=widgets.Layout(width='auto',
height='auto',
overflow_y='visible',
overflow_x='visible'))
self.mid = widgets.HBox(children=[self.logobox, self.cat_list,
self.item_list, self.detail])
self.bottom = widgets.HBox(children=[self.lurl, self.url, self.files,
self.bottom = widgets.HBox(children=[self.files, self.lurl, self.url,
self.add])
self.widget = widgets.VBox(children=[self.mid, self.bottom])
self.widget.__repr__ = self.__repr__
Expand Down Expand Up @@ -154,8 +172,11 @@ def _ipython_display_(self, **kwargs):
self.widget._handle_displayed(**kwargs)

def openfs(self, ev):
self.fs = FileSelector(self.file_chosen, filters=['.yaml', '.yml'])
self.widget.children = [self.mid, self.bottom, self.fs.selector]
self.fs = FileSelector(self.file_chosen, filters=['.yaml', '.yml'])
self.widget.children = [self.mid, self.bottom, self.fs.selector]

def opensearch(self, ev):
pass

def file_chosen(self, fn, ok=True):
if ok:
Expand Down
Binary file modified logo-small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e376122

Please sign in to comment.