~mnordhoff/loggerhead/valid-html

« back to all changes in this revision

Viewing changes to loggerhead/apps/config.py

  • Committer: Matt Nordhoff
  • Date: 2008-10-25 21:09:19 UTC
  • mfrom: (229.2.4 trunk)
  • Revision ID: mnordhoff@mattnordhoff.com-20081025210919-cbnlvd2ow5qpnxvh
Merge trunk.

This undoes the whitespace adjustment I made in macros.pt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
from loggerhead.history import is_branch
28
28
 
 
29
 
29
30
class Project(object):
30
31
    """A project contains the branches.
31
32
 
73
74
        log.debug('Rescanning auto-folder for project %s ...', self.name)
74
75
        for folder in auto_list:
75
76
            view_name = os.path.basename(folder)
76
 
            log.debug('Auto-configuring (project %s) branch %s...', self.name, view_name)
 
77
            log.debug('Auto-configuring (project %s) branch %s...',
 
78
                      self.name,
 
79
                      view_name)
77
80
            self._add_view(view_name, ConfigObj(), folder)
78
81
        self._auto_list = auto_list
79
82
 
90
93
        description = view_config.get('description', None)
91
94
        if description is not None:
92
95
            return description
93
 
        description = history._branch.get_config().get_user_option('description')
 
96
        description = history._branch.get_config().get_user_option(
 
97
                          'description')
94
98
        return description
95
99
 
96
100
    def _add_view(self, view_name, view_config, folder):
107
111
            self.view_data_by_name[view_name] = {
108
112
                'branch_path': folder,
109
113
                'args': (view_name, view_config, self.graph_cache),
110
 
                'description': self._get_description(view, view_config, history),
 
114
                'description': self._get_description(view,
 
115
                                                     view_config,
 
116
                                                     history),
111
117
                '_src_folder': folder,
112
118
                '_view_config': view_config,
113
119
                'friendly_name': friendly_name,
158
164
        self.projects_by_name = {}
159
165
        graph_cache = bzrlib.lru_cache.LRUCache()
160
166
        for project_name in self.config.sections:
161
 
            project = Project(
162
 
                project_name, self.config[project_name], self.config, graph_cache)
 
167
            project = Project(project_name, self.config[project_name],
 
168
                              self.config, graph_cache)
163
169
            self.projects.append(project)
164
170
            self.projects_by_name[project_name] = project
165
171
 
169
175
        # branches again.
170
176
        for p in self.projects:
171
177
            p._recheck_auto_folders()
 
178
 
172
179
        class branch(object):
 
180
 
173
181
            @staticmethod
174
182
            def static_url(path):
175
183
                return self._static_url_base + path