~juju-deployers/python-jujuclient/trunk

« back to all changes in this revision

Viewing changes to jujuclient/__init__.py

  • Committer: Tim Van Steenburgh
  • Date: 2016-07-12 02:28:46 UTC
  • Revision ID: tvansteenburgh@gmail.com-20160712022846-g14fe37eild7gk2e
juju-2.0beta11 compatibility

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
"""
 
2
Juju Client
 
3
-----------
 
4
 
 
5
A simple synchronous python client for the juju-core websocket api.
 
6
 
 
7
Supports python 2.7 & 3.4+.
 
8
 
 
9
See README for example usage.
 
10
"""
 
11
# License: LGPLv3
 
12
# Author: Kapil Thangavelu <kapil.foss@gmail.com>
 
13
 
 
14
import logging
 
15
 
 
16
import websocket
 
17
 
 
18
 
 
19
# There are two pypi modules with the name websocket (python-websocket
 
20
# and websocket) We utilize python-websocket, sniff and error if we
 
21
# find the wrong one.
 
22
try:
 
23
    websocket.create_connection
 
24
except AttributeError:
 
25
    raise RuntimeError(
 
26
        "Expected 'python-websocket' egg "
 
27
        "found incompatible gevent 'websocket' egg")
 
28
 
 
29
 
 
30
websocket.logger = logging.getLogger("websocket")
 
31
log = logging.getLogger("jujuclient")