POV-Ray : Newsgroups : povray.unix : Pyvon 1.3 Server Time
6 Oct 2024 17:25:20 EDT (-0400)
  Pyvon 1.3 (Message 5 to 14 of 14)  
<<< Previous 4 Messages Goto Initial 10 Messages
From: fabien Henon
Subject: Re: Pyvon 1.3
Date: 28 Jan 2003 17:47:58
Message: <3e37089e@news.povray.org>
Warp wrote:

> 
>>'Beautify' the code : Replaced spaces with tabs inside the code
>>Much remains to be done
> 
> 
>   I don't understand how this "beautifies" the code. If anything, it only
> causes problems.
> 
Indeed you did not understand. I meant I began to beautify the *PYTHON* 
code of pyvon. I never wrote that pyvon beautifies pov-ray code.
I should have written : 'Beautified' the pyvon code.

Apart from
- syntax highlighting
- automatic keyword expansion
- highlights of matching braces
- customization of tab lengths (all of which are already supported in pyvon)
I do not see what else I could add to make POV-Ray script more readable.

What I meant by replacing spaces with tabs is that python language is 
structured around indentation. Python does not use parentheses, 
brackets, semi-colon or keywords to delimit(nest) declaration or tests ie :


if x > y :      # test                            (indentation 0)
       print x   # what to do if the test is true (indentation 1)
       if x > 0: # nested test                    (indentation 1)
            x=x+1# things to do if test is true   (indentation 2)
else:           #                                 (indentation 0)
       print y   # what to do if the test is not true (indentation 1)
d="gfdgds"      # we are out of the test here     (indentation 0)



Both spaces and tabs are accepted in a python script; and when I began 
writing pyvon, I used different editors and did not want to bother to 
set up the different tab lengths and went for spaces instead. (Lazy me !)


Fabien HENON


Post a reply to this message

From: Jellby
Subject: Re: Pyvon 1.3
Date: 28 Jan 2003 18:06:33
Message: <3e370cf9@news.povray.org>
Entre otras cosas, Céline Castel tuvo a bien escribir:

> I have uploaded a new release of Pyvon with the numerous changes below.
> 
> As there are quite a few changes, there might be problems with previous
> versions. If so, just uninstall pyvon or delete the directory
> /usr/local/pyvon and reinstall it.

In my system (somewhat modified RedHat 7.3), the .rpm package complains 
about not having python >= 2.2 (which I have: python2-2.2.1-2) and xterm 
(which was provided by XFree86-4.2.0-8). So I installed the .gz, but pyvon 
didn't start, I went to /usr/local/pyvon and substituted "python" with 
"python2" in res.py and pyvon. I remember it was a bit of a mess when I 
installed python 2.2, because I had to keep python 1.5 for up2grade, that 
could be the culprit. I guess there was a link from python to python2, 
which I had to delete for up2grade to work... And then there's xterm.

Anyway, it's a useful tool and I'm glad you made it :)

-- 
Ignacio Fernández Galván
Linux User #289967 (counter.li.org)
PGP Pub Key ID: 0x01A95F99 (pgp.escomplinux.org)


Post a reply to this message

From: Warp
Subject: Re: Pyvon 1.3
Date: 28 Jan 2003 20:35:39
Message: <3e372feb@news.povray.org>
fabien Henon <fab### [at] caramailcom> wrote:
> Indeed you did not understand. I meant I began to beautify the *PYTHON* 
> code of pyvon.

  I understood perfectly what you meant, and my question is still valid.

> Both spaces and tabs are accepted in a python script; and when I began 
> writing pyvon, I used different editors and did not want to bother to 
> set up the different tab lengths and went for spaces instead. (Lazy me !)

  You are telling about the problems of using tabs instead of spaces. That
is, they cause problems.
  I still don't see how they make the code cleaner or more "beautiful".

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: HENON fabien
Subject: Re: Pyvon 1.3
Date: 29 Jan 2003 11:10:04
Message: <web.3e37fc26f3d2dd347ff7c9e30@news.povray.org>
Jellby wrote:
>Entre otras cosas, Céline Castel tuvo a bien escribir:


>> I have uploaded a new release of Pyvon with the numerous changes below.
>>
>> As there are quite a few changes, there might be problems with previous
>> versions. If so, just uninstall pyvon or delete the directory
>> /usr/local/pyvon and reinstall it.

