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