Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 198250 Details for
Bug 277619
News item 2009-07-12-xorg-74-alpha shows up on other archs
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
somehow I think the patch will be more useful than my marked up news.py ;)
patch (text/plain), 2.44 KB, created by
Alec Warner
on 2009-07-17 05:17:03 UTC
(
hide
)
Description:
somehow I think the patch will be more useful than my marked up news.py ;)
Filename:
MIME Type:
Creator:
Alec Warner
Created:
2009-07-17 05:17:03 UTC
Size:
2.44 KB
patch
obsolete
>Index: news.py >=================================================================== >--- news.py (revision 13832) >+++ news.py (working copy) >@@ -180,7 +180,6 @@ > "display if arch: x86" and so forth. > > Creation of a news item involves passing in the path to the particular news item. >- > """ > > def __init__(self, path, name): >@@ -199,24 +198,32 @@ > and a vardb so we can look at installed packages). > Each restriction will pluck out the items that are required for it to match > or raise a ValueError exception if the required object is not present. >- """ > >+ Restrictions of the form Display-X are OR'd with like-restrictions; otherwise >+ restrictions are AND'd. any_match is the ORing and all_match is the ANDing. >+ """ >+ > if not self._parsed: > self.parse() > > if not len(self.restrictions): >- return True # no restrictions to match means everyone should see it >+ return True > > kwargs = \ > { 'vardb' : vardb, > 'config' : config, > 'profile' : profile } > >- for restriction in self.restrictions: >- if restriction.checkRestriction(**kwargs): >- return True >+ all_match = True >+ for restriction_type, values in self.restrictions.iteritems(): >+ any_match = False >+ for restriction in values: >+ if restriction.checkRestriction(**kwargs): >+ any_match = True >+ if not any_match: >+ all_match = False > >- return False # No restrictions were met; thus we aren't relevant :( >+ return all_match > > def isValid(self): > if not self._parsed: >@@ -225,11 +232,11 @@ > > def parse(self): > lines = open(self.path).readlines() >- self.restrictions = [] >+ self.restrictions = {} > invalids = [] > for i, line in enumerate(lines): >- #Optimization to ignore regex matchines on lines that >- #will never match >+ # Optimization to ignore regex matchines on lines that >+ # will never match > if not line.startswith('D'): > continue > restricts = { _installedRE : DisplayInstalledRestriction, >@@ -238,9 +245,10 @@ > for regex, restriction in restricts.iteritems(): > match = regex.match(line) > if match: >- self.restrictions.append(restriction(match.groups()[0].strip())) >- if not self.restrictions[-1].isValid(): >+ restrict = restriction(match.groups()[0].strip()) >+ if not restrict.isValid(): > invalids.append((i + 1, line.rstrip("\n"))) >+ self.restrictions.setdefault(restriction.__class__, []).append(restrict) > continue > if invalids: > self._valid = False
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 277619
:
198248
|
198250
|
198251