MCPcopy Index your code
hub / github.com/rawpython/remi / __init__

Method __init__

remi/gui.py:3894–3910  ·  view source on GitHub ↗
(self, path_and_filename, text, is_folder=False, *args, **kwargs)

Source from the content-addressed store, hash-verified

3892 """FileFolderItem widget for the FileFolderNavigator"""
3893 path_and_filename = None #the complete path and filename
3894 def __init__(self, path_and_filename, text, is_folder=False, *args, **kwargs):
3895 super(FileFolderItem, self).__init__(*args, **kwargs)
3896 self.path_and_filename = path_and_filename
3897 self.isFolder = is_folder
3898 self.icon = Widget(_class='FileFolderItemIcon')
3899 # the icon click activates the onselection event, that is propagates to registered listener
3900 if is_folder:
3901 self.icon.onclick.connect(self.onclick)
3902 else:
3903 self.icon.onclick.connect(self.onselection)
3904 icon_file = '/res:folder.png' if is_folder else '/res:file.png'
3905 self.icon.css_background_image = "url('%s')" % icon_file
3906 self.label = Label(text)
3907 self.label.onclick.connect(self.onselection)
3908 self.append(self.icon, key='icon')
3909 self.append(self.label, key='text')
3910 self.selected = False
3911
3912 def set_selected(self, selected):
3913 self.selected = selected

Callers

nothing calls this directly

Calls 5

WidgetClass · 0.85
LabelClass · 0.85
connectMethod · 0.80
__init__Method · 0.45
appendMethod · 0.45

Tested by

no test coverage detected