Thanks.
Does pyvon work ? Do you have a problem with xterm ?
If you know that you have the proper packages already installed you can try

rpm -ivh --force --replacepkgs the_package_you_want_to_install.rpm

This overrides the error messages and replaces all the installed packages
(if any)

Ok that's not neat but that works when the rpm database can be kept up to
date


Fabien H

>
>In my system (somewhat modified RedHat 7.3), the .rpm package complains
>about not having python >= 2.2 (which I have: python2-2.2.1-2) and xterm
>(which was provided by XFree86-4.2.0-8). So I installed the .gz, but pyvon
>didn't start, I went to /usr/local/pyvon and substituted "python" with
>"python2" in res.py and pyvon. I remember it was a bit of a mess when I
>installed python 2.2, because I had to keep python 1.5 for up2grade, that
>could be the culprit. I guess there was a link from python to python2,
>which I had to delete for up2grade to work... And then there's xterm.
>
>Anyway, it's a useful tool and I'm glad you made it :)



>
>Ignacio Fernández Galván
>Linux User #289967 (counter.li.org)
>PGP Pub Key ID: 0x01A95F99 (pgp.escomplinux.org)
>


Post a reply to this message

From: gimi
Subject: Re: Pyvon 1.3
Date: 29 Jan 2003 11:12:57
Message: <3E37FCBB.3040206@psico.ch>
Thorsten Froehlich wrote:
> In article <3e36e7c9@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:
>>  I don't understand how this "beautifies" the code. If anything, it only
>>causes problems.
> 
> All official POV-Ray editors support tabs properly.  Only some people in the
> terminal world seem to prefer outdated editors without proper tab support.
> Those people need to realize that they are running software that has been
> outdated for two decades and that they should really move on.  Tabs are the
> future, spaces are a thing of the past many here don't even remember because
> they could neither read or write back then...

Tabs do indeed cause problems in some cases.

