From 12860e2ef2d46e9b1373fb44d34dd4ecf3918e8f Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 10 Nov 2014 15:39:17 -0800 Subject: [PATCH] doc/manual/writing_a_driver: add general guidelines --- doc/manual/writing_a_driver.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/manual/writing_a_driver.rst b/doc/manual/writing_a_driver.rst index 76849d164..86c2140e1 100644 --- a/doc/manual/writing_a_driver.rst +++ b/doc/manual/writing_a_driver.rst @@ -103,3 +103,11 @@ The controller's code would contain something similar to this: :: def main(): args = _get_args() simple_server_loop(Hello(), args.bind, args.port) + +General guidelines +------------------ + +* Format your source code according to PEP8. We suggest using ``flake8`` to check for compliance. +* The device identification (e.g. serial number) to attach to must be passed as a command-line parameter to the controller. +* Controllers must be able to operate in "simulation" mode, where they behave properly even if the associated hardware is not connected. For example, they can print the data to the console instead of sending it to the device, or dump it into a file. +* Keep command line parameters consistent across clients/controllers. When adding new command line options, look for a client/controller that does a similar thing and follow its use of ``argparse``. If the original client/controller could use ``argparse`` in a better way, improve it.