simon-budig / woof

an ad-hoc single file webserver
119 stars 16 forks source link

Generally update strings. Read discription. #6

Closed CoolCat467 closed 1 year ago

CoolCat467 commented 3 years ago

Changed entire file's indentation from 3 spaces to 4 spaces, the default of all python files. Fixed some formatting after indent modification Changed big comment block at the start of the file about the license and stuff into a docstring so it shows up if someone runs help(woof) after importing it Added docstrings to functions Changed variable name from type to ftype in do_GET as to not replace builtin type function Changed almost all strings to use fstrings instead of % formatting because it's cleaner and apparently faster Changed almost all strings to use single quotes instead of double quotes (in my opinion it looks nicer) Changed lists that have constant values into tuples, as since they will never change they can be immutable Changed multiple sections that figure out filename compressed extension to use new function get_archive_ext instead of duplicated code

CoolCat467 commented 3 years ago

This will be the first of a few changes I am proposing. Thank you for your time.

simon-budig commented 3 years ago

Hi @CoolCat467.

Thanks for your efforts, but I cannot accept any changes that basically exchange the whole file. This makes it impossible to review the changes and selectively use the stuff that I find useful.

Basically this means that a change that changes the indentation for the whole file is not acceptable. Besides using three spaces is a personal preference for me (and I know that I am weird there :-) it also kills the "diffability" across this commit.

I would need individual commits for the individual issues you listed above to be able to review and apply them. And a commit changing the indentation unfortunately is not acceptable for me.

CoolCat467 commented 3 years ago

Just undid indent formatting change

CoolCat467 commented 3 years ago

Oh, my commit from the future got in too now. Can't easily undo that. Additional changes future one makes:

Changed imports to import only required functions (except a few like os) Removed unused subprocess and struct imports Added suffixGen generator for code that uses suffix, allowing more than just 9 duplicate filenames (not really needed but it might happen somewhere.)