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