<commit_before>################################################################################
# This software was developed by the University of Tennessee as part of the
# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
# project funded by the US National Science Foundation.
#
# See the license text in license.txt
#
# copyright 2010, University of Tennessee
################################################################################
"""
This module provides Graphic interface for the data_manager module.
"""
import wx
from wx.build import build_options

import sys
from wx.lib.scrolledpanel import ScrolledPanel
import wx.lib.agw.customtreectrl as CT
from sas.sasgui.guiframe.dataFitting import Data1D
from sas.sasgui.guiframe.dataFitting import Data2D
from sas.sasgui.guiframe.panel_base import PanelBase
from sas.sasgui.guiframe.events import StatusEvent
from sas.sasgui.guiframe.events import EVT_DELETE_PLOTPANEL
from sas.sasgui.guiframe.events import NewLoadDataEvent
from sas.sasgui.guiframe.events import NewPlotEvent
from sas.sasgui.guiframe.gui_style import GUIFRAME
from sas.sasgui.guiframe.events import NewBatchEvent
from sas.sascalc.dataloader.loader import Loader
# from sas.sasgui.guiframe.local_perspectives.plotting.masking \
#    import FloatPanel as QucikPlotDialog
from sas.sasgui.guiframe.local_perspectives.plotting.SimplePlot \
    import PlotFrame as QucikPlotDialog
import sas.sasgui.guiframe.config as config

# Check version
toks = str(wx.__version__).split('.')
if int(toks[1]) < 9:
    if int(toks[2]) < 12:
        wx_version = 811
    else:
        wx_version = 812
else:
    wx_version = 900

extension_list = []
if config.APPLICATION_STATE_EXTENSION is not None:
    extension_list.append(config.APPLICATION_STATE_EXTENSION)
EXTENSIONS = config.PLUGIN_STATE_EXTENSIONS + extension_list
PLUGINS_WLIST = config.PLUGINS_WLIST
APPLICATION_WLIST = config.APPLICATION_WLIST

# Control panel width
if sys.platform.count("win32") > 0:
    PANEL_WIDTH = 235
    PANEL_HEIGHT = 700
    CBOX_WIDTH = 140
    BUTTON_WIDTH = 80
    FONT_VARIANT = 0
    IS_MAC = False
else:
    PANEL_WIDTH = 255
    PANEL_HEIGHT = 750
    CBOX_WIDTH = 155
    BUTTON_WIDTH = 100
    FONT_VARIANT = 1
    IS_MAC = True

STYLE_FLAG = wx.RAISED_BORDER | CT.TR_HAS_BUTTONS | CT.TR_HIDE_ROOT |\
                    wx.WANTS_CHARS | CT.TR_HAS_VARIABLE_ROW_HEIGHT


class DataTreeCtrl(CT.CustomTreeCtrl):
    """
    Check list control to be used for Data Panel
    """
    def __init__(self, parent, root, *args, **kwds):
        # agwstyle is introduced in wx.2.8.11 but is not working for mac
        if IS_MAC and wx_version < 812:
            try:
                kwds['style'] = STYLE_FLAG
                CT.CustomTreeCtrl.__init__(self, parent, *args, **kwds)
            except:
                del kwds['style']
                CT.CustomTreeCtrl.__init__(self, parent, *args, **kwds)<commit_msg>data panel: mark root as visible on both mac and windows<commit_after>################################################################################
# This software was developed by the University of Tennessee as part of the
# Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
# project funded by the US National Science Foundation.
#
# See the license text in license.txt
#
# copyright 2010, University of Tennessee
################################################################################
"""
This module provides Graphic interface for the data_manager module.
"""
import wx
from wx.build import build_options

import sys
from wx.lib.scrolledpanel import ScrolledPanel
import wx.lib.agw.customtreectrl as CT
from sas.sasgui.guiframe.dataFitting import Data1D
from sas.sasgui.guiframe.dataFitting import Data2D
from sas.sasgui.guiframe.panel_base import PanelBase
from sas.sasgui.guiframe.events import StatusEvent
from sas.sasgui.guiframe.events import EVT_DELETE_PLOTPANEL
from sas.sasgui.guiframe.events import NewLoadDataEvent
from sas.sasgui.guiframe.events import NewPlotEvent
from sas.sasgui.guiframe.gui_style import GUIFRAME
from sas.sasgui.guiframe.events import NewBatchEvent
from sas.sascalc.dataloader.loader import Loader
# from sas.sasgui.guiframe.local_perspectives.plotting.masking \
#    import FloatPanel as QucikPlotDialog
from sas.sasgui.guiframe.local_perspectives.plotting.SimplePlot \
    import PlotFrame as QucikPlotDialog
import sas.sasgui.guiframe.config as config

# Check version
toks = str(wx.__version__).split('.')
if int(toks[1]) < 9:
    if int(toks[2]) < 12:
        wx_version = 811
    else:
        wx_version = 812
else:
    wx_version = 900

extension_list = []
if config.APPLICATION_STATE_EXTENSION is not None:
    extension_list.append(config.APPLICATION_STATE_EXTENSION)
EXTENSIONS = config.PLUGIN_STATE_EXTENSIONS + extension_list
PLUGINS_WLIST = config.PLUGINS_WLIST
APPLICATION_WLIST = config.APPLICATION_WLIST

# Control panel width
if sys.platform.count("win32") > 0:
    PANEL_WIDTH = 235
    PANEL_HEIGHT = 700
    CBOX_WIDTH = 140
    BUTTON_WIDTH = 80
    FONT_VARIANT = 0
    IS_MAC = False
else:
    PANEL_WIDTH = 255
    PANEL_HEIGHT = 750
    CBOX_WIDTH = 155
    BUTTON_WIDTH = 100
    FONT_VARIANT = 1
    IS_MAC = True

STYLE_FLAG = (wx.RAISED_BORDER | CT.TR_HAS_BUTTONS |
                    wx.WANTS_CHARS | CT.TR_HAS_VARIABLE_ROW_HEIGHT)


class DataTreeCtrl(CT.CustomTreeCtrl):
    """
    Check list control to be used for Data Panel
    """
    def __init__(self, parent, root, *args, **kwds):
        # agwstyle is introduced in wx.2.8.11 but is not working for mac
        if IS_MAC and wx_version < 812:
            try:
                kwds['style'] = STYLE_FLAG
                CT.CustomTreeCtrl.__init__(self, parent, *args, **kwds)
            except:
                del kwds['style']
                CT.CustomTreeCtrl.__init__(self, parent, *args, **kwds)
{'fraction_non_alphanumeric': 0.12525458248472504, 'fraction_numerical': 0.0186693822131704, 'mean_word_length': 3.8742762613730357, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4316900', 'n_tokens_mistral': 2007, 'n_tokens_neox': 1841, 'n_words': 484}