/usr/lib/gdesklets/display/targetregistry.py is in gdesklets 0.36.1-5.
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 56 57 58 59 | #
# Registry for DataTargets. To add a new target just add an appropriate entry
# to _REGISTRY.
#
from TargetAlignment import TargetAlignment
from TargetArray import TargetArray
from TargetDisplay import TargetDisplay
from TargetEntry import TargetEntry
from TargetExpander import TargetExpander
from TargetFrame import TargetFrame
from TargetGauge import TargetGauge
from TargetGroup import TargetGroup
from TargetImage import TargetImage
from TargetLabel import TargetLabel
from TargetBonoboControl import TargetBonoboControl
from TargetCanvas import TargetCanvas
from TargetPlotter import TargetPlotter
_targets = {
"alignment" : (TargetAlignment, True),
"array" : (TargetArray, False),
"display" : (TargetDisplay, False),
"entry" : (TargetEntry, False),
"expander" : (TargetExpander, True),
"frame" : (TargetFrame, True),
"gauge" : (TargetGauge, True),
"group" : (TargetGroup, False),
"image" : (TargetImage, False),
"label" : (TargetLabel, False),
"canvas" : (TargetCanvas, False),
"embed" : (TargetBonoboControl, False),
"plotter" : (TargetPlotter, False)
}
#
# Creates and returns the given target.
#
def create(name, parent):
try:
clss, one_child = _targets[name]
except KeyError:
raise UserError(_("Unknown element <b><%s></b>") % name,
_("Either there is a typo in the .display file "
"or you have an incompatible version of gDesklets."))
obj = clss(name, parent)
return obj
#
# Returns whether the given container accepts more than one children.
#
def one_child(name):
clss, one_child = _targets[name]
return one_child
|