l.s.f.r.FeatureRuleSource(object) : class documentation

Part of lp.services.features.rulesource View In Hierarchy

Known subclasses: lp.services.features.rulesource.MemoryFeatureRuleSource, lp.services.features.rulesource.NullFeatureRuleSource, lp.services.features.rulesource.StormFeatureRuleSource

Access feature rule sources from the database or elsewhere.
Method getAllRulesAsDict Return all rule definitions.
Method getAllRulesAsTuples Generate list of (flag, scope, priority, value)
Method getAllRulesAsText Return a text for of the rules.
Method setAllRulesFromText Update all rules from text input.
Method parseRules Return a list of tuples for the parsed form of the text input.
def getAllRulesAsDict(self):
Return all rule definitions.
Returnsdict from flag name to a list of (scope, priority, value) in descending order by priority.
def getAllRulesAsTuples(self):
Generate list of (flag, scope, priority, value)
def getAllRulesAsText(self):
Return a text for of the rules.

This has one line per rule, with tab-separate (flag, scope, prioirity, value), as used in the flag editor web interface.

def setAllRulesFromText(self, text_form):
Update all rules from text input.

The input is similar in form to that generated by getAllRulesAsText: one line per rule, with whitespace-separated (flag, scope, priority, value). Whitespace is allowed in the flag value.

def parseRules(self, text_form):
Return a list of tuples for the parsed form of the text input.

For each non-blank line gives back a tuple of (flag, scope, priority, value).

Returns a list rather than a generator so that you see any syntax errors immediately.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.