Leave a comment

Firstboot – Time Zone Module Release 0.1

For my class project I am working on Firstboot – Time Zone Module. The requirements for this assignment is learning to script in python and packaging. At the moment I am in the script part of my project. I’m not very verse in python and is completely new to the language.

I had some difficulties getting my timezone module to run during firstboot. For some reason it wouldn’t run and I would get a Class Module error. Took me a week to try and figure out that error. I end up deciding to redo what I wrote and for some odd reason it worked. Who knew….. That would of saved me a lot of time. I’m sure it was some typo or some small error I accidentally made. Anyway I finally got the the timezone module to work and was able to get the graphical look to my module. However, when I select a timezone it doesn’t store the selected data and implement it. I’ve been trying a number or different things but it doesn’t seem to make any improvement on what I already have.

I’ve sent an email to Martin Gracik in regards to the problem I’m having with my timezone.py script. We are currently sending responses back and forth. He mention that he has a module with the timezone setting that I could use. I am currently waiting for a response and to see where that will take me.

This is my timezone.py script:

import gtk
import os, string, sys, time

from firstboot.config import *
from firstboot.constants import *
from firstboot.functions import *
from firstboot.module import *

import gettext
_ = lambda x: gettext.ldgettext(“firstboot”, x)
N_ = lambda x: x

sys.path.append(“/usr/share/zoneinfo”)
from scdMainWindow import scdMainWindow

class moduleClass(Module):
def __init__(self):
Module.__init__(self)
self.priority = 89
self.sidebarTitle = N_(“Time Zone”)
self.title = N_(“Time Zone”)
self.icon = “system-config-date.png”

self.scd = None

def apply(self, interface, testing=False):
if testing:
return RESULT_SUCCESS

try:
rc = self.scd.firstboot_apply()
if rc == 0 and self.scd.closeParent:
return RESULT_SUCCESS
else:
return RESULT_FAILURE
except:
return RESULT_FAILURE

def createScreen(self):
self.vbox = gtk.VBox(spacing=5)
self.scd = scdMainWindow(firstboot=True, showPages=[“timezone”])
self.vbox.pack_start(self.scd.firstboot_widget(), False, False)

def initializeUI(self):
pass

Leave a comment