Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@

*.pyc
*.pyc
build/
*.egg-info/
14 changes: 14 additions & 0 deletions channelfinder/ChannelFinderClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand All @@ -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'],
Expand Down