-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathmain.pyw
More file actions
43 lines (32 loc) · 952 Bytes
/
Copy pathmain.pyw
File metadata and controls
43 lines (32 loc) · 952 Bytes
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
41
42
43
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import os.path
def run_new_process():
import subprocess
subprocess.Popen([sys.executable] + sys.argv + ["-new"])
def run_statistic():
import src.statistic_dialog
os.chdir(os.path.dirname(os.path.abspath(__file__)))
src.statistic_dialog.run_exclusive()
def run_import_lingueleo():
import src.import_dict
os.chdir(os.path.dirname(os.path.abspath(__file__)))
src.import_dict.ImportDict().import_dict("lingualeo.txt", "lingualeo")
def run_main():
import src.singleton
si = src.singleton.SingleInstance()
si
import src.app
os.chdir(os.path.dirname(os.path.abspath(__file__)))
src.app.App()
if __name__ == "__main__":
if "-new" not in sys.argv:
run_new_process()
elif "-stat" in sys.argv:
run_statistic()
elif "-lingualeo" in sys.argv:
run_import_lingueleo()
else:
run_main()