def loaddir(directory=None, topic='sitecontent'): """Load in a directory full of Tavern Messages.""" if directory is None: directory = msgsdir + topic print("Using directory: " + directory) listing = os.listdir(directory) e = Envelope() for infile in listing: print(infile) e.loadfile(directory + "/" + infile) if args.verbose: print(e.text()) # Send to the server. Don't bother to validate it first, the server # will do it. server.receiveEnvelope(env=e)