[style] codestyle fixes
This commit is contained in:
parent
d77b0b9e9a
commit
703b647321
@ -1,14 +1,16 @@
|
||||
from nixview.data_models.tree_model import NixTreeItem
|
||||
from PyQt5.QtCore import QObject, pyqtSignal
|
||||
|
||||
|
||||
class Communicate(QObject):
|
||||
"""
|
||||
Small class for across app communication. Defines signals, to which other classes can connect.
|
||||
"""
|
||||
open_recent = pyqtSignal(str)
|
||||
|
||||
|
||||
item_selected = pyqtSignal(NixTreeItem)
|
||||
|
||||
|
||||
plot_error = pyqtSignal(str)
|
||||
|
||||
communicator = Communicate()
|
||||
|
||||
|
||||
communicator = Communicate()
|
||||
|
@ -7,7 +7,7 @@ application = "nixview"
|
||||
version = 0.1
|
||||
|
||||
settings_recent_files_key = "/".join([organization, application, "recent_files"])
|
||||
settings_recent_file_max_count_key = "/".join([organization, application, "recent_files_max_count"])
|
||||
settings_recent_file_max_count_key = "/".join([organization, application, "recent_files_max_count"])
|
||||
settings_recent_file_max_count = 10
|
||||
|
||||
max_chunksize = 1000000000
|
||||
@ -20,12 +20,13 @@ ICONS_PATHS = glob.glob(os.path.join(ICONS_FOLDER, "*.png"))
|
||||
ICONS_PATHS.extend(glob.glob(os.path.join(ICONS_FOLDER, "*.icns")))
|
||||
ICONS_PATHS = sorted(ICONS_PATHS)
|
||||
ICON_DICT = {}
|
||||
|
||||
for icon in ICONS_PATHS:
|
||||
ICON_DICT[icon.split(os.sep)[-1].split(".")[0]] = icon
|
||||
|
||||
|
||||
def get_icon(name):
|
||||
if name in ICON_DICT.keys():
|
||||
return QIcon(ICON_DICT[name])
|
||||
else:
|
||||
return QIcon("nix_logo.png")
|
||||
|
||||
|
@ -4,6 +4,7 @@ from PyQt5.QtWidgets import QApplication
|
||||
from nixview.ui.mainwindow import NixView
|
||||
import argparse
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="NixView. Viewer for NIX data files. For more on nix see https://nixio.readthedocs.io/en/master")
|
||||
parser.add_argument("file", nargs="?", default="", type=str, help="The nix file that should be opened.")
|
||||
@ -17,5 +18,6 @@ def main():
|
||||
window.show()
|
||||
sys.exit(app.exec_())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
@ -1,13 +1,16 @@
|
||||
import os
|
||||
import datetime as dt
|
||||
|
||||
|
||||
class ItemDescriptor():
|
||||
def __init__(self, name=None, id=None, type=None, value=None, unit=None, label=None, definition=None, block_id=None, entity_type=None, shape=None, metadata=None, data_type=None, source_id=None, created_at=None, updated_at=None) -> None:
|
||||
def __init__(self, name=None, id=None, type=None, value=None, unit=None, label=None,
|
||||
definition=None, block_id=None, entity_type=None, shape=None, metadata=None,
|
||||
data_type=None, source_id=None, created_at=None, updated_at=None) -> None:
|
||||
super().__init__()
|
||||
self.name = name
|
||||
self.type = type
|
||||
self.id = id
|
||||
self.block_id= block_id
|
||||
self.block_id = block_id
|
||||
self.definition = definition
|
||||
self.value = value
|
||||
self.unit = unit
|
||||
@ -22,7 +25,6 @@ class ItemDescriptor():
|
||||
self.best_xdim = None
|
||||
self.suggested_plotter = None
|
||||
|
||||
|
||||
def to_html(self):
|
||||
descr = "<html><h4>%s: %s</h4>" % (self.type, self.name)
|
||||
descr += "<ol style='list-style-type:none'>"
|
||||
@ -39,10 +41,10 @@ class ItemDescriptor():
|
||||
descr += "<li><small><b>created at:</b> %s</small></li>" % (str(dt.datetime.fromtimestamp(self.created_at)) if self.created_at else "")
|
||||
descr += "<li><small><b>updated at:</b> %s</small></li>" % (str(dt.datetime.fromtimestamp(self.updated_at)) if self.updated_at else "")
|
||||
descr += "</ol>"
|
||||
|
||||
|
||||
descr += "</html>"
|
||||
return descr
|
||||
|
||||
|
||||
def __str__(self) -> str:
|
||||
return "Entity: %s, id: %s, type: %s " % (self.name, self.id, self.entity_type)
|
||||
|
||||
@ -62,7 +64,7 @@ class FileDescriptor():
|
||||
self.tag_count = 0
|
||||
self.group_count = 0
|
||||
self.data_frame_count = 0
|
||||
|
||||
|
||||
def toHtml(self):
|
||||
def namAndPath(filename):
|
||||
parts = filename.split(os.sep)
|
||||
@ -92,4 +94,3 @@ class FileDescriptor():
|
||||
descr += "</ol>"
|
||||
descr += "</html>"
|
||||
return descr
|
||||
|
||||
|
@ -13,7 +13,7 @@ class NodeType(Enum):
|
||||
Tag = "Tag"
|
||||
MultiTag = "Multi Tag"
|
||||
Group = "Group"
|
||||
Feature="Feature"
|
||||
Feature = "Feature"
|
||||
|
||||
|
||||
class TreeType(Enum):
|
||||
@ -28,4 +28,3 @@ class PlotterTypes(Enum):
|
||||
CategoryPlotter = "category"
|
||||
EventPlotter = "event"
|
||||
Undecided = "undecided"
|
||||
|
||||
|
@ -2,4 +2,4 @@
|
||||
from nixview.nixview import main
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
|
Loading…
Reference in New Issue
Block a user