diff --git a/.gitignore b/.gitignore index 1670801..fed1142 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ -*.pyc \ No newline at end of file +*.pyc +build/ +*.egg-info/ diff --git a/channelfinder/ChannelFinderClient.py b/channelfinder/ChannelFinderClient.py index 5143e21..126e92b 100644 --- a/channelfinder/ChannelFinderClient.py +++ b/channelfinder/ChannelFinderClient.py @@ -529,6 +529,11 @@ def update(self, **kwds): # updates the channel 'existingCh' with the new provided properties and tags # without affecting the other tags and properties of this channel + update(channels = channels) + >>> update(channels=[{'name':'existingCh','owner':'chOwner', 'tags':[...], 'properties':[...]}, {...}]) + # updates the channels in batch given with the new provided properties and tags + # without affecting the other tags and properties of this channel + update(property = Property, channelName = String) >>> update(property={'name':'propName', 'owner':'propOwner', 'value':'propValue'}, channelName='ch1') @@ -585,6 +590,7 @@ def __handleSingleUpdateParameter(self, **kwds): Handle single update. It accepts key-value pair as parameters. The keys could be one of the following: - channel + - channels - property - tag - tags @@ -599,6 +605,14 @@ def __handleSingleUpdateParameter(self, **kwds): verify=False, auth=self.__auth) r.raise_for_status() + elif 'channels' in kwds: + chs = kwds['channels'] + r = self.__session.post(self.__baseURL + self.__channelsResource, + data=JSONEncoder().encode(chs), + headers=copy(self.__jsonheader), + verify=False, + auth=self.__auth) + r.raise_for_status() elif 'property' in kwds: property = kwds['property'] r = self.__session.post(self.__baseURL + self.__propertiesResource + '/' + property[u'name'],