TODO.code-style 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 ‘print’ for debug-level messages.
  19. * Remove usage of ‘print’ for Informational messages.
  20. * Remove usage of ‘print’ for warning message.
  21. * Remove usage of ‘print’ for error messages.
  22. * Remove usage of ‘print’ for critical error messages.
  23. * Use ‘sys.stdout.write’ for all normal output.
  24. * Remove usage of ‘print’ for normal output.
  25. * Use a Python native SSH library (e.g. Paramiko or Spur).
  26. * Remove usage of subprocess for SSH.
  27. * Use a Python native GnuPG library (e.g. ‘python-gnupg’).
  28. * Remove usage of subprocess for GnuPG.
  29. Done
  30. ====
  31. * Remove use of global variables.
  32. * dput.dcut.progname
  33. * dput.dcut.version
  34. * dput.dcut.USAGE
  35. * dput.dput.dput_version
  36. * dput.dput.files_to_remove
  37. * dput.dput.files_to_upload
  38. * dput.dput.USAGE
  39. * dput.dput.config_file
  40. * dput.dput.config
  41. * dput.dput.check_only
  42. * dput.dput.dinstall
  43. * dput.dput.delay_upload
  44. * dput.dput.unsigned_upload
  45. * dput.dput.simulate
  46. * dput.dput.upload_methods
  47. * Use ‘subprocess’ API for all subprocess interaction.
  48. * Remove usage of ‘os.popen3’.
  49. * Migrate ‘os.system’ → ‘subprocess.call’.
  50. * Migrate ‘os.waitpid’ → ‘subprocess.check_call’.
  51. * Migrate ‘os.popen’ → ‘subprocess.Popen’.
  52. * Migrate ‘os.spawnv’ → ‘subprocess.check_call’.
  53. ..
  54. Local variables:
  55. coding: utf-8
  56. mode: text
  57. mode: rst
  58. End:
  59. vim: fileencoding=utf-8 filetype=rst :