TODO.code-style 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. To Do list for improving code idioms
  2. ####################################
  3. To Do
  4. =====
  5. * Remove all use of global variables.
  6. * Reduce ‘if __name__ == '__main__'’ block to minimum.
  7. * Use idiomatic ‘configparser’ processing.
  8. * Remove direct query to ‘DEFAULT’ config section.
  9. * Use ‘str.format’ for all string formatting and interpolation.
  10. * Remove usage of ‘%’ formatting operator.
  11. * Use ‘argparse’ for command-line parsing.
  12. * Remove usage of ‘getopt’.
  13. * Use ‘logging’ module throughout for all messages.
  14. * Remove usage of ‘print’ for debug-level messages.
  15. * Remove usage of ‘print’ for Informational messages.
  16. * Remove usage of ‘print’ for warning message.
  17. * Remove usage of ‘print’ for error messages.
  18. * Remove usage of ‘print’ for critical error messages.
  19. * Use ‘sys.stdout.write’ for all normal output.
  20. * Remove usage of ‘print’ for normal output.
  21. * Use ‘subprocess’ API for all subprocess interaction.
  22. * Remove usage of ‘os.system’.
  23. * Remove usage of ‘os.spawnv’.
  24. * Remove usage of ‘os.popen’.
  25. * Remove usage of ‘os.waitpid’.
  26. * Use a Python native SSH library (e.g. Paramiko or Spur).
  27. * Remove usage of subprocess for SSH.
  28. * Use a Python native GnuPG library (e.g. ‘python-gnupg’).
  29. * Remove usage of subprocess for GnuPG.
  30. Done
  31. ====
  32. * Remove all use of global variables.
  33. * dput.dcut.progname
  34. * dput.dcut.version
  35. * dput.dcut.USAGE
  36. * dput.dput.dput_version
  37. * dput.dput.files_to_remove
  38. * dput.dput.USAGE
  39. * Use ‘subprocess’ API for all subprocess interaction.
  40. * Remove usage of ‘os.popen3’.
  41. ..
  42. Local variables:
  43. coding: utf-8
  44. mode: text
  45. mode: rst
  46. End:
  47. vim: fileencoding=utf-8 filetype=rst :