def enforceArgName(commonName): '''This will require that all listeners use the same argument name (commonName) as first parameter. This could be a ueful first step in transition an application that has been using *arg1* protocol to the default *kwargs* protocol, see the docs for details. ''' import core core.setMsgDataArgName(1, commonName)
def transitionFromArg1(commonName): '''This will require that all calls to pub.sendMessage() use the kwargs protocol, ie named arguments for the message data. This is a useful step after setuparg1.enforceArgName(commonName) was used and the application debugged. Replace the call to enforceArgName with :: setupkwargs.transitionFromArg1(commonName) After this stage tested and debugged, this function call can be removed, and all reference to the .data attribute of the message object received can be removed in all listeners. The migration will then be complete. ''' core.setMsgDataArgName(2, commonName)
def transitionFromArg1(commonName): '''This will require that all calls to pub.sendMessage() use the kwargs protocol, ie named arguments for the message data. This is a useful step after setuparg1.enforceArgName(commonName) was used and the application debugged. Replace the latter with :: setupkwargs.transitionFromArg1(commonName) After this stage tested and debugged, this function call can be removed, and all reference to the .data attribute of the message object received can be removed in all listeners, allowing the application to run in the default messaging protocol (kwargs) used by pubsub version >= 3. ''' import core core.setMsgDataArgName(2, commonName)
def enforceArgName(commonName): '''This will configure pubsub to require that all listeners use the same argument name (*commonName*) as first parameter. This could be a ueful first step in transitioning an application that has been using *arg1* protocol to the more powerful *kwargs* protocol. ''' core.setMsgDataArgName(1, commonName)