diff options
author | Kali Kaneko <kali@leap.se> | 2015-08-31 14:54:52 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-08-31 14:54:52 -0400 |
commit | f4547479fc050f338845f4f546d8dd7c0e4512eb (patch) | |
tree | 0f737c7f102674230f5467ecaf17720e1d28f6eb /src/leap/bitmask/platform_init/locks.py | |
parent | dd43dad4b150adb66e571a56a8a5c053dec858d0 (diff) | |
parent | fd27f48a35736d8ba186c423a7de15ffee5143dd (diff) |
Merge tag '0.9.0rc2' into debian/experimental
Tag leap.bitmask version 0.9.0rc2
Diffstat (limited to 'src/leap/bitmask/platform_init/locks.py')
-rw-r--r-- | src/leap/bitmask/platform_init/locks.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/leap/bitmask/platform_init/locks.py b/src/leap/bitmask/platform_init/locks.py index ac45a5ce..203d367b 100644 --- a/src/leap/bitmask/platform_init/locks.py +++ b/src/leap/bitmask/platform_init/locks.py @@ -17,14 +17,13 @@ """ Utilities for handling multi-platform file locking mechanisms """ -import logging import errno import os import platform +from leap.bitmask.logs.utils import get_logger from leap.bitmask.platform_init import IS_WIN, IS_UNIX -from leap.common.events import signal as signal_event -from leap.common.events import events_pb2 as proto +from leap.common.events import emit, catalog if IS_UNIX: from fcntl import flock, LOCK_EX, LOCK_NB @@ -38,7 +37,7 @@ else: # WINDOWS from leap.bitmask.util import get_modification_ts, update_modification_ts -logger = logging.getLogger(__name__) +logger = get_logger() if IS_UNIX: @@ -364,7 +363,7 @@ def we_are_the_one_and_only(): locker.get_lock() we_are_the_one = locker.locked_by_us if not we_are_the_one: - signal_event(proto.RAISE_WINDOW) + emit(catalog.RAISE_WINDOW) return we_are_the_one elif IS_WIN: @@ -385,7 +384,7 @@ def we_are_the_one_and_only(): # let's assume it's a stalled lock we_are_the_one = True - signal_event(proto.RAISE_WINDOW) + emit(catalog.RAISE_WINDOW) while check_interval(): if get_modification_ts(lock_path) > ts: |