Move verbose copyright information block to end of file.
[dput.git] / TODO.code-style
blob82ee488fe1b8921f47626838645ed022f04e2401
1 To Do list for improving code idioms
2 ####################################
4 To Do
5 =====
7 * Ensure all files explicitly opened are closed correctly.
9 * Encapsulate application state in a class.
11   * dput.dput.PackageUploadApplication
12   * dput.dcut.CommandUploadApplication
14 * Reduce ‘if __name__ == '__main__'’ block to minimum.
16 * Use idiomatic ‘configparser’ processing.
18   * Migrate to ‘ConfigParser.read’ method.
19   * Remove direct query to ‘DEFAULT’ config section.
21 * Use ‘str.format’ for all string formatting and interpolation.
23   * Remove usage of ‘%’ formatting operator.
25 * Use ‘argparse’ for command-line parsing.
27   * Remove usage of ‘getopt’.
29 * Use ‘logging’ module throughout for all messages.
31   * Remove usage of ‘sys.std{out,err}.write’ for debug-level messages.
32   * Remove usage of ‘sys.std{out,err}.write’ for informational messages.
33   * Remove usage of ‘sys.std{out,err}.write’ for warning message.
34   * Remove usage of ‘sys.std{out,err}.write’ for error messages.
35   * Remove usage of ‘sys.std{out,err}.write’ for critical error messages.
38 Done
39 ====
41 * Remove use of global variables.
43   * dput.dcut.progname
44   * dput.dcut.version
45   * dput.dcut.USAGE
46   * dput.dput.dput_version
47   * dput.dput.files_to_remove
48   * dput.dput.files_to_upload
49   * dput.dput.USAGE
50   * dput.dput.config_file
51   * dput.dput.config
52   * dput.dput.check_only
53   * dput.dput.dinstall
54   * dput.dput.delay_upload
55   * dput.dput.unsigned_upload
56   * dput.dput.simulate
57   * dput.dput.upload_methods
59 * Use ‘subprocess’ API for all subprocess interaction.
61   * Remove usage of ‘os.popen3’.
62   * Migrate ‘os.system’ → ‘subprocess.call’.
63   * Migrate ‘os.waitpid’ → ‘subprocess.check_call’.
64   * Migrate ‘os.popen’ → ‘subprocess.Popen’.
65   * Migrate ‘os.spawnv’ → ‘subprocess.check_call’.
67 * Use ‘sys.stdout.write’ for all normal output.
69   * Remove usage of ‘print’ for normal output.
73     Local variables:
74     coding: utf-8
75     mode: text
76     mode: rst
77     End:
78     vim: fileencoding=utf-8 filetype=rst :