Open andreleblanc11 opened 2 months ago
it occurs to me that something in the rename/ folder should be something that changes the name of a file... it should not change the content. It sounds like raw2bulletin is changing the content... the name should probably be something else...
in 3.0.53 there's a new call available to callbacks: getContent() ... you can put an if statement if "content' header is missing, then try the the m.getContent() call ( https://metpx.github.io/sarracenia/Reference/code.html#sarracenia.Message.getContent )
The bulletin class is not a true plugin. It just a class in the root directory. you probably should add options as an argument to constructor... like so:
def __init__( self, options):
self.o = options
then ... b=Bulletin(self.o)
The raw2bulletin renamer only renames the filename and does not alter the file contents so I think it should stay in the rename directory.
The getData
method in bulletin.py
fetches either the downloaded bulletin file or the bulletin contents from the sarracenia message. With this data, we fetch the station name, the BBB and the timestamp to generate the bulletin filename.
Should probably remove getdata from bulletinand use the one in the Message class
Originally,
rename/raw2bulletin.py
was ported from v2/Sundew to integrate the AM protocol into sr3.Now that we look to port more configurations from Sundew to Sarra, we'll eventually need to have a way of generating bulletin filenames reliably. The way we currently do this is we send our unformated bulletin filenames to Sundew, where it receives the bulletins through an AM receiver. That receiver then auto-converts the filenames correctly.
When I tried to use the sr3 renamer with a sender (
callback rename.some-other-plugin-linking-to-the-raw2bulletin-renamer
in the config) , these are the problems that I've come accross.Bulletin
class is complaining that it is not able to findself.o
. This isn't a problem with the AM flow config, and I thought this might be because we do acallback_prepend gather.am
in the config. I tried doing the same with the renamer, but this didn't resolve the problem.msg['new_dir']
andmsg['new_file']
to get the file contents. However, for a sender,directory
corresponds to the directory where we want to drop files in the transfer so using thenew
fields doesn't make sense for this component.