Skip to content

Commit 20ed390

Browse files
committed
Merge branch 'master' into development
2 parents c0c7ac9 + 539cf1f commit 20ed390

File tree

4 files changed

+41
-14
lines changed

4 files changed

+41
-14
lines changed

ciscosparkapi/_version.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21

32
# This file helps to compute a version number in source trees obtained from
43
# git-archive tarball (such as those provided by githubs download-from-tag
@@ -10,9 +9,6 @@
109
# versioneer-0.16 (https://github.com/warner/python-versioneer)
1110

1211
"""Git implementation of _version.py."""
13-
from __future__ import print_function
14-
from builtins import str
15-
from builtins import object
1612

1713
import errno
1814
import os
@@ -33,7 +29,7 @@ def get_keywords():
3329
return keywords
3430

3531

36-
class VersioneerConfig(object):
32+
class VersioneerConfig:
3733
"""Container for Versioneer configuration parameters."""
3834

3935

ciscosparkapi/api/webhooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def update(self, webhookId, **update_attributes):
247247
"argument must be specified."
248248
raise ciscosparkapiException(error_message)
249249
# API request
250-
json_obj = self.session.post('webhooks/' + webhookId,
250+
json_obj = self.session.put('webhooks/' + webhookId,
251251
json=update_attributes)
252252
# Return a Webhook object created from the response JSON data
253253
return Webhook(json_obj)

examples/people.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
""" Script to demostrate the use of ciscosparkapi for the people API
4+
5+
The package natively retrieves your Spark access token from the
6+
SPARK_ACCESS_TOKEN environment variable. You must have this environment
7+
variable set to run this script.
8+
9+
"""
10+
11+
12+
from __future__ import print_function
13+
from ciscosparkapi import CiscoSparkAPI
14+
15+
16+
try:
17+
api = CiscoSparkAPI() # Create a CiscoSparkAPI connection object; uses your SPARK_ACCESS_TOKEN
18+
except Exception as e:
19+
print(e)
20+
21+
22+
# Get my user information
23+
print("Get my information ...")
24+
me = api.people.me()
25+
print(me)
26+
27+
# Get my user information using id
28+
print("Get my information but using id ...")
29+
me_by_id = api.people.get(me.id)
30+
print(me_by_id)
31+
32+
# Get my user information using id
33+
print("Get the list of people I know ...")
34+
people = api.people.list(displayName="Jose") # Creates a generator container (iterable) that lists the people I know
35+
for person in people:
36+
print(person.displayName) # Return the displayName of every person found

versioneer.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# -*- coding: utf-8 -*-
1+
22
# Version: 0.16
33

44
"""The Versioneer - like a rocketeer, but for versions.
@@ -349,15 +349,10 @@
349349
"""
350350

351351
from __future__ import print_function
352-
from future import standard_library
353-
standard_library.install_aliases()
354-
from builtins import str
355-
from builtins import object
356352
try:
357353
import configparser
358354
except ImportError:
359-
import configparser as configparser
360-
355+
import ConfigParser as configparser
361356
import errno
362357
import json
363358
import os
@@ -366,7 +361,7 @@
366361
import sys
367362

368363

369-
class VersioneerConfig(object):
364+
class VersioneerConfig:
370365
"""Container for Versioneer configuration parameters."""
371366

372367

0 commit comments

Comments
 (0)