rsudp.c_custom (run code)

class rsudp.c_custom.Custom(q=False, codefile=False, win_ovr=False)

New in version 0.4.3.

A consumer class that runs custom code from a python file passed to it. Please read the disclaimers and warnings at custom (run custom code) prior to using this module.

Warning

If you are running Windows and have code you want to pass to the exec() function, Python requires that your newline characters are in the UNIX style (\n), not the standard Windows style (\r\n). To convert, follow the instructions in one of the answers to this stackoverflow question. If you’re not sure what this means, please read about newline/line ending characters here. If you are certain that your code file has no Windows newlines, you can set “win_override” to true.

Read more warnings about this module at custom (run custom code).

Parameters
  • q (queue.Queue) – queue of data and messages sent by rsudp.c_consumer.Consumer.

  • codefile (str or bool) – string of the python (.py) file to run, or False if none.

  • win_ovr (bool) – user check to make sure that line ending format is correct (see warning above)

run()

Reads data from the queue and executes self.codefile if it sees an ALARM message. Quits if it sees a TERM message.


Back to top ↑