Controlling time file remains in watched directory

#1

Hello!
Simplify3d has a post-processing feature which I take advantage of. Unfortunately, Simplify3d uses the destination folder/directory for the temporary copy while editing it. When this temporary file is sent to "watched", sometimes it is moved before the post-processing can finish. The best solution would be for Simplify3d to use a temp directory for the edit but I don't know if I can get them to do that. Another approach would be to make sure that a file is at least a minute old before it is moved to the "downloaded" directory. What software is moving the file? Is it Octoprint, or samba, or something else?
Thank you!
Gene

#2

Looks like this is the code that is responsible for automatically uploading file(s) if seen in the watched folder. Note that it imports a standard Python class called watchdog.events. The on_created() function is likely the one which fires off in your case.

It appears to already have some feature to repeatedly check to make sure that the file has stopped changing.

In theory, perhaps increasing that number 5 to something bigger might make it wait longer before proceeding. Presumably this means 5 seconds.

def _repeatedly_check(self, path, interval=1, stable=5):
#3

Update: Changing this doesn't seem to make a difference, so I am wondering if I need to deliberately trigger python to reread the updated source code. Any suggestions? Even after rebooting the machine, it isn't waiting as long as it should. How do I turn on the debugging messages?

#4

If you edit the existing OctoPrint code in this case (or that of a plugin) then it's minimally necessary to delete the related *.pyc file (compiled Python) so that it can be recompiled and used. But it's more likely that all of this is then combined into an *.egg version which might be technically what is running at the moment of truth.

I don't know what steps would be necessary to do this but the documentation may be helpful, paying attention to the editable mode instructions.