install

installer
Log | Files | Refs | README | LICENSE | git clone https://git.ne02ptzero.me/git/install

commit fe137c981534360852a7a60112906dd4d482084c
parent 0387e110047941b37d7919584f84bc99e695b450
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Mon, 14 Nov 2016 17:49:36 +0100

Clean(Repository)

Diffstat:
Dinput.py | 123-------------------------------------------------------------------------------
Dmain.py | 32--------------------------------
Dscreen.py | 229-------------------------------------------------------------------------------
Dscreens/__init__.py | 0
Dscreens/config/__init__.py | 0
Dscreens/config/config.py | 138-------------------------------------------------------------------------------
Dscreens/main/__init__.py | 0
Dscreens/main/main.py | 105-------------------------------------------------------------------------------
Dscreens/network/__init__.py | 0
Dscreens/network/network.py | 105-------------------------------------------------------------------------------
Dscreens/partitions/__init__.py | 0
Dscreens/partitions/partitions.py | 144-------------------------------------------------------------------------------
12 files changed, 0 insertions(+), 876 deletions(-)

diff --git a/input.py b/input.py @@ -1,123 +0,0 @@ -################################### LICENSE #################################### -# Copyright 2016 Louis Solofrizzo # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ - -## -# input.py -# Created: 24/10/2016 -# By: Louis Solofrizzo <louis@morphux.org> -## - -import curses - -class Input: - - choices = ["ACCEPT", "CANCEL"] - current_choice = 0 - current_string = "" - current_f_callback = 0 - in_input = 0 - entry_type = "" - - def s_input(self, win, title, s_def, f_callback, type): - size = win.getmaxyx() - if self.in_input == 0: - self.current_f_callback = f_callback - self.current_string = s_def - self.in_input = 1 - self.current_choice = 0 - self.entry_type = type - if self.current_choice == 0: - curses.curs_set(1) - if type == "text" or type == "password": - self.center(win, 2, size[1], title, curses.A_BOLD) - self.show_choices(win, size[1], 6) - self.input_string(win, 4, size[1]) - - def title(self, x, y, title, win): - size = win.getmaxyx() - self.center(win, 2, size[1], title, curses.A_BOLD) - - def show_choices(self, win, x, y): - t_len = 0 - i = 0 - for s in self.choices: - t_len += len(s) - x = (x / 2) - ((t_len + 9) / 2) - for s in self.choices: - flag = 0 - win.addstr(y, x, "<") - if i == 0: - flag = curses.color_pair(3) - else: - flag = curses.color_pair(1) - if (i + 1 == self.current_choice): - flag |= curses.A_BOLD | curses.A_REVERSE - win.addstr(y, x + 1, s, flag) - x += 1 + len(s) - win.addstr(y, x, "> ") - x += 6 - i += 1 - - def input_string(self, win, y, x): - flag = 0 - start_x = int((x * 0.25) / 2) - if (self.current_choice == 0): - flag |= curses.color_pair(4) - if self.entry_type == "text": - win.addstr(y, start_x, self.current_string, curses.A_REVERSE | flag) - elif self.entry_type == "password": - win.addstr(y, start_x, '*' * len(self.current_string), curses.A_REVERSE | flag) - j = start_x + len(self.current_string) - while j < x - start_x: - win.addstr(y, j, " ", curses.A_REVERSE | flag) - j += 1 - win.move(y, start_x + len(self.current_string)) - - def center(self, win, y, x, string, attr = 0): - win.addstr(y, (x / 2) - len(string) / 2, string, attr) - - def input(self, key, error = 0): - if (self.current_choice == 0): - if (key == curses.KEY_BACKSPACE or key == 127 or key == 0x7f): - self.current_string = self.current_string[:-1] - elif (key > 31 and key < 127): - self.current_string += str(chr(key)) - if (key == 9): - if (self.current_choice < 2): - curses.curs_set(0) - self.current_choice += 1 - else: - if error == 0: - curses.curs_set(1) - self.current_choice = 0; - else: - self.current_choice = 1; - elif (key == curses.KEY_ENTER or key == 10 or key == 13): - if (self.current_choice == 1): - if error == 0: - self.in_input = 0 - curses.curs_set(0) - return self.current_f_callback(self.current_string) - else: - return 1 - elif (self.current_choice == 2): - if error == 0: - curses.curs_set(0) - self.in_input = 0 - return -1 - else: - return 2 - return 0 diff --git a/main.py b/main.py @@ -1,32 +0,0 @@ -#!/usr/bin/python -################################### LICENSE #################################### -# Copyright 2016 Louis Solofrizzo # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ - -## -# main.py -# Created: 21/10/2016 -# By: Louis Solofrizzo <louis@morphux.org> -## - -# Imports - -from screen import Screen - -def main(): - cur = Screen() - cur.loop() - -main() diff --git a/screen.py b/screen.py @@ -1,229 +0,0 @@ -################################### LICENSE #################################### -# Copyright 2016 Louis Solofrizzo # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ - -## -# curses.py -# Created: 21/10/2016 -# By: Louis Solofrizzo <louis@morphux.org> -## - -# Imports - -import curses -import os -from input import Input - -class Screen: - - # Variables - stdscr = {} - modules = {} - screens = [] - prev_id = 0 - curr_screen = {} - o_config = {"version": "1.0"} - in_error = 0 - error_win = 0 - error_string = "" - input = 0 - title = " __ __ _ \n\ - | \\/ | | | \n\ - | \\ / | ___ _ __ _ __ | |__ _ ___ __\n\ - | |\\/| |/ _ \\| '__| '_ \\| '_ \\| | | \ \\/ /\n\ - | | | | (_) | | | |_) | | | | |_| |> < \n\ - |_| |_|\\___/|_| | .__/|_| |_|\\__,_/_/\\_\\\n\ - | | \n\ - |_| \n\ -" - - - # Construct function - def __init__(self): - self.stdscr = curses.initscr() - curses.noecho() - curses.cbreak() - self.stdscr.keypad(1) - curses.start_color() - curses.curs_set(0) - self.load_screens() - self.init_colors() - - # Destructor function - def __del__(self): - curses.nocbreak() - self.stdscr.keypad(0) - curses.echo() - curses.curs_set(1) - os.system('stty sane') - os.system('clear') - print self.o_config - exit(0) - - # Load differents modules in the path screens/ - def load_screens(self, path = "screens"): - res = {} - lst = os.listdir(path) - dir = [] - for d in lst: - s = os.path.abspath(path) + os.sep + d - if os.path.isdir(s) and os.path.exists(s + os.sep + "__init__.py"): - dir.append(d) - for d in dir: - res[d] = __import__(path + "." + d + "." + d, fromlist = ["*"]) - res[d] = getattr(res[d], d.title()) - self.modules = res - self.get_screens_infos() - - # Get infos on screens - def get_screens_infos(self): - config = {} - for name, klass in self.modules.items(): - print("Reading "+ name +" module...") - klass = klass() - config = klass.init(self) - self.screens.append(klass) - if config["id"] == 0: - self.curr_screen = klass - print("Done !") - - # Colors init - def init_colors(self): - curses.init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK) - curses.init_pair(2, curses.COLOR_BLUE, curses.COLOR_BLACK) - curses.init_pair(3, curses.COLOR_GREEN, curses.COLOR_BLACK) - curses.init_pair(4, curses.COLOR_BLUE, curses.COLOR_WHITE) - - # Print morphux title and installer version - def print_title(self, win): - size = win.getmaxyx() - y = size[0] / 7; - x = (size[1] / 2) - (44 / 2) - for c in self.title: - win.addstr(y, x, c, curses.color_pair(2) | curses.A_BOLD) - x = x + 1 - if c == '\n': - y = y + 1 - x = (size[1] / 2) - (44 / 2) - win.addstr(y + 1, (size[1] / 2) - 8, "__Installer v1__", curses.A_REVERSE) - return y - - # Print text centered - def center(self, win, y, x, string, attr = 0): - win.addstr(y, (x / 2) - len(string) / 2, string, attr) - - # Change the current screen - def change_screen(self, id): - for s in self.screens: - if s.config["id"] == id: - self.prev_id = self.curr_screen.config["id"] - self.curr_screen = s - s.reset() - - # Configuration set - def config(self, key, val): - self.o_config[key] = val - - # Error Pop Up - def error(self, string, choice = 0): - if self.error_string == "": - self.error_string = string - size = self.stdscr.getmaxyx() - self.error_win = curses.newwin(10, int(size[1] * 0.5), self.print_title(self.stdscr) + 5, int(size[1] * 0.5 / 2)) - self.error_win.attrset(curses.color_pair(1) | curses.A_BOLD); - self.error_win.border() - size = self.error_win.getmaxyx() - self.center(self.error_win, 4, size[1], self.error_string) - if (choice): - self.in_error = 2 - self.input.show_choices(self.error_win, size[1], 6) - else: - self.center(self.error_win, 7, size[1], "<OK>", curses.A_REVERSE) - self.in_error = 1 - curses.curs_set(0) - - # Main Loop - def loop(self): - quit = 0 - key = 0 - c_input = 0 - input = Input() - self.input = input - size = self.stdscr.getmaxyx() - height = size[0] / 4 - if height < 10: - height = 10 - win = curses.newwin(height, int(size[1] * 0.75), self.print_title(self.stdscr) + 2, int(size[1] * 0.25 / 2)) - win.border() - size = win.getmaxyx() - self.center(win, 0, size[1], self.curr_screen.config["title"], curses.A_BOLD) - self.curr_screen.refresh(win) - self.stdscr.leaveok(1) - self.stdscr.refresh() - win.refresh() - while quit != -1: - key = self.stdscr.getch() - if key == 10 and self.in_error == 1: - self.error_win.erase() - self.error_win.refresh() - self.error_string = "" - self.in_error = 0 - elif key == curses.KEY_DC: - if self.curr_screen.config["id"] == 0: - self.__del__() - else: - self.error("You press delete. Wanna quit ?", 1) - self.input.current_choice = 1 - elif self.in_error == 2: - ret = input.input(key, 1) - if ret == 1: - self.__del__() - elif ret == 2: - self.in_error = 0 - self.error_string = "" - elif self.curr_screen.config["type"] == "menu": - self.curr_screen.input(key) - elif self.curr_screen.config["type"] == "input": - c_input += input.input(key) - if c_input >= len(self.curr_screen.config["input"]): - c_input = -1 - elif c_input < 0: - self.change_screen(self.prev_id) - c_input = 0 - win.erase() - win.border() - size = win.getmaxyx() - self.center(win, 0, size[1], self.curr_screen.config["title"], curses.A_BOLD) - if self.curr_screen.config["type"] == "input" and c_input >= 0: - conf = self.curr_screen.config["input"][c_input] - input.s_input(win, conf["title"], conf["default"], conf["function"], conf["type"]) - quit = self.curr_screen.refresh(win) - if (quit != self.curr_screen.config["id"]): - win.erase() - win.border() - size = win.getmaxyx() - self.change_screen(quit) - self.center(win, 0, size[1], self.curr_screen.config["title"], curses.A_BOLD) - c_input = 0 - if self.curr_screen.config["type"] == "input": - conf = self.curr_screen.config["input"][c_input] - input.s_input(win, conf["title"], conf["default"], conf["function"], conf["type"]) - self.curr_screen.refresh(win) - self.stdscr.refresh() - win.refresh() - if (self.in_error): - self.error("", self.in_error - 1) - self.error_win.refresh() - self.__del__() diff --git a/screens/__init__.py b/screens/__init__.py diff --git a/screens/config/__init__.py b/screens/config/__init__.py diff --git a/screens/config/config.py b/screens/config/config.py @@ -1,138 +0,0 @@ -################################### LICENSE #################################### -# Copyright 2016 Louis Solofrizzo # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ - -## -# config.py -# Created: 21/10/2016 -# By: Louis Solofrizzo <louis@morphux.org> -## - -import curses - -class Config: - - key = 0 - quit = 1 - root_p = "" - main = 0 - - def init(self, main): - self.main = main - self.config = { - "id": 1, - "title": "Config", - "type": "input", - "input": [ - { - "name": "hostname", - "title": "SET YOUR HOSTNAME", - "default": "morphux", - "type": "text", - "function": self.hostname - }, - { - "name": "root1", - "title": "ROOT PASSWORD", - "default": "", - "type": "password", - "function": self.root_p1 - }, - { - "name": "root2", - "title": "CONFIRM ROOT PASSWORD", - "default": "", - "type": "password", - "function": self.root_p2 - }, - { - "name": "user", - "title": "SET YOUR USERNAME", - "default": "user", - "type": "text", - "function": self.username - }, - { - "name": "userp1", - "title": "USER PASSWORD", - "default": "", - "type": "password", - "function": self.user_p1 - }, - { - "name": "root2", - "title": "CONFIRM USER PASSWORD", - "default": "", - "type": "password", - "function": self.user_p2 - }, - - - ] - } - return self.config - - def input(self, key): - self.key = key - - def hostname(self, string): - if len(string) == 0: - self.main.error("Hostname cannot be empty."); - return 0 - self.main.config("system.hostname", string) - return 1 - - def root_p1(self, string): - if len(string) == 0: - self.main.error("Password cannot be empty."); - return 0 - self.root_p = string - return 1 - - def root_p2(self, string): - if string != self.root_p: - self.main.error("Passwords did not match !"); - return -1 - self.main.config("system.root_p", string) - return 1 - - def username(self, string): - if len(string) == 0: - self.main.error("Username cannot be empty."); - return 0 - self.main.config("system.username", string) - return 1 - - def user_p1(self, string): - if len(string) == 0: - self.main.error("Password cannot be empty."); - return 0 - self.root_p = string - return 1 - - def user_p2(self, string): - if string != self.root_p: - self.main.error("Passwords did not match !"); - return -1 - self.quit = 2 - self.main.config("system.user_p", string) - return 1 - - - def reset(self): - self.quit = 1 - - def refresh(self, win): - return self.quit diff --git a/screens/main/__init__.py b/screens/main/__init__.py diff --git a/screens/main/main.py b/screens/main/main.py @@ -1,105 +0,0 @@ -################################### LICENSE #################################### -# Copyright 2016 Louis Solofrizzo # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ - -## -# main.py -# Created: 21/10/2016 -# By: Louis Solofrizzo <louis@morphux.org> -## - -import curses -from subprocess import call -from subprocess import Popen, PIPE -import os - -class Main: - - key = 0 - menu_s = ["INSTALL", "CUSTOM INSTALL", "LAUNCH SHELL", "OPTIONS", "QUIT"] - menu_choice = 0 - quit = 0 - main = 0 - win = 0 - - def init(self, main): - self.main = main - self.config = { - "id": 0, - "title": "MENU", - "type": "menu" - } - return self.config - - def input(self, key): - self.key = key - if (key == curses.KEY_DOWN and self.menu_choice < len(self.menu_s) - 1): - self.menu_choice += 1 - elif (key == curses.KEY_UP and self.menu_choice > 0): - self.menu_choice -= 1 - elif (key == curses.KEY_ENTER or key == 10 or key == 13): - if (self.menu_s[self.menu_choice] == "QUIT"): - self.quit = -1 - elif (self.menu_s[self.menu_choice] == "LAUNCH SHELL"): - self.l_shell() - else: - self.quit = self.menu_choice + 1 - - def l_shell(self): - curses.nocbreak() - curses.echo() - curses.curs_set(1) - os.system('stty sane') - os.system('clear') - sh = Popen(['/bin/sh']) - sh.wait() - curses.noecho() - curses.cbreak() - curses.curs_set(0) - self.main.stdscr.clear() - self.main.print_title(self.main.stdscr) - self.refresh(self.win) - self.win.border() - self.main.stdscr.refresh() - self.win.refresh() - - def menu(self, y, win, lines): - size = win.getmaxyx() - i = 0 - for string in self.menu_s: - if i == self.menu_choice: - win.addstr(y, (size[1] / 2) - (len(string) / 2), string, curses.color_pair(1) | curses.A_BOLD) - else: - win.addstr(y, (size[1] / 2) - (len(string) / 2), string, curses.A_BOLD) - if (lines and string != "QUIT"): - win.addstr(y + 1, (size[1] / 2) - (20 / 2), "--------------------") - y += 2 - else: - y += 1 - i += 1 - - def reset(self): - self.menu_choice = 0 - self.quit = 0 - - def refresh(self, win): - size = win.getmaxyx() - if self.win == 0: - self.win = win - if (size[0] > 10): - self.menu((size[0] / 2) - (len(self.menu_s) / 2) - 2, win, 1); - else: - self.menu((size[0] / 2) - (len(self.menu_s) / 2) - 2, win, 0); - return self.quit diff --git a/screens/network/__init__.py b/screens/network/__init__.py diff --git a/screens/network/network.py b/screens/network/network.py @@ -1,105 +0,0 @@ -################################### LICENSE #################################### -# Copyright 2016 Louis Solofrizzo # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ - -## -# network.py -# Created: 25/10/2016 -# By: Louis Solofrizzo <louis@morphux.org> -## - -import curses -import os.path -import stat - -class Network: - - key = 0 - quit = 3 - main = 0 - - def init(self, main): - self.main = main - self.config = { - "id": 3, - "title": "Network", - "type": "input", - "input": [ - { - "name": "ip", - "title": "ENTER YOUR LOCAL IP", - "default": "192.168.0.1", - "type": "text", - "function": self.ip - }, - { - "name": "netmask", - "title": "NETMASK", - "default": "255.255.255.255", - "type": "text", - "function": self.netmask - }, - { - "name": "gateway", - "title": "ENTER YOUR GATEWAY", - "default": "", - "type": "text", - "function": self.gateway - }, - { - "name": "dns", - "title": "ENTER YOUR DNS", - "default": "8.8.8.8,4.4.4.4", - "type": "text", - "function": self.dns - }, - ] - } - return self.config - - def ip(self, string): - if len(string): - self.main.config("network.ip", string) - return 1 - self.main.error("IP cannot be blank") - return 0 - - def netmask(self, string): - if len(string): - self.main.config("network.netmask", string) - return 1 - self.main.error("Netmask cannot be blank") - return 0 - - def gateway(self, string): - if len(string): - self.main.config("network.gateway", string) - return 1 - self.main.error("Gateway cannot be blank") - return 0 - - - def dns(self, string): - if len(string): - self.main.config("network.dns", string) - return 1 - self.main.error("DNS cannot be blank") - return 0 - - def reset(self): - self.quit = 3 - - def refresh(self, win): - return self.quit diff --git a/screens/partitions/__init__.py b/screens/partitions/__init__.py diff --git a/screens/partitions/partitions.py b/screens/partitions/partitions.py @@ -1,144 +0,0 @@ -################################### LICENSE #################################### -# Copyright 2016 Louis Solofrizzo # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ - -## -# partitions.py -# Created: 25/10/2016 -# By: Louis Solofrizzo <louis@morphux.org> -## - -import curses -import os.path -import stat - -class Partitions: - - key = 0 - quit = 2 - main = 0 - - def init(self, main): - self.main = main - self.config = { - "id": 2, - "title": "Partitions", - "type": "input", - "input": [ - { - "name": "disk", - "title": "ENTER DISK NAME", - "default": "/dev/sda", - "type": "text", - "function": self.disk - }, - { - "name": "grub", - "title": "ENTER GRUB PARTITION", - "default": "1", - "type": "text", - "function": self.grub - }, - { - "name": "root", - "title": "ENTER ROOT PARTITION", - "default": "2", - "type": "text", - "function": self.root - }, - { - "name": "swap", - "title": "ENTER SWAP PARTITION", - "default": "3", - "type": "text", - "function": self.swap - }, - { - "name": "boot", - "title": "ENTER BOOT PARTITION", - "default": "4", - "type": "text", - "function": self.boot - }, - { - "name": "home", - "title": "ENTER HOME PARTITION", - "default": "5", - "type": "text", - "function": self.home - }, - ] - } - return self.config - - def exist(self, string): - try: - return stat.S_ISBLK(os.stat(string).st_mode) - except: - return False - - def disk(self, string): - if self.exist(string): - self.main.config("partitions.disk", string) - self.config["input"][1]["default"] = string + self.config["input"][1]["default"] - self.config["input"][2]["default"] = string + self.config["input"][2]["default"] - self.config["input"][3]["default"] = string + self.config["input"][3]["default"] - self.config["input"][4]["default"] = string + self.config["input"][4]["default"] - self.config["input"][5]["default"] = string + self.config["input"][5]["default"] - return 1 - self.main.error("Disk " + string + " cannot be found") - return 0 - - def grub(self, string): - if self.exist(string): - self.main.config("partitions.grub", string) - return 1 - self.main.error("Partition " + string + " cannot be found") - return 0 - - def root(self, string): - if self.exist(string): - self.main.config("partitions.root", string) - return 1 - self.main.error("Partition " + string + " cannot be found") - return 0 - - def swap(self, string): - if self.exist(string): - self.main.config("partitions.swap", string) - return 1 - self.main.error("Partition " + string + " cannot be found") - return 0 - - def boot(self, string): - if self.exist(string): - self.main.config("partitions.boot", string) - return 1 - self.main.error("Partition " + string + " cannot be found") - return 0 - - def home(self, string): - if self.exist(string): - self.quit = 3 - self.main.config("partitions.home", string) - return 1 - self.main.error("Partition " + string + " cannot be found") - return 0 - - def reset(self): - self.quit = 2 - - def refresh(self, win): - return self.quit