forked from darknessomi/musicbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
51 lines (44 loc) · 1.26 KB
/
__init__.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
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python
# encoding: UTF-8
'''
网易云音乐 Entry
'''
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import str
from future import standard_library
standard_library.install_aliases()
import curses
import traceback
import argparse
import sys
from .menu import Menu
version = "0.2.4.1"
def start():
parser = argparse.ArgumentParser()
parser.add_argument("-v",
"--version",
help="show this version and exit",
action="store_true")
args = parser.parse_args()
if args.version:
latest = Menu().check_version()
curses.endwin()
print('NetEase-MusicBox installed version:' + version)
if latest != version:
print('NetEase-MusicBox latest version:' + str(latest))
sys.exit()
nembox_menu = Menu()
try:
nembox_menu.start_fork(version)
except (OSError, TypeError, ValueError, KeyError):
# clean up terminal while failed
nembox_menu.screen.keypad(1)
curses.echo()
curses.nocbreak()
curses.endwin()
traceback.print_exc()
if __name__ == '__main__':
start()