diff --git a/mitterlib/network/__init__.py b/mitterlib/network/__init__.py index 1361395..6e6766a 100644 --- a/mitterlib/network/__init__.py +++ b/mitterlib/network/__init__.py @@ -263,11 +263,11 @@ class Networks(object): self._save() return - def favourite(self, message): - """Change the favourite status of the message.""" + def favouite(self, message): + """Change the favorite status of the message.""" assert(isinstance(message, NetworkData)) self._proxy() - self.networks[message.network].favourite(message) + self.networks[message.network].favorite(message) self._operations += 1 self._save() return @@ -319,4 +319,4 @@ class Networks(object): for shortcut in self._targets(network): requests = self.networks[shortcut].available_requests() result[shortcut] = requests - return result \ No newline at end of file + return result diff --git a/mitterlib/network/networkbase.py b/mitterlib/network/networkbase.py index b772c0c..e314303 100644 --- a/mitterlib/network/networkbase.py +++ b/mitterlib/network/networkbase.py @@ -139,8 +139,8 @@ class NetworkData(object): """Message timestamp (as a datetime object). Defaults to None. *Optional*""" - self.favourite = False - """Boolean indicating if the message was marked as "favourite" or not. + self.favorite = False + """Boolean indicating if the message was marked as "favorite" or not. *Optional*""" self.parent = None @@ -268,8 +268,8 @@ class NetworkBase(object): # anyway? return None - def favourite(self, message): - """Toggle the favourite status of a message. *message* must be a valid + def favorite(self, message): + """Toggle the favorite status of a message. *message* must be a valid :class:`NetworkData` object. Returns True if the request was successful or False otherwise.""" # TODO: Again, if errors appear as exceptions, why return something? @@ -301,4 +301,4 @@ class NetworkBase(object): """Return the number of requests the user can request before being capped. If such limitation doesn't exist for the network, a negative number should be returned.""" - return -1 \ No newline at end of file + return -1 diff --git a/mitterlib/network/twitter.py b/mitterlib/network/twitter.py index 2e7e7a3..d8f031f 100644 --- a/mitterlib/network/twitter.py +++ b/mitterlib/network/twitter.py @@ -144,7 +144,7 @@ class TwitterNetworkData(NetworkData): self.protected = data['user']['protected'] if 'favorited' in data: - self.favourited = data['favorited'] + self.favorited = data['favorited'] if 'in_reply_to_status_id' in data and data['in_reply_to_status_id']: owner = NetworkUser() @@ -495,11 +495,11 @@ class Connection(NetworkBase): data = self._request(resource, body=body) return TwitterNetworkData(data, self.user.username) - def favourite(self, message): - """Mark a message as favourite.""" + def favorite(self, message): + """Mark a message as favorite.""" assert(isinstance(message, NetworkData)) body = urllib.urlencode({'id': message.id}) - if not message.favourite: + if not message.favorite: resource = '/favorites/create/%d.json' % (message.id) else: resource = '/favorites/destroy/%d.json' % (message.id)