/usr/share/pyshared/guidata/tests/bool_selector.py is in python-guidata 1.4.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | # -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 CEA
# Pierre Raybaut
# Licensed under the terms of the CECILL License
# (see guidata/__init__.py for details)
"""
DataItem groups and group selection
DataSet items may be included in groups (these items are then shown in group
box widgets in the editing dialog box) and item groups may be enabled/disabled
using one group parameter (a boolean item).
"""
SHOW = True # Show test in GUI-based test launcher
from guidata.dataset.datatypes import DataSet, BeginGroup, EndGroup, ValueProp
from guidata.dataset.dataitems import BoolItem, FloatItem
prop1 = ValueProp(False)
prop2 = ValueProp(False)
class GroupSelection(DataSet):
u"""
Group selection test
<b>Group selection example:</b>
"""
g1 = BeginGroup("group 1")
enable1 = BoolItem(u"Enable parameter set #1",
help=u"If disabled, the following parameters will be ignored",
default=False).set_prop("display", store=prop1)
param1_1 = FloatItem(u"Param 1.1",
default=0, min=0).set_prop("display", active=prop1)
param1_2 = FloatItem(u"Param 1.2",
default=.93).set_prop("display", active=prop1)
_g1 = EndGroup("group 1")
g2 = BeginGroup("group 2")
enable2 = BoolItem(u"Enable parameter set #2",
help=u"If disabled, the following parameters will be ignored",
default=True).set_prop("display", store=prop2)
param2_1 = FloatItem(u"Param 2.1",
default=0, min=0).set_prop("display", active=prop2)
param2_2 = FloatItem(u"Param 2.2",
default=.93).set_prop("display", active=prop2)
_g2 = EndGroup("group 2")
if __name__ == '__main__':
# Create QApplication
import guidata
_app = guidata.qapplication()
prm = GroupSelection()
prm.edit()
print prm
|