Skip to content

Commit

Permalink
Merge branch 'master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
cmlccie committed Oct 4, 2016
2 parents c0c7ac9 + 539cf1f commit 20ed390
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 14 deletions.
6 changes: 1 addition & 5 deletions ciscosparkapi/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-

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

"""Git implementation of _version.py."""
from __future__ import print_function
from builtins import str
from builtins import object

import errno
import os
Expand All @@ -33,7 +29,7 @@ def get_keywords():
return keywords


class VersioneerConfig(object):
class VersioneerConfig:
"""Container for Versioneer configuration parameters."""


Expand Down
2 changes: 1 addition & 1 deletion ciscosparkapi/api/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def update(self, webhookId, **update_attributes):
"argument must be specified."
raise ciscosparkapiException(error_message)
# API request
json_obj = self.session.post('webhooks/' + webhookId,
json_obj = self.session.put('webhooks/' + webhookId,
json=update_attributes)
# Return a Webhook object created from the response JSON data
return Webhook(json_obj)
Expand Down
36 changes: 36 additions & 0 deletions examples/people.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Script to demostrate the use of ciscosparkapi for the people API
The package natively retrieves your Spark access token from the
SPARK_ACCESS_TOKEN environment variable. You must have this environment
variable set to run this script.
"""


from __future__ import print_function
from ciscosparkapi import CiscoSparkAPI


try:
api = CiscoSparkAPI() # Create a CiscoSparkAPI connection object; uses your SPARK_ACCESS_TOKEN
except Exception as e:
print(e)


# Get my user information
print("Get my information ...")
me = api.people.me()
print(me)

# Get my user information using id
print("Get my information but using id ...")
me_by_id = api.people.get(me.id)
print(me_by_id)

# Get my user information using id
print("Get the list of people I know ...")
people = api.people.list(displayName="Jose") # Creates a generator container (iterable) that lists the people I know
for person in people:
print(person.displayName) # Return the displayName of every person found
11 changes: 3 additions & 8 deletions versioneer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

# Version: 0.16

"""The Versioneer - like a rocketeer, but for versions.
Expand Down Expand Up @@ -349,15 +349,10 @@
"""

from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import object
try:
import configparser
except ImportError:
import configparser as configparser

import ConfigParser as configparser
import errno
import json
import os
Expand All @@ -366,7 +361,7 @@
import sys


class VersioneerConfig(object):
class VersioneerConfig:
"""Container for Versioneer configuration parameters."""


Expand Down

0 comments on commit 20ed390

Please sign in to comment.