MCPcopy Index your code
hub / github.com/Bitmessage/PyBitmessage / __init__

Method __init__

src/singleinstance.py:22–37  ·  view source on GitHub ↗
(self, flavor_id="", daemon=False)

Source from the content-addressed store, hash-verified

20 which is under the Python Software Foundation License version 2
21 """
22 def __init__(self, flavor_id="", daemon=False):
23 self.initialized = False
24 self.counter = 0
25 self.daemon = daemon
26 self.lockPid = None
27 self.lockfile = os.path.normpath(os.path.join(state.appdata, 'singleton%s.lock' % flavor_id))
28
29 if not self.daemon and not state.curses:
30 # Tells the already running (if any) application to get focus.
31 import bitmessageqt
32 bitmessageqt.init()
33
34 self.lock()
35
36 self.initialized = True
37 atexit.register(self.cleanup)
38
39 def lock(self):
40 if self.lockPid is None:

Callers

nothing calls this directly

Calls 2

lockMethod · 0.95
registerMethod · 0.80

Tested by

no test coverage detected