Carl Worth [Wed, 12 Jan 2022 08:42:03 +0000 (00:42 -0800)]
Expect all dependencies to be found from /
Specifically, the .css and .js files needed by the files being generated here.
By expecting these from '/' we can serve them statically from that
single location, even if all of the files we generate end up at some
lower-level directory (such as when we soon isolate the web pages for
each hunt from each other).
Carl Worth [Wed, 12 Jan 2022 08:20:40 +0000 (00:20 -0800)]
Abstract out the filename_from_name function
Previously, there were many, many places i nthe code performing a
calculation of:
"_".join(name.split())
in order to replace all spaces with underscores before using a name as
a filename.
But as we determined recently, this is insufficient as we at least
need to also replaces all '/' with an '_' as well (to ensure that the
filename looks like a filename and not a directory plus a filename).
The previous fix for the '/' in one place, (immediately before writing
the file), meant that all the other places that were emitting links to
that file were now wrong.
We can ensure everything is consistent by having a single function for
all instances of this filename generation which we do here with the
new filename_from_name() function.
Carl Worth [Wed, 12 Jan 2022 08:05:06 +0000 (00:05 -0800)]
Drop the top-level "turb" data structure
In the original turbot code, this was a simple structure to hold on to
all the things necessary for turbot. Specifically, it had a boto
connection to the database, a handle for the Google sheets API, and a
handle for the Slack client API.
In this code, the only one of those things we talk to is the DynamoDB
table so that's all we need here.