TACTIC Open Source
Error in "File Broswer" layout in View Panel - Printable Version

+- TACTIC Open Source (http://forum.southpawtech.com)
+-- Forum: TACTIC Open Source (http://forum.southpawtech.com/forumdisplay.php?fid=3)
+--- Forum: TACTIC Discussion (http://forum.southpawtech.com/forumdisplay.php?fid=4)
+--- Thread: Error in "File Broswer" layout in View Panel (/showthread.php?tid=73)



Error in "File Broswer" layout in View Panel - dankitchen - 01-29-2020

Hi All,

Just wanted to share an error I am getting when switching over to the File Browser layout in the table/view panel.  I also get the same error when I call the class directly into a widget.  The error only happens when there are shapshots to display.  It was working about a week ago and I did pull from the latest 4.7 code.

  File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 429, in explicit_display
    child = self.get_display()
  File "/opt/tactic/tactic/src/tactic/ui/widget/file_browser_wdg.py", line 1189, in get_display
    self.handle_paths(self.paths, base_dir, inner, depth=depth, all_open=all_open, open_depth=open_depth)
  File "/opt/tactic/tactic/src/tactic/ui/widget/file_browser_wdg.py", line 1319, in handle_paths
    dir_item_div = self.handler._get_dir_item(dirname, basename, is_open=xis_open)
  File "/opt/tactic/tactic/src/tactic/ui/widget/file_browser_wdg.py", line 620, in _get_dir_item
    self.add_dir_behaviors(div, dir, item)
  File "/opt/tactic/tactic/src/tactic/ui/tools/repo_browser_wdg.py", line 2700, in add_dir_behaviors
    search_type = search_types[search_types.keys()[0]]



thanks!
-Dan


RE: Error in "File Broswer" layout in View Panel - remkonoteboom - 01-30-2020

What is the error? The stack trace gives us where the error occurs, but the description of the error is missing. My guess is that "search_types" is an empty dictionary.


RE: Error in "File Broswer" layout in View Panel - dankitchen - 03-26-2020

Hey sorry bit of a pause but back at it :-)


Here is the full error:

Error: 'dict_keys' object is not subscriptable

File "/opt/tactic/tactic/src/pyasm/prod/service/api_xmlrpc.py", line 5401, in get_widget
html = widget.get_buffer_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 480, in get_buffer_display
buffer = self.get_buffer(cls)
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 471, in get_buffer
self.explicit_display(cls)
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 438, in explicit_display
widget = child.get_display()
File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
super(HtmlElement,self).get_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
widget.explicit_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 429, in explicit_display
child = self.get_display()
File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 1810, in get_display
return super(Table,self).get_display()
File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
super(HtmlElement,self).get_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
widget.explicit_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 429, in explicit_display
child = self.get_display()
File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
super(HtmlElement,self).get_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
widget.explicit_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 429, in explicit_display
child = self.get_display()
File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
super(HtmlElement,self).get_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
widget.explicit_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 429, in explicit_display
child = self.get_display()
File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
super(HtmlElement,self).get_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
widget.explicit_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 429, in explicit_display
child = self.get_display()
File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
super(HtmlElement,self).get_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
widget.explicit_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 429, in explicit_display
child = self.get_display()
File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
super(HtmlElement,self).get_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
widget.explicit_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 438, in explicit_display
widget = child.get_display()
File "/opt/tactic/tactic/src/pyasm/web/html_wdg.py", line 807, in get_display
super(HtmlElement,self).get_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 459, in get_display
widget.explicit_display()
File "/opt/tactic/tactic/src/pyasm/web/widget.py", line 429, in explicit_display
child = self.get_display()
File "/opt/tactic/tactic/src/tactic/ui/widget/file_browser_wdg.py", line 1189, in get_display
self.handle_paths(self.paths, base_dir, inner, depth=depth, all_open=all_open, open_depth=open_depth)
File "/opt/tactic/tactic/src/tactic/ui/widget/file_browser_wdg.py", line 1319, in handle_paths
dir_item_div = self.handler._get_dir_item(dirname, basename, is_open=xis_open)
File "/opt/tactic/tactic/src/tactic/ui/widget/file_browser_wdg.py", line 620, in _get_dir_item
self.add_dir_behaviors(div, dir, item)
File "/opt/tactic/tactic/src/tactic/ui/tools/repo_browser_wdg.py", line 2700, in add_dir_behaviors
search_type = search_types[search_types.keys()[0]]

What I am trying to do, is add a tab to a custom dashboard for my search type lpc/tenant. I want to be able to use a file browser to display the files checked into a particular tenant. Here is the snippet I am trying at the moment:

<element name="file_browser2">
<display class="tactic.ui.tools.RepoBrowserWdg">
<search_types>lpc/tenant</search_types><!-- Not sure about the requirement of this option? -->
<search_type>lpc/tenant</search_type>
<search_key>${tenant_sk}</search_key>
</display>
</element>


Thanks!
-Dan


RE: Error in "File Broswer" layout in View Panel - remkonoteboom - 03-27-2020

It was a Python 3 issue. The fix should now be committed to the latest 4.7 and 4.7-updates branch.