/usr/share/cain/gui/DuplicateDialog.py is in cain 1.10+dfsg-2.
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 60 | """Implements the duplicate dialog."""
import wx
class DuplicateDialog(wx.Dialog):
"""The duplicate dialog."""
def __init__(self, parent=None):
"""."""
wx.Dialog.__init__(self, parent, -1, 'Duplicate the model.')
# Multiplicity.
multiplicitySizer = wx.BoxSizer(wx.HORIZONTAL)
self.multiplicity = wx.SpinCtrl(self, -1, value='2', min=2, max=1000000,
initial=2)
multiplicitySizer.Add(self.multiplicity, 0, wx.ALL, 5)
label = wx.StaticText(self, -1, 'Multiplicity.')
multiplicitySizer.Add(label, 0, wx.ALL, 5)
# Randomly scale propensities.
self.scale = wx.CheckBox(self, -1, 'Randomly scale propensities.')
# Buttons.
okButton = wx.Button(self, wx.ID_OK, 'OK')
okButton.SetDefault()
cancelButton = wx.Button(self, wx.ID_CANCEL, 'Cancel')
buttons = wx.BoxSizer(wx.HORIZONTAL)
buttons.Add(okButton, 0, wx.ALIGN_RIGHT, 5)
buttons.Add(cancelButton, 0, wx.ALIGN_RIGHT, 5)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(multiplicitySizer, 0, wx.EXPAND | wx.ALL, border=5)
sizer.Add(self.scale, 0, wx.EXPAND | wx.ALL, border=5)
sizer.Add(buttons, 0, wx.ALIGN_RIGHT | wx.ALIGN_BOTTOM, 5)
self.SetSizer(sizer)
self.Layout()
self.Fit()
def getMultiplicity(self):
return self.multiplicity.GetValue()
def useScaling(self):
return self.scale.GetValue()
def main():
app = wx.PySimpleApp()
frame = DuplicateDialog()
result = frame.ShowModal()
if result == wx.ID_OK:
print 'OK'
print frame.getMultiplicity()
print frame.useScaling()
else:
print 'Cancel'
frame.Destroy()
app.MainLoop()
if __name__ == '__main__':
main()
|