<commit_before>import logging

import plow.client
import plow.gui.constants as constants

from plow.gui.manifest import QtCore, QtGui
from plow.gui.panels import Panel
from plow.gui.event import EventManager
from plow.gui.common import models
from plow.gui.common.widgets import TableWidget
from plow.gui.common.job import JobProgressDelegate
                                    

LOGGER = logging.getLogger(__name__)


class LayerPanel(Panel):

    def __init__(self, name="Layers", parent=None):
        Panel.__init__(self, name, "Layers", parent)

        self.__lastJobId = None

        self.setAttr("refreshSeconds", 5)

        self.setWidget(LayerWidget(self.attrs, self))
        self.setWindowTitle(name)

        EventManager.JobOfInterest.connect(self.__handleJobOfInterestEvent)

    def refresh(self):
        self.widget().refresh()

    def __handleJobOfInterestEvent(self, *args, **kwargs):
        jobId = args[0]
        self.widget().setJobId(jobId)
        self.__lastJobId = jobId


#########################
# LayerWidget
#########################
class LayerWidget(QtGui.QWidget):
    
    WIDTH = [220, 80, 80, 60, 60, 60, 60, 110, 120, 120]

    def __init__(self, attrs, parent=None):
        super(LayerWidget, self).__init__(parent)
        
        self.__attrs = attrs

        self.__view = table = TableWidget(self)
        table.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)

        delegate = JobProgressDelegate(dataRole=LayerModel.ObjectRole, parent=self)
        table.setItemDelegateForColumn(LayerModel.HEADERS.index('Progress'), delegate)

        self.__jobId = None
        self.__model = None

        self.__proxy = proxy = models.AlnumSortProxyModel(self)
        proxy.setSortRole(LayerModel.DataRole)
        table.setModel(proxy)

        layout = QtGui.QVBoxLayout(self)
        layout.setContentsMargins(4,0,4,4)<commit_msg>gui: layer panel column widths now have proper sizes.<commit_after>import logging

import plow.client
import plow.gui.constants as constants

from plow.gui.manifest import QtCore, QtGui
from plow.gui.panels import Panel
from plow.gui.event import EventManager
from plow.gui.common import models
from plow.gui.common.widgets import TableWidget
from plow.gui.common.job import JobProgressDelegate
                                    

LOGGER = logging.getLogger(__name__)


class LayerPanel(Panel):

    def __init__(self, name="Layers", parent=None):
        Panel.__init__(self, name, "Layers", parent)

        self.__lastJobId = None

        self.setAttr("refreshSeconds", 5)

        self.setWidget(LayerWidget(self.attrs, self))
        self.setWindowTitle(name)

        EventManager.JobOfInterest.connect(self.__handleJobOfInterestEvent)

    def refresh(self):
        self.widget().refresh()

    def __handleJobOfInterestEvent(self, *args, **kwargs):
        jobId = args[0]
        self.widget().setJobId(jobId)
        self.__lastJobId = jobId


#########################
# LayerWidget
#########################
class LayerWidget(QtGui.QWidget):
    
    WIDTH = [220, 90, 90, 90, 60, 60, 60, 60, 60, 60]

    def __init__(self, attrs, parent=None):
        super(LayerWidget, self).__init__(parent)
        
        self.__attrs = attrs

        self.__view = table = TableWidget(self)
        table.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)

        delegate = JobProgressDelegate(dataRole=LayerModel.ObjectRole, parent=self)
        table.setItemDelegateForColumn(LayerModel.HEADERS.index('Progress'), delegate)

        self.__jobId = None
        self.__model = None

        self.__proxy = proxy = models.AlnumSortProxyModel(self)
        proxy.setSortRole(LayerModel.DataRole)
        table.setModel(proxy)

        layout = QtGui.QVBoxLayout(self)
        layout.setContentsMargins(4,0,4,4)
{'fraction_non_alphanumeric': 0.12213740458015267, 'fraction_numerical': 0.015003948407475652, 'mean_word_length': 3.1666666666666665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6629152', 'n_tokens_mistral': 1188, 'n_tokens_neox': 1090, 'n_words': 223}