πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #87291

Re: PyClean installation

#87291
From: noel
Date: Wed, 16 Dec 2015 11:17
105 lines
3967 bytes
On Sun, 13 Dec 2015 22:00:13 +0100, Julien Γ‰LIE wrote:

> Hi,
> 
> At last I'm having a look at the installation of PyClean
>      https://github.com/crooks/PyClean
> 
> I noted two portability issues:
> 
> 
> * File "/usr/lib/python2.4/site-packages/pyclean/pyclean.py", line 149
>      class Binary():
>                   ^
> SyntaxError: invalid syntax
> 
> Changing
>    class Binary():
> to
>    class Binary:
> fixes the issue.  That syntax should also be enforced to other "class
> xxx():" in pyclean.py.
> 
> 
> 
> * File "/usr/lib/python2.4/site-packages/pyclean/pyclean.py", line 264
>      bad_files = {f: 0 for f in bad_file_list}
>                          ^
> SyntaxError: invalid syntax
> 
> Dict comprehensions are only available in Python 2.7 upwards.  I suggest
> to use the legacy syntax:
> 
>      bad_files = dict((f, 0) for f in bad_file_list)
> 
> 
> 
> 
> Well, after these two fixes for older versions of Python, I do not
> manage to run pyclean.py.
> 
> Note that the install path is different from the one mentioned in
> INSTALL:
> "Assuming the standard locations have been used, the following commands
> can be issued:-
> 
> cd ~news/bin/filter ln -s
> /usr/local/lib/python2.x/dist-packages/pyclean/pyclean.py filter_innd.py
> "
> 
> I have /usr/lib/python2.4/site-packages/pyclean/pyclean.py instead of
> dist-packages.
> 
> INN.py and filter_innd.py are in "~news/bin/filter".
> I have set PYTHONPATH to ".:~news/bin/filter" for the news user.
> 
> Otherwise, I have:
> 
> %python pyclean.py Traceback (most recent call last):
>    File "pyclean.py", line 3, in ?
>      import INN
> ImportError: No module named INN
> 
> 
> But with PYTHONPATH set to ".:~news/bin/filter", I have:
> 
> % python filter_innd.py Traceback (most recent call last):
>    File "filter_innd.py", line 4, in ?
>      from pyclean.Config import config
>    File "/usr/lib/python2.4/site-packages/pyclean/pyclean.py", line 4,
>    in ?
>      from pyclean.Config import config
> ImportError: No module named Config
> 
> and naturally:
> 
> % ctlinnd reload filter.python "PyClean initial load"
> ctlinnd: Failed to reload filter_innd.py
> 
> 
> 
> I do not understand why pyclean.Config is not found.
> Especially, when I have:
> 
> % python -c "import sys; print sys.path"
> ['', '/home/news', '/home/news/bin/filter', '/usr/lib/python24.zip',
> '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2',
> '/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload',
> '/usr/local/lib/python2.4/site-packages',
> '/usr/lib/python2.4/site-packages', '/var/lib/python-support/python2.4']
> 
> % python -c "from pyclean.Config import config ; print 'OK'"
> OK
> 
> So the import seems to work fine...
> 
> 
> Steve, do you have any recommendation usage related to paths to make it
> work?  Is it the right thing I am doing to install PyClean?


python is evil, its also about 15% more resource hog than perl on our 
tests, so thats saying something :)  ('n yes, we went back to perl LOL)


Technical Details
Message-ID: <5671485a$1@news.ausics.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
References: <n4km8u$1ra$1@news.trigofacile.com>

Show Full Headers
Complete Article Headers
Message-ID: <5671485a$1@news.ausics.net>
Subject: Re: PyClean installation
Date: Wed, 16 Dec 2015 11:17:46 +0000
From: noel <deletethis@invalin.lan>
References: <n4km8u$1ra$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
Newsgroups: news.software.nntp
X-No-Archive: Yes
X-Ping: Pong
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
 git://git.gnome.org/pan2)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: news.ausics.net
Organization: Ausics - http://www.ausics.org
Lines: 103
X-Complaints: abuse@ausics.net
X-Received-Body-CRC: 3236186379
X-Received-Bytes: 3926