From: Anthony Liguori <aliguori@us.ibm.com>
To: Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk>
Cc: xen-devel <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] replace tabs with spaces of Python code
Date: Wed, 18 May 2005 15:43:50 -0500 [thread overview]
Message-ID: <428BA906.80204@us.ibm.com> (raw)
In-Reply-To: <A95E2296287EAD4EB592B5DEEFCE0E9D1E40C9@liverpoolst.ad.cl.cam.ac.uk>
[-- Attachment #1: Type: text/plain, Size: 2800 bytes --]
Ian Pratt wrote:
>
>
>
>
>>there are many Python codes in tools/ that mix tab and space
>>for indentation, which might introduce some silly and hidden
>>bugs. this is a serious problem and must be avoid at all cost.
>>
>>here is a patch (against cset 1.1452) to replace all tabs with spaces.
>>all the changes are pretty trivial, and i double checked everything.
>>please take a look to see if all the modifies are OK.
>>
>>Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
>>
>>
>
>Are you sure python interprets a tab as a 4 spaces? I thought it
>interpretted it as 8?
>
>
It's not that simple. Check out 2.1.8 of the python language spec.
http://docs.python.org/ref/indentation.html
Tabs are expanded to the next 8 character column. The following script
expands tabs as described in the python standard. I don't know how to
do tab expansion in sed.
Regards,
Anthony Liguori
Signed-off-by: Anthony Liguori
>Hmm, there are a whole bunch of outstanding xend patches this this is
>going to create merge hell for, so I'm not sure we want to apply this
>straight away.
>
>Could you just post the script you used, or did you just do the obvious
>sed invocation?
>
>Thanks,
>Ian
>
>
>
>>any idea? if nobody complains, i would prepare a patch like
>>this for -testing tree.
>>
>>
>>$ diffstat removetab.patch
>> logging/logging-0.4.9.2/test/mymodule.py | 6 +-
>> xen/sv/CreateDomain.py | 34 ++++++++--------
>> xen/sv/Daemon.py | 2
>> xen/sv/DomInfo.py | 55
>>++++++++++++--------------
>> xen/sv/DomList.py | 16 +++----
>> xen/sv/GenTabbed.py | 6 +-
>> xen/sv/HTMLBase.py | 4 -
>> xen/sv/Main.py | 12 ++---
>> xen/sv/NodeInfo.py | 16 +++----
>> xen/sv/Wizard.py | 64
>>+++++++++++++++----------------
>> xen/sv/util.py | 6 +-
>> xen/web/SrvBase.py | 6 +-
>> xen/web/SrvDir.py | 2
>> xen/xend/EventServer.py | 24 +++++------
>> xen/xend/PrettyPrint.py | 6 +-
>> xen/xend/XendClient.py | 6 +-
>> xen/xend/XendDomain.py | 4 -
>> xen/xend/encode.py | 2
>> xen/xend/server/SrvDomain.py | 6 +-
>> xen/xend/sxp.py | 2
>> xen/xm/main.py | 12 ++---
>> 21 files changed, 143 insertions(+), 148 deletions(-)
>>
>>--
>>regards,
>>aq
>>
>>
>>
>
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@lists.xensource.com
>http://lists.xensource.com/xen-devel
>
>
>
[-- Attachment #2: tab2space.py --]
[-- Type: application/x-python, Size: 507 bytes --]
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2005-05-18 20:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-18 20:06 [PATCH] replace tabs with spaces of Python code Ian Pratt
2005-05-18 20:21 ` Vincent Hanquez
2005-05-18 20:43 ` Anthony Liguori [this message]
2005-05-19 1:09 ` aq
-- strict thread matches above, loose matches on Subject: below --
2005-05-19 1:28 Ian Pratt
2005-05-19 2:40 ` aq
2005-05-19 9:17 ` Christian Limpach
2005-05-19 11:49 ` aq
2005-05-19 17:53 ` David Hopwood
2005-05-18 18:58 aq
2005-05-18 19:59 ` Jacob Gorm Hansen
2005-05-19 0:48 ` aq
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=428BA906.80204@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=m+Ian.Pratt@cl.cam.ac.uk \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.