forked from Floobits/floobits-emacs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
floobits.py
40 lines (30 loc) · 858 Bytes
/
floobits.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
# coding: utf-8
import os
from floo import emacs_handler
from floo.common import migrations
from floo.common import reactor
from floo.common import utils
from floo.common import shared as G
def cb(port):
print('Now listening on %s' % port)
def main():
G.__VERSION__ = '0.11'
G.__PLUGIN_VERSION__ = '1.5.6'
utils.reload_settings()
if not os.path.exists(G.FLOORC_JSON_PATH):
migrations.migrate_floorc()
utils.reload_settings()
migrations.rename_floobits_dir()
migrations.migrate_symlinks()
try:
utils.normalize_persistent_data()
except Exception:
pass
emacs = emacs_handler.EmacsHandler()
G.emacs = emacs
_, port = reactor.reactor.listen(emacs)
utils.set_timeout(cb, 100, port)
reactor.reactor.block()
if __name__ == '__main__':
main()