TODO.code-style 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. To Do list for improving code idioms
  2. ####################################
  3. To Do
  4. =====
  5. * Ensure all files explicitly opened are closed correctly.
  6. * Encapsulate application state in a class.
  7. * dput.dput.PackageUploadApplication
  8. * dput.dcut.CommandUploadApplication
  9. * Reduce ‘if __name__ == '__main__'’ block to minimum.
  10. * Use idiomatic ‘configparser’ processing.
  11. * Migrate to ‘ConfigParser.read’ method.
  12. * Remove direct query to ‘DEFAULT’ config section.
  13. * Use ‘str.format’ for all string formatting and interpolation.
  14. * Remove usage of ‘%’ formatting operator.
  15. * Use ‘argparse’ for command-line parsing.
  16. * Remove usage of ‘getopt’.
  17. * Use ‘logging’ module throughout for all messages.
  18. * Remove usage of ‘sys.std{out,err}.write’ for debug-level messages.
  19. * Remove usage of ‘sys.std{out,err}.write’ for informational messages.
  20. * Remove usage of ‘sys.std{out,err}.write’ for warning message.
  21. * Remove usage of ‘sys.std{out,err}.write’ for error messages.
  22. * Remove usage of ‘sys.std{out,err}.write’ for critical error messages.
  23. Done
  24. ====
  25. * Remove use of global variables.
  26. * dput.dcut.progname
  27. * dput.dcut.version
  28. * dput.dcut.USAGE
  29. * dput.dput.dput_version
  30. * dput.dput.files_to_remove
  31. * dput.dput.files_to_upload
  32. * dput.dput.USAGE
  33. * dput.dput.config_file
  34. * dput.dput.config
  35. * dput.dput.check_only
  36. * dput.dput.dinstall
  37. * dput.dput.delay_upload
  38. * dput.dput.unsigned_upload
  39. * dput.dput.simulate
  40. * dput.dput.upload_methods
  41. * Use ‘subprocess’ API for all subprocess interaction.
  42. * Remove usage of ‘os.popen3’.
  43. * Migrate ‘os.system’ → ‘subprocess.call’.
  44. * Migrate ‘os.waitpid’ → ‘subprocess.check_call’.
  45. * Migrate ‘os.popen’ → ‘subprocess.Popen’.
  46. * Migrate ‘os.spawnv’ → ‘subprocess.check_call’.
  47. * Use ‘sys.stdout.write’ for all normal output.
  48. * Remove usage of ‘print’ for normal output.
  49. ..
  50. Local variables:
  51. coding: utf-8
  52. mode: text
  53. mode: rst
  54. End:
  55. vim: fileencoding=utf-8 filetype=rst :