2018-08-24 20:27:56 +00:00
|
|
|
# Common items used throughout the project
|
|
|
|
|
|
|
|
import pytz
|
|
|
|
from datetime import datetime
|
|
|
|
|
2019-12-27 03:33:40 +00:00
|
|
|
# Bot's current version (as a string), for use in the help command
|
|
|
|
BotVersion = "1.1.2"
|
|
|
|
|
2018-08-24 20:27:56 +00:00
|
|
|
# For case-insensitive time zone lookup, map lowercase tzdata entries with
|
|
|
|
# entires with proper case. pytz is case sensitive.
|
|
|
|
tzlcmap = {x.lower():x for x in pytz.common_timezones}
|
|
|
|
|
|
|
|
def logPrint(label, line):
|
|
|
|
"""
|
|
|
|
Print with timestamp in a way that resembles some of my other projects
|
|
|
|
"""
|
|
|
|
resultstr = datetime.utcnow().strftime('%Y-%m-%d %H:%m:%S') + ' [' + label + '] ' + line
|
|
|
|
print(resultstr)
|