-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin-tools.py
44 lines (39 loc) · 1.09 KB
/
admin-tools.py
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
#!/usr/bin/python3
from yast import import_module
import_module('UI')
from yast import *
from subprocess import Popen
import os
def choose_module():
module = None
header = Header('')
items = [Item(Id('aduc'), 'Active Directory Users and Computers'),
Item(Id('adsi'), 'ADSI Edit'),
Item(Id('dns-manager'), 'DNS'),
Item(Id('gpmc'), 'Group Policy Management'),
]
dialog = VBox(
Table(Id('tools'), Opt('notify'), header, items),
VSpacing(.3),
Right(HBox(
PushButton(Id('close'), 'Close'),
))
)
UI.OpenDialog(Opt('mainDialog'), dialog)
UI.SetApplicationTitle('Administrative Tools')
while True:
ret = UI.WaitForEvent()
ycpbuiltins.y2error(str(ret))
if ret['ID'] == 'close':
break
else:
module = UI.QueryWidget('tools', 'Value')
break
UI.CloseDialog()
return module
def run(module):
Popen(['/usr/sbin/yast2', module]).wait()
if __name__ == "__main__":
module = choose_module()
if module:
run(module)