Patch by Charles Lepple to fix two of the assertions in our Python bindings.
authorPeter Hosey
Wed Mar 25 04:11:45 2009 -0700 (2009-03-25)
changeset 418269b5347d8262
parent 4181 b208862a586d
child 4183 2e72fc363066
Patch by Charles Lepple to fix two of the assertions in our Python bindings.

In Python, assert is a statement, not a function. With the parentheses, Python takes the parentheses and everything between them as a tuple, and uses this as the condition; since it contains two items, it is not empty, which means it is true, which means the assertion would always pass.

The fix is to remove the parentheses. Then, the assertion statement has its usual two arguments (formerly the items in the tuple).
Bindings/python/Growl.py
     1.1 --- a/Bindings/python/Growl.py	Fri Mar 13 05:40:09 2009 -0700
     1.2 +++ b/Bindings/python/Growl.py	Wed Mar 25 04:11:45 2009 -0700
     1.3 @@ -173,11 +173,11 @@
     1.4  	def __init__(self, applicationName=None, notifications=None, defaultNotifications=None, applicationIcon=None, hostname=None, password=None):
     1.5  		if applicationName:
     1.6  			self.applicationName = applicationName
     1.7 -		assert(self.applicationName, 'An application name is required.')
     1.8 +		assert self.applicationName, 'An application name is required.'
     1.9  
    1.10  		if notifications:
    1.11  			self.notifications = list(notifications)
    1.12 -		assert(self.notifications, 'A sequence of one or more notification names is required.')
    1.13 +		assert self.notifications, 'A sequence of one or more notification names is required.'
    1.14  
    1.15  		if defaultNotifications is not None:
    1.16  			self.defaultNotifications = list(defaultNotifications)