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

List:       kwrite-devel
Subject:    Re: Switching to Python 3
From:       "Philipp A." <flying-sheep () web ! de>
Date:       2013-11-11 13:14:07
Message-ID: CAN8d9gm91=Mi3xbutDaEHCu9pPxfjuFCTqOGuuJsxHGC11ssPA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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 have
> both
> language versions supported, no?
>
> Or does kate currently invoke them using libpython too? In that case this
> should maybe be changed.
>
> Sven
>

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.

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)

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:

   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 errors)
   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 method 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'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.

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">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>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>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>



_______________________________________________
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