Spaces:
Build error
Build error
freemt
commited on
Commit
·
490dc24
1
Parent(s):
aeb2033
Update __main__.py
Browse files- radiobee/__main__.py +10 -6
radiobee/__main__.py
CHANGED
@@ -2,10 +2,13 @@
|
|
2 |
# pylint: disable=invalid-name, too-many-arguments, unused-argument, redefined-builtin, unused-import, wrong-import-position, too-many-locals, too-many-statements
|
3 |
from typing import Any, Tuple, Optional, Union # noqa
|
4 |
|
|
|
5 |
import sys
|
6 |
from pathlib import Path # noqa
|
7 |
-
|
8 |
-
import
|
|
|
|
|
9 |
import platform
|
10 |
import signal
|
11 |
from random import randint
|
@@ -109,17 +112,18 @@ if __name__ == "__main__":
|
|
109 |
server_name = "0.0.0.0"
|
110 |
debug = False
|
111 |
debug = True
|
112 |
-
<<<<<<< HEAD
|
113 |
share = True
|
|
|
114 |
|
115 |
# set UTC+8, probably wont work in hf spaces, no permission
|
|
|
116 |
try:
|
117 |
sp.check_output(shlex.split("ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime"))
|
118 |
except Exception as exc:
|
119 |
logger.error(" set timezonef failed: %s", exc)
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
else:
|
124 |
server_name = "127.0.0.1"
|
125 |
share = False
|
|
|
2 |
# pylint: disable=invalid-name, too-many-arguments, unused-argument, redefined-builtin, unused-import, wrong-import-position, too-many-locals, too-many-statements
|
3 |
from typing import Any, Tuple, Optional, Union # noqa
|
4 |
|
5 |
+
import os
|
6 |
import sys
|
7 |
from pathlib import Path # noqa
|
8 |
+
|
9 |
+
# import subprocess as sp
|
10 |
+
# import shlex
|
11 |
+
import time
|
12 |
import platform
|
13 |
import signal
|
14 |
from random import randint
|
|
|
112 |
server_name = "0.0.0.0"
|
113 |
debug = False
|
114 |
debug = True
|
|
|
115 |
share = True
|
116 |
+
share = False
|
117 |
|
118 |
# set UTC+8, probably wont work in hf spaces, no permission
|
119 |
+
_ = """
|
120 |
try:
|
121 |
sp.check_output(shlex.split("ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime"))
|
122 |
except Exception as exc:
|
123 |
logger.error(" set timezonef failed: %s", exc)
|
124 |
+
# """
|
125 |
+
os.environ["TZ"] = "Asia/Shanghai"
|
126 |
+
time.tzset()
|
127 |
else:
|
128 |
server_name = "127.0.0.1"
|
129 |
share = False
|