[bumblebee-status] add python 2.x warning
explicitly report that Python 2.x is not supported see #645
This commit is contained in:
parent
ffae9c2e26
commit
747e67e1be
1 changed files with 8 additions and 0 deletions
|
@ -20,6 +20,8 @@ import core.input
|
||||||
import core.event
|
import core.event
|
||||||
|
|
||||||
|
|
||||||
|
started = False
|
||||||
|
|
||||||
class CommandSocket(object):
|
class CommandSocket(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.__name = "/tmp/.bumblebee-status.{}".format(os.getpid())
|
self.__name = "/tmp/.bumblebee-status.{}".format(os.getpid())
|
||||||
|
@ -109,6 +111,7 @@ def main():
|
||||||
|
|
||||||
output.modules(modules)
|
output.modules(modules)
|
||||||
core.event.trigger("start")
|
core.event.trigger("start")
|
||||||
|
started = True
|
||||||
while True:
|
while True:
|
||||||
core.event.trigger("update")
|
core.event.trigger("update")
|
||||||
core.event.trigger("draw")
|
core.event.trigger("draw")
|
||||||
|
@ -118,9 +121,14 @@ def main():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
|
if sys.version_info.major < 3:
|
||||||
|
raise Exception("at least Python 3.4 required (Python 2.x not supported)")
|
||||||
main()
|
main()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# really basic errors -> make sure these are shown in the status bar by minimal config
|
# really basic errors -> make sure these are shown in the status bar by minimal config
|
||||||
|
if not started:
|
||||||
|
print("{\"version\":1}")
|
||||||
|
print("[")
|
||||||
while True:
|
while True:
|
||||||
sys.stdout.write(
|
sys.stdout.write(
|
||||||
json.dumps(
|
json.dumps(
|
||||||
|
|
Loading…
Reference in a new issue