ssimunic / Daily-Reddit-Wallpaper

Change your wallpaper to the most upvoted image of the day from /r/wallpapers or any other subreddit on system startup
http://ssimunic.github.io/Daily-Reddit-Wallpaper/
GNU General Public License v3.0
306 stars 51 forks source link

Style/PEP8, standardized quotes, remove redundant logic... #5

Closed joesanford closed 8 years ago

joesanford commented 8 years ago

A big commit with a fair amount of changes:

  1. Applied PEP8 styling (variable names
  2. Standardized quotes - original had mix of double and single
  3. Removed redundant logic for checking Linux desktop environments, changed to a dictionary for name and command.
  4. Changed function arguments to not shadow outer scope
  5. Changed all string formatting to .format for readability, standards across file
  6. Restructured so main logic is in main block
  7. Changed how .getoutput is imported, backwards compatible with Python <= 2.6
  8. Changed print statements to be Python 3 compatible
  9. Added requirements.txt
  10. Checking for request response to be == requests.codes.ok instead of the explicit 200

NOTE: Tested on Mac OS X 10.11.5 only