Quantcast

problem in GrampsDbBase

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

problem in GrampsDbBase

Richard Taylor-2
I am just implementing the database tables for the Repository object and my
unittests found an interesting issue.

The 'has_XXX_handle' methods in GrampsDbBase are defined as follows e.g.:

 def has_repository_handle(self,handle):
        """
        returns True if the handle exists in the current Repository database.
        """
        return self.repository_map.has_key(str(handle)) != None

The problem is that 'has_key' on a mapping type is defined to return False
when there is no match, _not_ None.

So I think these methods will always return True.

Am I missing something?

Richard

--
You can normally find me on Jabber as [hidden email]


-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
online with coworkers and clients while avoiding the high cost of travel and
communications. There is no equipment to buy and you can meet as often as
you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Loading...