From bcdfd37050a77adf1d6d65cc7cafa5f6e57f859c Mon Sep 17 00:00:00 2001 From: Ben Finney Date: Wed, 2 Sep 2015 12:58:47 +1000 Subject: [PATCH] Add a To Do list for remaining work on code style improvements. --- TODO.code-style | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 TODO.code-style diff --git a/TODO.code-style b/TODO.code-style new file mode 100644 index 0000000..26264be --- /dev/null +++ b/TODO.code-style @@ -0,0 +1,65 @@ +To Do list for improving code idioms +#################################### + +To Do +===== + +* Remove all use of global variables. + +* Reduce ‘if __name__ == '__main__'’ block to minimum. + +* Use idiomatic ‘configparser’ processing. + + * Remove direct query to ‘DEFAULT’ config section. + +* Use ‘str.format’ for all string formatting and interpolation. + + * Remove usage of ‘%’ formatting operator. + +* Use ‘argparse’ for command-line parsing. + + * Remove usage of ‘getopt’. + +* Use ‘logging’ module throughout for all messages. + + * Remove usage of ‘print’ for debug-level messages. + * Remove usage of ‘print’ for Informational messages. + * Remove usage of ‘print’ for warning message. + * Remove usage of ‘print’ for error messages. + * Remove usage of ‘print’ for critical error messages. + +* Use ‘sys.stdout.write’ for all normal output. + + * Remove usage of ‘print’ for normal output. + +* Use ‘subprocess’ API for all subprocess interaction. + + * Remove usage of ‘os.system’. + * Remove usage of ‘os.spawnv’. + * Remove usage of ‘os.popen’. + * Remove usage of ‘os.waitpid’. + +* Use a Python native SSH library (e.g. Paramiko or Spur). + + * Remove usage of subprocess for SSH. + +* Use a Python native GnuPG library (e.g. ‘python-gnupg’). + + * Remove usage of subprocess for GnuPG. + + +Done +==== + +* Use ‘subprocess’ API for all subprocess interaction. + + * Remove usage of ‘os.popen3’. + + +.. + Local variables: + coding: utf-8 + mode: text + mode: rst + End: + vim: fileencoding=utf-8 filetype=rst : -- 2.11.4.GIT