The code is pretty well documented. Basically, just get the code working without significant change to the structure/architecture of the code. This script parses through files in a directory to create an object that is comprised from data values from the files. Finally, it dynamically loads a python module in a subdirectory and passes the object into the dynamically loaded module.
*This code closely follows actual Python code, but should be considered pseudo code.
[url removed, login to view] - the file to be debugged
campaigns/<campaign name>/[url removed, login to view] - load these values into the dictionary
campaigns/<campaign name>/[url removed, login to view] - pick one random line from here
campaigns/<campaign name>/[url removed, login to view] - pick the "next" line from here using [url removed, login to view] as a reference for the "last" line number that was used.
campaigns/<campaign name>/fragment_collection_<n>-<Description>.txt - pick a random group of text from here for each fragment_collection file and add them all together to build a "body".
campaigns/<campaign name>/[url removed, login to view] - finally, pass the campaign object into this script.
13 freelancers κάνουν προσφορές με μέσο όρο $30 γι' αυτή τη δουλειά
I have a lot of experience with python scripts loading files for configurations tasks, writing from one format to another, send data with different protocols and showing result in screen (in-line or out-line).