* src/Filters/Rules/Repository/_HasRepo.py: Correct logic.

svn: r7737
This commit is contained in:
Alex Roitman 2006-11-30 20:30:28 +00:00
parent e96bbdb75e
commit e386161912
2 changed files with 21 additions and 15 deletions

View File

@ -1,4 +1,5 @@
2006-11-30 Alex Roitman <shura@gramps-project.org>
* src/Filters/Rules/Repository/_HasRepo.py: Correct logic.
* src/Filters/Rules/Makefile.am: Ship new file.
* src/Filters/Rules/Family/Makefile.am: Ship new file.
* src/Filters/Rules/Person/Makefile.am: Ship new file.

View File

@ -63,21 +63,26 @@ class HasRepo(Rule):
if repo.type != specified_type:
return False
addr_match = False
for addr in repo.address_list:
addr_text = addr.city + addr.state + addr.country + addr.postal \
+ addr.phone + addr.street
if self.list[2]:
addr_match = False
for addr in repo.address_list:
addr_text = addr.city + addr.state + addr.country \
+ addr.postal + addr.phone + addr.street
if not self.match_substring(2,addr_text):
continue
if self.match_substring(2,addr_text):
addr_match = True
break
if not addr_match:
return False
addr_match = True
if self.list[3]:
url_match = False
for url in repo.urls:
url_text = url.path + url.desc
if self.match_substring(3,url_text):
url_match = True
break
if not url_match:
return False
url_match = False
for url in repo.urls:
url_text = url.path + url.desc
if not self.match_substring(3,url_text):
continue
url_match = True
return (addr_match or url_match)
return True