summaryrefslogtreecommitdiff
path: root/src/leap/common
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-07-18 10:58:41 -0300
committerTomás Touceda <chiiph@leap.se>2014-07-18 10:58:41 -0300
commit2498d0c1712b06efe6ac29d883d3a80b541fe765 (patch)
tree75e765e9fea35913d730fac72fa884a4babfac4f /src/leap/common
parent5e29c85bae24784f4826b1ae735d2627a0e1d97f (diff)
parentbde8a330dc0a0cd43df1679a3f2c1d08b9bcfdf3 (diff)
Merge branch 'release-0.3.9'0.3.9
Diffstat (limited to 'src/leap/common')
-rw-r--r--src/leap/common/ca_bundle.py8
-rw-r--r--src/leap/common/events/__init__.py8
2 files changed, 12 insertions, 4 deletions
diff --git a/src/leap/common/ca_bundle.py b/src/leap/common/ca_bundle.py
index 1e00f25..d8c72a6 100644
--- a/src/leap/common/ca_bundle.py
+++ b/src/leap/common/ca_bundle.py
@@ -21,8 +21,12 @@ If you are packaging Requests, e.g., for a Linux distribution or a managed
environment, you can change the definition of where() to return a separately
packaged CA bundle.
"""
+import platform
import os.path
+_system = platform.system()
+
+IS_MAC = _system == "Darwin"
def where():
"""
@@ -30,6 +34,10 @@ def where():
:rtype: str
"""
# vendored bundle inside Requests, plus some additions of ours
+ if IS_MAC:
+ return os.path.join("/Applications", "Bitmask.app",
+ "Contents", "Resources",
+ "cacert.pem")
return os.path.join(os.path.dirname(__file__), 'cacert.pem')
if __name__ == '__main__':
diff --git a/src/leap/common/events/__init__.py b/src/leap/common/events/__init__.py
index 6eaf3d4..0cc6573 100644
--- a/src/leap/common/events/__init__.py
+++ b/src/leap/common/events/__init__.py
@@ -27,14 +27,14 @@ To register a callback to be executed when a specific event is signaled, use
leap.common.events.register():
>>> from leap.common.events import register
->>> from leap.common.events.proto import CLIENT_UID
->>> register(CLIENT_UID, lambda req: do_something(req))
+>>> from leap.common.events import events_pb2 as proto
+>>> register(proto.CLIENT_UID, lambda req: do_something(req))
To signal an event, use leap.common.events.signal():
>>> from leap.common.events import signal
->>> from leap.common.events.proto import CLIENT_UID
->>> signal(CLIENT_UID)
+>>> from leap.common.events import events_pb2 as proto
+>>> signal(proto.CLIENT_UID)
NOTE ABOUT SYNC/ASYNC REQUESTS: