Skip to content

Instantly share code, notes, and snippets.

@ilovetogetspamed
Last active September 18, 2016 22:22
Show Gist options
  • Save ilovetogetspamed/f0a71896168789c779da892fce385dd6 to your computer and use it in GitHub Desktop.
Save ilovetogetspamed/f0a71896168789c779da892fce385dd6 to your computer and use it in GitHub Desktop.
McuProtocol is a twisted protocol
...
class McuProtocol(basic.LineReceiver):
def
def mcu_requested_shaft_delay_milliseconds(self, *args):
"""
The MCU requested the shaft delay milliseconds from the config.
Args:
*args: None
Returns: None
"""
Logger.info('McuProtocol: Requested shaft-delay-ms')
config = app.load_config()
shaft_delay = config.get('Machine', 'shaft delay')
self.transport.write('{:d}'.format(int(shaft_delay)))
def anotherFunctions
class MyApp(Application)
...
config = ConfigParser
...
if __name__ == '__main__':
app = MyApp() # used for getting config file from McuProtocol class... there has to be a better way...
MyApp().run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment