~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/features/rulesource.py

[r=danilo][bug=878260] macro
        bugtarget-macros-search/simple-search-form: Show a title;
        drop the 'order by' widget; CSS changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
    def parseRules(self, text_form):
88
88
        """Return a list of tuples for the parsed form of the text input.
89
89
 
90
 
        For each non-blank line gives back a tuple of
91
 
        (flag, scope, priority, value).
 
90
        For each non-blank line gives back a tuple of (flag, scope, priority, value).
92
91
 
93
92
        Returns a list rather than a generator so that you see any syntax
94
93
        errors immediately.
140
139
 
141
140
        :param new_rules: List of (name, scope, priority, value) tuples.
142
141
        """
143
 
        # XXX: would be slightly better to only update rules as necessary so
144
 
        # we keep timestamps, and to avoid the direct sql etc -- mbp 20100924
 
142
        # XXX: would be slightly better to only update rules as necessary so we keep
 
143
        # timestamps, and to avoid the direct sql etc -- mbp 20100924
145
144
        store = getFeatureStore()
146
145
        store.execute('DELETE FROM FeatureFlag')
147
146
        for (flag, scope, priority, value) in new_rules:
150
149
                flag=unicode(flag),
151
150
                value=value,
152
151
                priority=priority))
153
 
        store.flush()
154
152
 
155
153
 
156
154
class NullFeatureRuleSource(FeatureRuleSource):