1
1
#!/usr/bin/env python
2
from spyderlib import spyder
6
from spyderlib.baseconfig import get_conf_path
7
from spyderlib.config import CONF
8
from spyderlib.utils.external import lockfile
10
if CONF.get('main', 'single_instance'):
11
# Minimal delay (0.1-0.2 secs) to avoid that several
12
# instances started at the same time step in their
13
# own foots while trying to create the lock file
14
time.sleep(random.randrange(1000, 2000, 90)/10000.)
17
lockf = get_conf_path('spyder.lock')
18
lock = lockfile.FilesystemLock(lockf)
20
# lock.lock() tries to lock spyder.lock. If it fails,
21
# it returns False and so we try to start the client
23
from spyderlib import client
26
atexit.register(lock.unlock)
27
from spyderlib import spyder
30
from spyderlib import spyder