For example, I use different tab sizes for different
kinds of source files, like size 4 for perl, size 2 for
python and size 8 for others.  These files won't look
very good when loaded into some other (or someone else's)
editor or viewer if I used "real" tabs!

That's just one reason why I'd never use "real tabs" in
*any* editor.

And, the editors I know of handle spaces a lot better!
This includes the povray editor, which IMHO isn't a good
text editor anyway - it's functionality is quite limited.
It can't trim trailing spaces AFAIK, and I hate that mix-
ture of spaces and tabs I'd get after editing a file for
a while, as spaces are never replaced by tabs automatically.
Upon indenting text, another tab is just inserted at the
beginning of the line, and if auto-indentation is on, the
whole indent is copied from the previous line (including
whatever combination of tabs and spaces there are).

(So much about outdated software.. I grew up with emacs
and vi, and they both could (and still can) handle both
spaces and tabs excellently! - Though I don't know if
it was those you had in mind.. ;)

I can't really see one single reason to use tabs in plain
text files. - It would be a completely different story if
you used variable width fonts (or even a word processor;
but then, tabs are handled in a different fashion anyway).

Spaces are unambiguous.


g.

-- 
mailto:gim### [at] psicoch
http://www.psico.ch/ 
http://psico.servehttp.com/


Post a reply to this message

From: fabien Henon
Subject: Re: Pyvon 1.3
Date: 29 Jan 2003 13:22:03
Message: <3e381bcb@news.povray.org>
gimi wrote:
> Thorsten Froehlich wrote:
> 

>> In article <3e36e7c9@news.povray.org> , Warp <war### [at] tagpovrayorg>  
>> wrote:
>>
>>>  I don't understand how this "beautifies" the code. If anything, it only
>>> causes problems.
>>
>>
>> All official POV-Ray editors support tabs properly.  Only some people 
>> in the
>> terminal world seem to prefer outdated editors without proper tab 
>> support.
>> Those people need to realize that they are running software that has been
>> outdated for two decades and that they should really move on.  Tabs 
>> are the
>> future, spaces are a thing of the past many here don't even remember 
>> because
>> they could neither read or write back then...
> 
> 
> Tabs do indeed cause problems in some cases.
> 
> For example, I use different tab sizes for different
> kinds of source files, like size 4 for perl, size 2 for
> python and size 8 for others.  These files won't look
> very good when loaded into some other (or someone else's)
> editor or viewer if I used "real" tabs!
> 
> That's just one reason why I'd never use "real tabs" in
> *any* editor.
> 
> And, the editors I know of handle spaces a lot better!
> This includes the povray editor, which IMHO isn't a good
> text editor anyway - it's functionality is quite limited.
> It can't trim trailing spaces AFAIK, and I hate that mix-
> ture of spaces and tabs I'd get after editing a file for
> a while, as spaces are never replaced by tabs automatically.
> Upon indenting text, another tab is just inserted at the
> beginning of the line, and if auto-indentation is on, the
> whole indent is copied from the previous line (including
> whatever combination of tabs and spaces there are).
> 
> (So much about outdated software.. I grew up with emacs
> and vi, and they both could (and still can) handle both
> spaces and tabs excellently! - Though I don't know if
> it was those you had in mind.. ;)
> 
> I can't really see one single reason to use tabs in plain
> text files. - It would be a completely different story if
> you used variable width fonts (or even a word processor;
> but then, tabs are handled in a different fashion anyway).
> 
> Spaces are unambiguous.


And heavy. In some cases in python scripts, if tab sizes are set to 8 
(as was my case when I started using Kate), you have to type 8 times on 
the space. If you have heavily nested declarations, you have to multiply 
that number by the levels of nesting. Imagine what it's like in a 2000+ 
line script (pyvon)
I did started using spaces instead of tabs because at first I did not 
bother setting up tab size on the different editors.

This way I get the same identation inside all the def().


But this is a bit off-topic in here.

Fabien H

> 
> 
> g.
>


Post a reply to this message

From: gimi
Subject: Re: Pyvon 1.3
Date: 29 Jan 2003 14:43:40
Message: <3E382E10.2060809@psico.ch>
fabien Henon wrote:
 >gimi wrote:
> > Spaces are unambiguous.
> 
> And heavy. In some cases in python scripts, if tab sizes are set to 8 
> (as was my case when I started using Kate), you have to type 8 times on 
> the space. If you have heavily nested declarations, you have to multiply 
> that number by the levels of nesting. Imagine what it's like in a 2000+ 
> line script (pyvon)
> I did started using spaces instead of tabs because at first I did not 
> bother setting up tab size on the different editors.

If you use an editor that deserves its name, you could cofigure
it to insert (up to) 8 spaces instead of a single tab, exactly
like the pov editor can! - And, if you are programming in Python,
you should IMHO use something less than 8-char tabs; as i mentioned,
I usually program Python with tab size 2, that's enough.

But hitting the space bar thousands of times isn't fun... - You
have auto-indenting turned on, haven't you? ;)

(Oh, and just in case somebody would like to argue that source
files use too much disk space if one uses spaces instead of tabs
- that would really be ridiculous... :)

> But this is a bit off-topic in here.

Agreed. - Let's do some rendering now! :)


g.

-- 
mailto:gim### [at] psicoch
http://www.psico.ch/ 
http://psico.servehttp.com/


Post a reply to this message

From: Jellby
Subject: Re: Pyvon 1.3
Date: 29 Jan 2003 18:12:32
Message: <3e385fe0@news.povray.org>
Among other things, HENON fabien wrote:

> Does pyvon work ? Do you have a problem with xterm ?

Yes, it works (after the changes I mentioned). I haven't seen any problem 
with xterm.

> If you know that you have the proper packages already installed you can
> try
>
> rpm -ivh --force --replacepkgs the_package_you_want_to_install.rpm
> 
> This overrides the error messages and replaces all the installed packages
> (if any)

That could be a way (wouldn't --nodeps be enough?), but I prefer installing 
from tgz to a forced rpm :)

-- 

Linux User #289967 (counter.li.org)
PGP Pub Key ID: 0x01A95F99 (pgp.escomplinux.org)


Post a reply to this message

From: Th Boudet
Subject: Re: Pyvon 1.3
Date: 30 Jan 2003 13:24:49
Message: <3e396df1$1@news.povray.org>
fabien Henon wrote:

> (as was my case when I started using Kate),



Post a reply to this message

From: fabien Henon
Subject: Re: Pyvon 1.3
Date: 30 Jan 2003 16:18:06
Message: <3e39968e@news.povray.org>
Th Boudet wrote:
> fabien Henon wrote:
> 
>> (as was my case when I started using Kate),
> 
> 

> 
Hehe ! Heureusement que non !

Fabien


Post a reply to this message

<<< Previous 4 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.