This is a big pull request. Grab a snack and a cup of coffee before attempting review.
TinyDb
TinyDb is a python library that makes reading, writing, and organizing data into a JSON format super easy and efficient. This fits our use case perfectly and has cleaned up a lot of code because of it. Now all data is stored in a single data.json file instead of three separate files.
Typing
Python has built-in Typing support that just wasn't implemented. I've gone back and added types to all parameters and functions. The bot.py file may not have types everywhere but I'm not too concerned about that since those functions are only used inside that file.
File Name Changes
JSONMethod is now Queue
This module name no longer makes sense so it has been renamed to Queue to better reflect the file contents.
FilePaths is now DataFiles
This file was originally named FilePaths because its main purpose was to construct the paths to all of the data files. Since there are only two files and one path now, the name wasn't as applicable anymore.
BREAKING - Channel IDs
To make Norm more reusable, channel IDs are now read from the config file. We'll need to add these fields before deploying v6.
TestHelper Functions Debug Only
The helper commands like !fill and !flipCap are only meant for testing Norm. To make sure these commands cannot be used when deployed, they've been wrapped in the __debug__ flag so that the commands will only register in development.
Dictionary Keys
The keys for each dictionary has been exported to Types.py. This helps eliminate spelling and capitalization mistakes when referencing the data files.
This is a big pull request. Grab a snack and a cup of coffee before attempting review.
TinyDb
TinyDb is a python library that makes reading, writing, and organizing data into a JSON format super easy and efficient. This fits our use case perfectly and has cleaned up a lot of code because of it. Now all data is stored in a single
data.json
file instead of three separate files.Typing
Python has built-in Typing support that just wasn't implemented. I've gone back and added types to all parameters and functions. The
bot.py
file may not have types everywhere but I'm not too concerned about that since those functions are only used inside that file.File Name Changes
JSONMethod is now Queue
This module name no longer makes sense so it has been renamed to Queue to better reflect the file contents.
FilePaths is now DataFiles
This file was originally named FilePaths because its main purpose was to construct the paths to all of the data files. Since there are only two files and one path now, the name wasn't as applicable anymore.
BREAKING - Channel IDs
To make Norm more reusable, channel IDs are now read from the config file. We'll need to add these fields before deploying v6.
TestHelper Functions Debug Only
The helper commands like
!fill
and!flipCap
are only meant for testing Norm. To make sure these commands cannot be used when deployed, they've been wrapped in the__debug__
flag so that the commands will only register in development.Dictionary Keys
The keys for each dictionary has been exported to
Types.py
. This helps eliminate spelling and capitalization mistakes when referencing the data files.