Skip to content

Commit

Permalink
加入全域變數初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiao777774 committed Sep 13, 2020
1 parent e5a96b7 commit 3a41daf
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import time
import logging
from threading import Thread
from dataclasses import dataclass


class Logger:
Expand All @@ -21,8 +22,6 @@ def error(self, message):
def critical(self, message):
logging.critical(message)

logger = Logger()


class Timer:
def __init__(self):
Expand Down Expand Up @@ -61,4 +60,21 @@ def start(self):
Thread.start(self)

def run(self):
Timer.start(self)
Timer.start(self)


@dataclass
class LatLng:
latitude: float = 0.0
longitude: float = 0.0


def initialize_vars():
global GLOBAL_LOGGER
GLOBAL_LOGGER = Logger()

global GLOBAL_SPEECH_CONTENT
GLOBAL_SPEECH_CONTENT = ''

global GLOBAL_LATLNG
GLOBAL_LATLNG = LatLng()

0 comments on commit 3a41daf

Please sign in to comment.