def do_POST(self): post_data_len = int(self.headers['Content-Length']) post_data = self.rfile.read(post_data_len) print post_data sys.stdout.flush() updatedNodes = 0 for blinknode in nuke.allNodes("BlinkScript"): print blinknode if os.path.samefile(post_data, blinknode.knob("kernelSourceFile").getValue()): print "Found {0}, reloading".format(blinknode.name()) # Force control panel to be shown or else the knobs won't execute properly nuke.executeInMainThread(blinknode.showControlPanel, ()) # nuke.executeInMainThread(blinknode.knob("clearKernelSource").execute, ()) nuke.executeInMainThread( blinknode.knob("reloadKernelSourceFile").execute, ()) # nuke.executeInMainThread(blinknode.hideControlPanel, ()) updatedNodes += 1 nuke.debug("Updated {0} Blink nodes in script {1}".format( updatedNodes, post_data)) self.send_response(200) # OK Response return
def debug(x): nuke.debug(str(x)) return x
def debug(x): nuke.debug("%s: %s" % (datetime.datetime.now().strftime("%H:%M:%S.%f"), str(x))) return x