* src/Filters/Rules/Repository/_HasRepo.py: Correct logic.
svn: r7737
This commit is contained in:
parent
e96bbdb75e
commit
e386161912
@ -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.
|
||||
|
@ -63,21 +63,26 @@ class HasRepo(Rule):
|
||||
if repo.type != specified_type:
|
||||
return False
|
||||
|
||||
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
|
||||
addr_text = addr.city + addr.state + addr.country \
|
||||
+ addr.postal + addr.phone + addr.street
|
||||
|
||||
if self.match_substring(2,addr_text):
|
||||
addr_match = True
|
||||
break
|
||||
if not addr_match:
|
||||
return False
|
||||
|
||||
if self.list[3]:
|
||||
url_match = False
|
||||
for url in repo.urls:
|
||||
url_text = url.path + url.desc
|
||||
if not self.match_substring(3,url_text):
|
||||
continue
|
||||
if self.match_substring(3,url_text):
|
||||
url_match = True
|
||||
break
|
||||
if not url_match:
|
||||
return False
|
||||
|
||||
return (addr_match or url_match)
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user