~mterry/ubiquity/oem-config-merge

« back to all changes in this revision

Viewing changes to ubiquity/frontend/base.py

  • Committer: Michael Terry
  • Date: 2009-07-08 19:02:04 UTC
  • Revision ID: michael.terry@canonical.com-20090708190204-enzyfh27wxjpatrh
misc fixes; move netcfg and tasksel components to main package; don't allow unknown steps

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
from ubiquity import i18n
34
34
 
35
35
# Pages that may be loaded. Interpretation is up to the frontend, but it is
36
 
# strongly recommended to keep the page identifiers the same. Order is
37
 
# important, and 'step' will be prepended to all identifiers.
38
 
VALID_PAGES = {
 
36
# strongly recommended to keep the page identifiers the same.
 
37
PAGE_COMPONENTS = {
39
38
    'LanguageOnly' : language.Language,
40
39
    'Language' : language.Language,
41
40
    'Location' : timezone.Timezone,
136
135
            step_list_name = 'ubiquity/oem-config-steps'
137
136
        else:
138
137
            step_list_name = 'ubiquity/steps'
 
138
        valid_steps = db.metaget(step_list_name, 'choices-c')
139
139
        step_list = db.get(step_list_name)
140
140
        steps = step_list.replace(',', ' ').split()
141
141
        self.pagenames = []
142
142
        self.pages = []
143
 
        for valid_page in VALID_PAGES:
 
143
        for valid_page in valid_steps:
144
144
            if valid_page in steps:
145
145
                if valid_page == 'MigrationAssistant' and \
146
146
                   'UBIQUITY_MIGRATION_ASSISTANT' not in os.environ:
151
151
                   step_name in self.pages_override_remove:
152
152
                    continue
153
153
                self.pagenames.append(step_name)
154
 
                page_class = VALID_PAGES[valid_page]
 
154
                page_class = PAGE_COMPONENTS[valid_page]
155
155
                if page_class is not None and page_class not in self.pages:
156
156
                    self.pages.append(page_class)
157
157
        for step in steps:
158
 
            if step not in VALID_PAGES:
 
158
            if step not in valid_steps:
159
159
                syslog.syslog(syslog.LOG_WARNING,
160
160
                              "Unknown step name in %s: %s" %
161
161
                              (step_list_name, step))