[Frugalware-darcs] fwlive-installer: fwlive-installer: big commit :)
AlexExtreme
alex at alex-smith.me.uk
Sat Dec 9 22:06:48 CET 2006
Darcsweb-Url: http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=fwlive-installer;a=darcs_commitdiff;h=20061209210647-46e39-2ff648c7bc0ab45aca5c68af8024621e5165c041.gz;
[fwlive-installer: big commit :)
AlexExtreme <alex at alex-smith.me.uk>**20061209210647
* Split off code for creating the gtk.ListStore's for the keyboard and language list into installlang.py
* New partition.py module for building a list of partitions in the system, split code to start GParted to it
* Added Makefiles for building the getparts util
] {
addfile ./Makefile
hunk ./Makefile 1
+all:
+ make -C src
+
+clean:
+ make -C src clean
addfile ./src/Makefile
hunk ./src/Makefile 1
+all:
+ make -C utils
+
+clean:
+ make -C utils clean
hunk ./src/gui.py 32
-import gtk, gtk.glade, sys, os, re
+import gtk, gtk.glade, sys, os
+from partition import InstallerPartitioner
+from installlang import InstallerLang
hunk ./src/gui.py 37
- def startGParted(self, foo):
- os.spawnl(os.P_NOWAIT, "/usr/bin/gparted")
-
hunk ./src/gui.py 56
- self.langmodel = gtk.ListStore(str)
- self.langmodel.append(['English'])
- self.langmodel.append(['Spanish / Espagnole'])
- self.langmodel.append(['German / Deutsch'])
- self.langmodel.append(['French / Francais'])
- self.langmodel.append(['Indonesia / Indonesian'])
- self.langmodel.append(['Italian / Italiano'])
- self.langmodel.append(['Hungarian / Magyar'])
- self.langmodel.append(['Dutch / Nederlands'])
- self.langmodel.append(['Polish / Polski'])
- self.langmodel.append(['Portuguese / Português'])
- self.langmodel.append(['Portuguese (Brazillian) / Português (Brazillian)'])
- self.langmodel.append(['Slovak / Slovensky'])
- self.langmodel.append(['Chinese'])
+ self.langmodel = self.lang.buildLangModel()
hunk ./src/gui.py 64
- self.kbdmodel = gtk.ListStore(str)
- keyboardList = []
-
- for root, dirs, files in os.walk("/usr/share/kbd/keymaps/i386"):
- files.sort(cmp)
- for name in files:
- search = re.search("\.gz", name)
- if search != None:
- keyboardList.append(name)
-
- keyboardList.sort(cmp)
- for file in keyboardList:
- self.kbdmodel.append([file])
-
+ self.kbdmodel = self.lang.buildKbdModel()
hunk ./src/gui.py 90
- sys.exit(0)
+ sys.exit(1)
+
+ self.partitioner = InstallerPartitioner()
+ self.lang = InstallerLang()
hunk ./src/gui.py 111
- self.gpartbutton.connect("clicked", self.startGParted)
+ self.gpartbutton.connect("clicked", self.partitioner.startGParted)
hunk ./src/installer.py 32
-import gtk, gtk.glade, sys, os
+import gtk, sys, os
addfile ./src/installlang.py
hunk ./src/installlang.py 1
-
+# -*- coding: utf-8 -*-
+
+"""
+FwLive Installer
+Copyright (C) 2006 Alex Smith.
+This program is licenced under the terms of the GNU GPL.
+"""
+
+__author__ = "Alex Smith"
+__email__ = "alex at alex-smith.me.uk"
+__license__ = """
+FwLive Installer
+Copyright (C) 2006 Alex Smith <alex at alex-smith.me.uk>
+
+This file is part of FwLive Installer.
+
+FwLive Installer 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.
+
+FwLive Installer 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 FwLive Installer; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+"""
+
+import gtk, os, sys, re
+
+class InstallerLang:
+ def buildLangModel(self):
+ langmodel = gtk.ListStore(str)
+ langmodel.append(['English'])
+ langmodel.append(['Spanish / Espagnole'])
+ langmodel.append(['German / Deutsch'])
+ langmodel.append(['French / Francais'])
+ langmodel.append(['Indonesia / Indonesian'])
+ langmodel.append(['Italian / Italiano'])
+ langmodel.append(['Hungarian / Magyar'])
+ langmodel.append(['Dutch / Nederlands'])
+ langmodel.append(['Polish / Polski'])
+ langmodel.append(['Portuguese / Português'])
+ langmodel.append(['Portuguese (Brazillian) / Português (Brazillian)'])
+ langmodel.append(['Slovak / Slovensky'])
+ langmodel.append(['Chinese'])
+ return langmodel
+
+ def buildKbdModel(self):
+ kbdmodel = gtk.ListStore(str)
+ keyboardList = []
+
+ for root, dirs, files in os.walk("/usr/share/kbd/keymaps/i386"):
+ files.sort(cmp)
+ for name in files:
+ search = re.search("\.gz", name)
+ if search != None:
+ keyboardList.append(name)
+
+ keyboardList.sort(cmp)
+ for file in keyboardList:
+ kbdmodel.append([file])
+
+ return kbdmodel
addfile ./src/partition.py
hunk ./src/partition.py 1
-
+# -*- coding: utf-8 -*-
+
+"""
+FwLive Installer
+Copyright (C) 2006 Alex Smith.
+This program is licenced under the terms of the GNU GPL.
+"""
+
+__author__ = "Alex Smith"
+__email__ = "alex at alex-smith.me.uk"
+__license__ = """
+FwLive Installer
+Copyright (C) 2006 Alex Smith <alex at alex-smith.me.uk>
+
+This file is part of FwLive Installer.
+
+FwLive Installer 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.
+
+FwLive Installer 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 FwLive Installer; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+"""
+
+import os, sys
+
+class InstallerPartitioner:
+ def startGParted(self, foo):
+ os.spawnl(os.P_NOWAIT, "/usr/bin/gparted")
+
+ def getPartList(self):
+ statreply = None
+
+ try:
+ statreply = os.stat('utils/getparts')
+ getparts = 'utils/getparts'
+ except OSError:
+ pass
+
+ if statreply == None:
+ try:
+ statreply = os.stat('src/utils/getparts')
+ getparts = 'src/utils/getparts'
+ except OSError:
+ pass
+
+ if statreply == None:
+ try:
+ statreply = os.stat('/usr/lib/fwlive-installer/utils/getparts')
+ getparts = '/usr/lib/fwlive-installer/utils/getparts'
+ except OSError:
+ print "Could not find getparts utility!!"
+ sys.exit(1)
+
+ tmp = os.popen(getparts)
+ parts = tmp.read().splitlines()
+
+ return parts
hunk ./src/utils/Makefile 4
+clean:
+ rm -f *.o getparts
+
}
More information about the Frugalware-darcs
mailing list