Python INDENT
#1
Hello,

I want to start this thread because I have problems with tabs and spaces in my add-ons and I decided to change all my codes to space indent.

As I know TEAM XBMC use two spaces indent in C++. Many people think 2 space is more easy to read the code.

I found this thread and tried reindent.py for my code and it works very well.

I want to know what are you thinking about 2 or 4 spaces. And I want help for add indent option to reindent.py code. Because original code default 4 spaces indent.

If you are interested to add indent option you can find reindent.py HERE.

PS: default 4 spaces indent is on Line 197 and 211.
Reply
#2
queeup Wrote:Hello,

I want to start this thread because I have problems with tabs and spaces in my add-ons and I decided to change all my codes to space indent.

As I know TEAM XBMC use two spaces indent in C++. Many people think 2 space is more easy to read the code.

I just wanted to chime in on this, Personally for me this is a solved problem as I use Eclipse and pydev which both preserves the indentation when doing copy & paste actions (editors like emacs and vim are terrible about), and also highlights error in code caused by inconsistent indentation.

But anyway i prefer tabs or 4 spaces since I find it too easy the loose track of code levels with 2 spaces. Also more advanced editors will allow the coder to choose how he want's to represent a tab such that both sides "can get along" TM Smile.
Reply
#3
using tab with psppad, equal to 4 spaces
Reply
#4
Yes definitively 4 spaces too. The big difference with C++ is we don't have block in python, so 2 spaces form my point of view wouldn't make the code as clear.
Image
_____________________________

Repositories Installer: select and install unofficial repositories / TAC.TV: watch videos on TAC.TV
Installer Passion-XBMC: Download and Install Add-ons (pre-Dharma only)

Image
Reply

Logout Mark Read Team Forum Stats Members Help
Python INDENT0