[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Re: Switching to Python 3
From:       J._Pablo_Martín_Cobos <goinnn () gmail ! com>
Date:       2013-11-11 13:18:07
Message-ID: CALNyWLEZ124ibDPVS0U1R5fiQ=tnKcXVXY4Rv46JD_1APYM6Ng () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


2013/11/11 Philipp A. <flying-sheep@web.de>

> 2013/11/11 Sven Brauch <svenbrauch@googlemail.com>
>
>> Why not just run those utilities as provided by the system? There's pep8=
-
>> python2 and pep8-python3, so you can just execute those programs and hav=
e
>> both
>> language versions supported, no?
>>
>> Or does kate currently invoke them using libpython too? In that case thi=
s
>> should maybe be changed.
>>
>> Sven
>>
>
> the tool is written using python and has a python api, so it=92s pretty
> natural to just use that instead of letting the tool create python
> datastructures, convert them to text, write that text to a pipe, read tha=
t
> text from the pipe, and parse it into python datastructures again.
>
> but i agree: if pep8.py can=92t be fixed to work on scripts written in th=
e
> version of python that it isn=92t run with, we should do that. for the sa=
ke
> of elegance, however, we should only use that backwards way for the other
> version (i.e. use the python api to use pep8.py on python 3 files, and us=
e
> a shell to run python2 pep8.py and parse the output on python2 files)
>
>
Thanks for the explication.


> PS: we have quite a bunch of linters now. i think it=92s time to generate=
 a
> common linter base class that can be subclassed. like:
>
>    1. BaseLinter (base class for all linters with methods to run it and
>    show line highlights and a method that runs it and returns a list of e=
rrors)
>    2. ConsoleLinter (where you have to pass a console command and if it
>    can use stdin or has to use a tmpfile, as well as have to override a m=
ethod
>    to parse its output to a list of errors)
>    3. JSLinter (uses my new JS framework that currently lives in jsutils
>    to load a JS module and pass the lintable source through it)
>
> i=92ll be glad to write it once my changes to jsutils get pulled and we g=
ot
> rid of kate.gui in favor of a better alternative.
>
> _______________________________________________
> KWrite-Devel mailing list
> KWrite-Devel@kde.org
> https://mail.kde.org/mailman/listinfo/kwrite-devel
>
>

[Attachment #5 (text/html)]

<div dir="ltr">2013/11/11 Philipp A. <span dir="ltr">&lt;<a \
href="mailto:flying-sheep@web.de" \
target="_blank">flying-sheep@web.de</a>&gt;</span><br><div class="gmail_extra"><div \
class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"> <div dir="ltr"><div \
class="gmail_extra"><div class="gmail_quote"><div class="im">2013/11/11 Sven Brauch \
<span dir="ltr">&lt;<a href="mailto:svenbrauch@googlemail.com" \
target="_blank">svenbrauch@googlemail.com</a>&gt;</span><br> <blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">


Why not just run those utilities as provided by the system? There&#39;s pep8-<br>
python2 and pep8-python3, so you can just execute those programs and have both<br>
language versions supported, no?<br>
<br>
Or does kate currently invoke them using libpython too? In that case this<br>
should maybe be changed.<br>
<span><font color="#888888"><br>
Sven<br></font></span></blockquote><div><br></div></div><div class="im"><div>the tool \
is written using python and has a python api, so it’s pretty natural to just use that \
instead of letting the tool create python datastructures, convert them to text, write \
that text to a pipe, read that text from the pipe, and parse it into python \
datastructures again.<br>



<br></div><div>but i agree: if pep8.py can’t be fixed to work on scripts written in \
the version of python that it isn’t run with, we should do that. for the sake of \
elegance, however, we should only use that backwards way for the other version (i.e. \
use the python api to use pep8.py on python 3 files, and use a shell to run python2 \
pep8.py and parse the output on python2 files)<br>


<br></div></div></div></div></div></blockquote><div><br></div><div>Thanks for the \
explication. <br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 \
0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"> <div \
class="gmail_extra"><div class="gmail_quote"><div class="im"><div></div><div>PS: we \
have quite a bunch of linters now. i think it’s time to generate a common linter base \
class that can be subclassed. like:<br><ol><li> BaseLinter (base class for all \
linters with methods to run it and show line highlights and a method that runs it and \
returns a list of errors)</li>

<li>ConsoleLinter (where you have to pass a console command and if it can use stdin \
or has to use a tmpfile, as well as have to override a method to parse its output to \
a list of errors)</li><li>JSLinter (uses my new JS framework that currently lives in \
jsutils to load a JS module and pass the lintable source through it)</li>


</ol><p>i’ll be glad to write it once my changes to jsutils get pulled and we got rid \
of kate.gui in favor of a better alternative.<br></p></div></div></div></div></div> \
<br>_______________________________________________<br> KWrite-Devel mailing list<br>
<a href="mailto:KWrite-Devel@kde.org">KWrite-Devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kwrite-devel" \
target="_blank">https://mail.kde.org/mailman/listinfo/kwrite-devel</a><br> \
<br></blockquote></div><br></div></div>



_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic