jacroe / pidora

A Raspberry Pi Radio. Includes Pandora (via pianobar) and NPR Hourly News
http://pidora.jacroe.com/
GNU General Public License v3.0
38 stars 12 forks source link

pep8-ize the source #57

Open pjz opened 10 years ago

pjz commented 10 years ago

Any chance you'd want to run autopep8 (which is pip installable) over the source? Mostly to switch from tabs to spaces and 4-space indents? Makes it difficult to work on for python folk used to PEP8 styled source.

pjz commented 10 years ago

I did it on my fork to make it more easily hackable; take whatever you want from https://github.com/pjz/pidora .

jacroe commented 10 years ago

Would you call this the "official" PEP8 style guide? I'm working on version 2.0* of Pidora and would rather build it with these ideals in mind.

* In 2.0, I'm making things more modular by separating the pianobar bits from the Pidora bits so that it can support more services (such as Google Music and Soma.fm).

pjz commented 10 years ago

Yup, that's PEP 8. Good plan. Tools like the aforementioned autopep8 can help, and your text editor probably has a plugin.

jacroe commented 10 years ago

(Just realized that I included a footnote marker in my above comment and then didn't add the note. Fixed.)

Oh yeah converting from tabs to spaces in Sublime Text is easy-peas; I just usually work in tabs. I'm working more on getting variable and function names up to snuff.

pjz commented 10 years ago

Also, in places where you have X == y or X == z or X == a it's more pythonic to just test X in [ y, z, a ].