1
2
3
4 import wx
5
6
7
8
9
10
11
12
13 from arcjobtool.ArcUtils import *
14
17
18 kwds["style"] = wx.DEFAULT_DIALOG_STYLE
19 wx.Dialog.__init__(self, *args, **kwds)
20 self.proxyNotebook = wx.Notebook(self, -1, style=0)
21 self.localProxyPane = wx.Panel(self.proxyNotebook, -1)
22 self.label_1 = wx.StaticText(self.localProxyPane, -1, "Private key passphrase")
23 self.passphraseText = wx.TextCtrl(self.localProxyPane, -1, "", style=wx.TE_PASSWORD)
24 self.static_line_1 = wx.StaticLine(self.localProxyPane, -1)
25 self.proxyTypeRadio = wx.RadioBox(self.localProxyPane, -1, "Proxy Type", choices=["GSI proxy", "RFC 3820 proxy"], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
26 self.proxyLifetimeRadio = wx.RadioBox(self.localProxyPane, -1, "Proxy Lifetime", choices=["12 h", "24 h", "48 h"], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
27 self.myProxyPane = wx.Panel(self.proxyNotebook, -1)
28 self.okButton = wx.Button(self, -1, "OK")
29 self.exitButton = wx.Button(self, -1, "Exit")
30
31 self.__set_properties()
32 self.__do_layout()
33
34 self.Bind(wx.EVT_BUTTON, self.onOK, self.okButton)
35 self.Bind(wx.EVT_BUTTON, self.onExit, self.exitButton)
36
37
38 self.__initDialog()
39
41
42 self.SetTitle("Proxy creation")
43 self.SetSize((400, 300))
44 self.passphraseText.SetMinSize((250, 27))
45 self.passphraseText.SetFocus()
46 self.proxyTypeRadio.SetSelection(0)
47 self.proxyLifetimeRadio.SetSelection(0)
48 self.okButton.SetDefault()
49
50
52
53 sizer_3 = wx.BoxSizer(wx.VERTICAL)
54 sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
55 sizer_5 = wx.BoxSizer(wx.VERTICAL)
56 sizer_7 = wx.BoxSizer(wx.HORIZONTAL)
57 sizer_8 = wx.BoxSizer(wx.HORIZONTAL)
58 sizer_6 = wx.BoxSizer(wx.VERTICAL)
59 sizer_6.Add(self.label_1, 0, 0, 0)
60 sizer_6.Add(self.passphraseText, 0, 0, 0)
61 sizer_8.Add(sizer_6, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5)
62 sizer_5.Add(sizer_8, 0, wx.TOP|wx.ALIGN_CENTER_HORIZONTAL, 8)
63 sizer_5.Add(self.static_line_1, 0, wx.TOP|wx.BOTTOM|wx.EXPAND, 10)
64 sizer_7.Add(self.proxyTypeRadio, 0, wx.RIGHT, 8)
65 sizer_7.Add(self.proxyLifetimeRadio, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
66 sizer_5.Add(sizer_7, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
67 self.localProxyPane.SetSizer(sizer_5)
68 self.proxyNotebook.AddPage(self.localProxyPane, "Local proxy")
69 self.proxyNotebook.AddPage(self.myProxyPane, "MyProxy")
70 sizer_3.Add(self.proxyNotebook, 1, wx.ALL|wx.EXPAND, 4)
71 sizer_4.Add(self.okButton, 0, wx.RIGHT, 4)
72 sizer_4.Add(self.exitButton, 0, 0, 0)
73 sizer_3.Add(sizer_4, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 4)
74 self.SetSizer(sizer_3)
75 self.Layout()
76
77
79 self.dialogResult = False
80
81 - def onOK(self, event):
82 self.dialogResult = True
83 self.Close()
84
86 self.dialogResult = False
87 self.Close()
88
90 passphrase = self.passphraseText.GetValue()
91 self.passphraseText.SetValue(" ")
92 self.passphraseText.SetValue("")
93 return passphrase
94
96 if self.proxyTypeRadio.GetSelection()==0:
97 return "gsi2"
98 else:
99 return "rfc"
100
102 if self.proxyLifetimeRadio.GetSelection() == 0:
103 return str(12)
104 elif self.proxyLifetimeRadio.GetSelection() == 1:
105 return str(24)
106 elif self.proxyLifetimeRadio.GetSelection() == 2:
107 return str(48)
108
109 passphrase = property(getPassphrase)
110 proxyType = property(getProxyType)
111 proxyLifetime = property(getProxyLifetime)
112
113
114
115