-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathutils.py
More file actions
executable file
·28 lines (22 loc) · 746 Bytes
/
Copy pathutils.py
File metadata and controls
executable file
·28 lines (22 loc) · 746 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
#!/usr/bin/env python3
import logging
import yaml
def getLogger():
logger = logging.getLogger("btctl")
logger.setLevel(logging.DEBUG)
# Enable logging to console
if len(logger.handlers) < 1:
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
ch.setFormatter(logging.Formatter("%(asctime)s - %(message)s"))
logger.addHandler(ch)
return logger
def getHeadsetDetails():
with open("config.yaml") as config:
try: # Python >= 3.7
headset_details = yaml.load(config, Loader=yaml.FullLoader)
except: # Python < 3.7
headset_details = yaml.load(config)
return headset_details
def replaceColonWithUnderline(str):
return str.replace(':', '_')