[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/ env/
__pycache__ __pycache__
main.spec main.spec
*.afdesign

View File

@ -15,6 +15,7 @@ class ItemDescriptor():
self.value = value self.value = value
self.entity_type = entity_type self.entity_type = entity_type
class NodeType(Enum): class NodeType(Enum):
Root = "root" Root = "root"
Section = "section" Section = "section"
@ -37,6 +38,7 @@ class Singleton(type):
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls] return cls._instances[cls]
class FileHandler(metaclass=Singleton): class FileHandler(metaclass=Singleton):
def __init__(self) -> None: def __init__(self) -> None:
@ -75,7 +77,6 @@ class FileHandler(metaclass=Singleton):
return ItemDescriptor() return ItemDescriptor()
@property @property
def is_valid(self): def is_valid(self):
return self._nix_file is not None and self._nix_file.is_open() 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.QtGui import QIcon
from PyQt5.QtWidgets import QHeaderView, QTreeWidgetItem from PyQt5.QtWidgets import QTreeWidgetItem
from file_handler import ItemDescriptor, NodeType from file_handler import ItemDescriptor, NodeType
from IPython import embed
column_names = ['Name', 'Type', 'ID', 'Value', 'Description'] column_names = ['Name', 'Type', 'ID', 'Value', 'Description']