[cleanup]

This commit is contained in:
Jan Grewe 2020-12-31 17:07:16 +01:00
parent ddb39146cd
commit fc65542aee
3 changed files with 18 additions and 17 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ target
env/
__pycache__
main.spec
*.afdesign

View File

@ -15,6 +15,7 @@ class ItemDescriptor():
self.value = value
self.entity_type = entity_type
class NodeType(Enum):
Root = "root"
Section = "section"
@ -37,6 +38,7 @@ class Singleton(type):
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls]
class FileHandler(metaclass=Singleton):
def __init__(self) -> None:
@ -75,7 +77,6 @@ class FileHandler(metaclass=Singleton):
return ItemDescriptor()
@property
def is_valid(self):
return self._nix_file is not None and self._nix_file.is_open()

View File

@ -1,9 +1,8 @@
from PyQt5.QtCore import QAbstractItemModel, QFile, QModelIndex, QSize, Qt
from PyQt5.QtCore import QAbstractItemModel, QModelIndex, Qt
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QHeaderView, QTreeWidgetItem
from PyQt5.QtWidgets import QTreeWidgetItem
from file_handler import ItemDescriptor, NodeType
from IPython import embed
column_names = ['Name', 'Type', 'ID', 'Value', 'Description']