/usr/share/system-config-kickstart/scripts.py is in system-config-kickstart 2.5.20-0ubuntu25.
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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | ## Kickstart Configurator - A graphical kickstart file generator
## Copyright (C) 2000, 2001, 2002, 2003 Red Hat, Inc.
## Copyright (C) 2000, 2001, 2002, 2003 Brent Fox <bfox@redhat.com>
## Tammy Fox <tfox@redhat.com>
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#Kickstart Configurator Scripts
import gtk
import gtk.glade
import getopt
import string
class scripts:
def __init__(self, xml, kickstartData):
self.kickstartData = kickstartData
self.chroot_checkbutton = xml.get_widget("chroot_checkbutton")
self.interpreter_checkbutton = xml.get_widget("interpreter_checkbutton")
self.interpreter_entry = xml.get_widget("interpreter_entry")
self.pre_interpreter_checkbutton = xml.get_widget("pre_interpreter_checkbutton")
self.pre_interpreter_entry = xml.get_widget("pre_interpreter_entry")
self.pre_textview = xml.get_widget("pre_textview")
self.post_textview = xml.get_widget("post_textview")
self.interpreter_checkbutton.connect("toggled", self.interpreter_cb)
self.pre_interpreter_checkbutton.connect("toggled", self.pre_interpreter_cb)
def interpreter_cb(self, args):
self.interpreter_entry.set_sensitive(self.interpreter_checkbutton.get_active())
def pre_interpreter_cb(self, args):
self.pre_interpreter_entry.set_sensitive(self.pre_interpreter_checkbutton.get_active())
def getData(self):
self.preData()
self.postData()
def preData(self):
if self.pre_interpreter_checkbutton.get_active():
pre_command = "--interpreter=" + self.pre_interpreter_entry.get_text()
self.kickstartData.setPreLine(pre_command)
else:
self.kickstartData.setPreLine(None)
pre_buffer = self.pre_textview.get_buffer()
data = pre_buffer.get_text(pre_buffer.get_start_iter(),pre_buffer.get_end_iter(),True)
data = string.strip(data)
if data != "":
self.kickstartData.setPreList([data])
def postData(self):
post_command = ""
if self.chroot_checkbutton.get_active():
post_command = "--nochroot "
if self.interpreter_checkbutton.get_active():
post_command = post_command + "--interpreter=" + self.interpreter_entry.get_text()
if post_command == "":
self.kickstartData.setPostLine(None)
else:
self.kickstartData.setPostLine(post_command)
post_buffer = self.post_textview.get_buffer()
data = post_buffer.get_text(post_buffer.get_start_iter(),post_buffer.get_end_iter(),True)
data = string.strip(data)
if data == "":
self.kickstartData.setPostList([])
else:
self.kickstartData.setPostList([data])
def fillData(self):
if self.kickstartData.getPreLine():
line = self.kickstartData.getPreLine()
opts, args = getopt.getopt(line, "i:", ["interpreter="])
for opt, value in opts:
if opt == "--interpreter":
self.pre_interpreter_checkbutton.set_active(True)
self.pre_interpreter_entry.set_text(value)
if self.kickstartData.getPreList():
list = self.kickstartData.getPreList()
iter = self.pre_textview.get_buffer().get_iter_at_offset(0)
for line in list:
self.pre_textview.get_buffer().insert(iter, (line + "\n"))
if self.kickstartData.getPostLine():
line = self.kickstartData.getPostLine()
opts, args = getopt.getopt(line, "i:", ["interpreter=", "nochroot"])
for opt, value in opts:
if opt == "--interpreter":
self.interpreter_checkbutton.set_active(True)
self.interpreter_entry.set_text(value)
if opt == "--nochroot":
self.chroot_checkbutton.set_active(True)
if self.kickstartData.getPostList():
list = self.kickstartData.getPostList()
iter = self.post_textview.get_buffer().get_iter_at_offset(0)
for line in list:
self.post_textview.get_buffer().insert(iter, (line + "\n"))
|