Re: [Discuss-gnuradio] Strange indentation space in python script

2010-04-14 Thread Tim Meehan
Should you use vi (vim) the following in your .vimrc file should display
tabs as 4 spaces and more importantly insert 4 spaces instead of a tab when
you hit the tab key.

set ts=4
set shiftwidth=4
set expandtab


On Tue, Apr 13, 2010 at 7:51 AM, Johnathan Corgan <
jcor...@corganenterprises.com> wrote:

> On Tue, Apr 13, 2010 at 06:20, Tim Pearce 
> wrote:
>
> > Checking it on my copy here it looks like the script is playing the
> > dangerous game of mixing tabs + spaces so the actual indentation you see
> on
> > your text editor depends on how it treats tabs. Whether it works or not
> then
> > depends on how python chooses to treat the tabs.
>
> I'll fess up to having committed such Python treachery by having made
> some of those edits using an editor that didn't handle space/tabs
> consistently.  I have since learned the error of my ways and have gone
> down the Emacs path to redemption :-)
>
> Seriously, though, it's one of the few downsides to Python, but an
> important one--multiple developers should standardize on an editor to
> avoid issues like this.  Most of the code in GNU Radio has been
> written in Emacs.
>
> Johnathan
>
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Strange indentation space in python script

2010-04-13 Thread Johnathan Corgan
On Tue, Apr 13, 2010 at 06:20, Tim Pearce  wrote:

> Checking it on my copy here it looks like the script is playing the
> dangerous game of mixing tabs + spaces so the actual indentation you see on
> your text editor depends on how it treats tabs. Whether it works or not then
> depends on how python chooses to treat the tabs.

I'll fess up to having committed such Python treachery by having made
some of those edits using an editor that didn't handle space/tabs
consistently.  I have since learned the error of my ways and have gone
down the Emacs path to redemption :-)

Seriously, though, it's one of the few downsides to Python, but an
important one--multiple developers should standardize on an editor to
avoid issues like this.  Most of the code in GNU Radio has been
written in Emacs.

Johnathan


___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Strange indentation space in python script

2010-04-13 Thread Tim Pearce
It seems to display correctly on that link for me.

Checking it on my copy here it looks like the script is playing the
dangerous game of mixing tabs + spaces so the actual indentation you see on
your text editor depends on how it treats tabs. Whether it works or not then
depends on how python chooses to treat the tabs.

Looks like tabs are used on some other lines as well.

Cheers,

Tim

On Tue, Apr 13, 2010 at 1:24 PM, Andy_Long  wrote:

>
> Hi,all,
>
> I just found a strange probelm in python scripts. For example, if I look at
> the usrp2_fft.py file from the website listed as below. The indent of line
> 57 and line 59 has one indentation space smaller than other lines.
>
>
> http://vps.gnuradio.org/redmine/repositories/entry/gnuradio/gr-utils/src/python/usrp2_fft.py?rev=a549bd11646f60d425a74d530b8f3ddfc4774202
>
> However, if I down it into my laptop and open this file with IDLE or other
> editer, the line 57 and line 59 have two indentation space bigger than
> other
> lines.  In my opinion, there should not be any extra indentation space for
> both line 57 and line 59.
>
> Since the indentation is part of the python grammar, it confused me a lot.
>
> Regards
> Andy long
> --
> View this message in context:
> http://old.nabble.com/Strange-indentation-space-in-python-script-tp28229298p28229298.html
> Sent from the GnuRadio mailing list archive at Nabble.com.
>
>
>
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] Strange indentation space in python script

2010-04-13 Thread Andy_Long

Hi,all,

I just found a strange probelm in python scripts. For example, if I look at
the usrp2_fft.py file from the website listed as below. The indent of line
57 and line 59 has one indentation space smaller than other lines. 

http://vps.gnuradio.org/redmine/repositories/entry/gnuradio/gr-utils/src/python/usrp2_fft.py?rev=a549bd11646f60d425a74d530b8f3ddfc4774202

However, if I down it into my laptop and open this file with IDLE or other
editer, the line 57 and line 59 have two indentation space bigger than other
lines.  In my opinion, there should not be any extra indentation space for
both line 57 and line 59.

Since the indentation is part of the python grammar, it confused me a lot.

Regards
Andy long
-- 
View this message in context: 
http://old.nabble.com/Strange-indentation-space-in-python-script-tp28229298p28229298.html
Sent from the GnuRadio mailing list archive at Nabble.com.



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio