# Path: firstboot_lib/firstbootconfig.py
# class project_path_not_found(Exception):
# def get_bin_path():
# def get_data_file(*path_segments):
# def get_prefix():
# def get_data_path():
# def get_version():
# 
# Path: firstboot_lib/FirstbootEntry.py
# class FirstbootEntry(IniFile):
# 
#     default_group = 'Firstboot Entry'
# 
#     def __init__(self):
# 
#         self.content = dict()
# 
#         self.config_path = '/var/lib/firstboot'
#         self.config_file = os.path.join(self.config_path, 'firstboot.conf')
# 
#         if not os.path.exists(self.config_path):
#             os.makedirs(self.config_path)
# 
#         if not os.path.exists(self.config_file):
#             self._create_config_file()
# 
#         IniFile.parse(self, self.config_file, [self.default_group])
# 
#     def _create_config_file(self):
# 
#         fd = open(self.config_file, 'w')
#         if fd != None:
#             fd.write('[Firstboot Entry]\n')
#             fd.write('firststart=0\n')
#             fd.write('\n')
#             fd.write('[LinkToServer]\n')
#             fd.write('url=https://GECOS-SERVER/autoconfig\n')
#             fd.write('\n')
#             fd.close()
# 
#     def get_firststart(self):
#         fs = self.get('firststart').strip()
#         fs = bool(int(fs))
#         return fs
# 
#     def set_firststart(self, value):
#         self.set('firststart', value)
#         self.write()
# 
#     def get_url(self):
#         return self.get('url', group='LinkToServer')
# 
#     def set_url(self, value):
#         self.set('url', value, group='LinkToServer')
#         self.write()


import gettext
import math
import shlex
import subprocess
import os
import logging
import pages
import dbus
from gettext import gettext as _
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Pango
from gi.repository import Gio
from gi.repository import GdkPixbuf
from gi.repository import GObject
from firstboot_lib import Window, firstbootconfig, FirstbootEntry
from dbus.mainloop.glib import DBusGMainLoop
        self.buttons = {}

        children = self.ui.boxIndex.get_children()
        for child in children:
            self.ui.boxIndex.remove(child)

        for page_name in pages.pages:
            try:
                module = __import__('firstboot.pages.%s' % page_name, fromlist=['firstboot.pages'])
                button = self.new_index_button(module.__TITLE__, page_name)
                self.pages[page_name] = {
                    'id': page_name,
                    'button': button,
                    'module': module,
                    'enabled': True,
                    'instance': None,
                    'configured': not module.__REQUIRED__
                }
                self.buttons[page_name] = button

            except ImportError, e:
                print e

    def new_index_button(self, page_title, page_name):

        button = Gtk.Button()
        button.set_relief(Gtk.ReliefStyle.NONE)
        button.set_property('focus-on-click', False)
        button.set_property('xalign', 0)


# Path: firstboot_lib/firstbootconfig.py
# class project_path_not_found(Exception):
# def get_bin_path():
# def get_data_file(*path_segments):
# def get_prefix():
# def get_data_path():
# def get_version():
# 
# Path: firstboot_lib/FirstbootEntry.py
# class FirstbootEntry(IniFile):
# 
#     default_group = 'Firstboot Entry'
# 
#     def __init__(self):
# 
#         self.content = dict()
# 
#         self.config_path = '/var/lib/firstboot'
#         self.config_file = os.path.join(self.config_path, 'firstboot.conf')
# 
#         if not os.path.exists(self.config_path):
#             os.makedirs(self.config_path)
# 
#         if not os.path.exists(self.config_file):
#             self._create_config_file()
# 
#         IniFile.parse(self, self.config_file, [self.default_group])
# 
#     def _create_config_file(self):
# 
#         fd = open(self.config_file, 'w')
#         if fd != None:
#             fd.write('[Firstboot Entry]\n')
#             fd.write('firststart=0\n')
#             fd.write('\n')
#             fd.write('[LinkToServer]\n')
#             fd.write('url=https://GECOS-SERVER/autoconfig\n')
#             fd.write('\n')
#             fd.close()
# 
#     def get_firststart(self):
#         fs = self.get('firststart').strip()
#         fs = bool(int(fs))
#         return fs
# 
#     def set_firststart(self, value):
#         self.set('firststart', value)
#         self.write()
# 
#     def get_url(self):
#         return self.get('url', group='LinkToServer')
# 
#     def set_url(self, value):
#         self.set('url', value, group='LinkToServer')
#         self.write()


# Path: firstboot/FirstbootWindow.py
import gettext
import math
import shlex
import subprocess
import os
import logging
import pages
import dbus
from gettext import gettext as _
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Pango
from gi.repository import Gio
from gi.repository import GdkPixbuf
from gi.repository import GObject
from firstboot_lib import Window, firstbootconfig, FirstbootEntry
from dbus.mainloop.glib import DBusGMainLoop

        self.buttons = {}

        children = self.ui.boxIndex.get_children()
        for child in children:
            self.ui.boxIndex.remove(child)

        for page_name in pages.pages:
            try:
                module = __import__('firstboot.pages.%s' % page_name, fromlist=['firstboot.pages'])
                button = self.new_index_button(module.__TITLE__, page_name)
                self.pages[page_name] = {
                    'id': page_name,
                    'button': button,
                    'module': module,
                    'enabled': True,
                    'instance': None,
                    'configured': not module.__REQUIRED__
                }
                self.buttons[page_name] = button

            except ImportError, e:
                print e

    def new_index_button(self, page_title, page_name):

        button = Gtk.Button()
        button.set_relief(Gtk.ReliefStyle.NONE)
        button.set_property('focus-on-click', False)
        button.set_property('xalign', 0)


        image_file = firstbootconfig.get_data_file('media', '%s' % ('arrow_right_32.png',))