Implement logging

This commit is contained in:
BasioMeusPuga
2019-01-19 20:31:19 +05:30
parent 506c458544
commit a45e183914
10 changed files with 51 additions and 66 deletions

View File

@@ -102,7 +102,8 @@ class TableProxyModel(QtCore.QSortFilterProxyModel):
try:
return self.header_data[column]
except IndexError:
print('Table proxy model: Can\'t find header for column', column)
logger.error(
'Table proxy model: Can\'t find header for column' + str(column))
# The column will be called IndexError. Not a typo.
return 'IndexError'
@@ -347,31 +348,3 @@ class MostExcellentFileSystemModel(QtWidgets.QFileSystemModel):
for i in deletable:
del self.tag_data[i]
# TODO
# Unbork this
class FileSystemProxyModel(QtCore.QSortFilterProxyModel):
def __init__(self, parent=None):
super(FileSystemProxyModel, self).__init__(parent)
def filterAcceptsRow(self, row_num, parent):
model = self.sourceModel()
filter_out = [
'boot', 'dev', 'etc', 'lost+found', 'opt', 'pdb',
'proc', 'root', 'run', 'srv', 'sys', 'tmp', 'twonky',
'usr', 'var', 'bin', 'kdeinit5__0', 'lib', 'lib64', 'sbin']
name_index = model.index(row_num, 0)
valid_data = model.data(name_index)
print(valid_data)
return True
try:
if valid_data in filter_out:
return False
except AttributeError:
pass
return True