On Sat, Feb 12, 2011 at 12:03 AM, Hartmut Goebel <h.goe...@goebel-consult.de
> wrote:
> Hi,
>
> Hi,
> I just discovered this line in setup.py:
>
> etc_root = os.sep.join(etc_path.split(os.sep)[:-1])
>
> I've seen such constructs all over the code.* Please stop using such
> constructs!* It's ugly, hard to understand, hard to maintain and
> error-frown. For example this line does not honour alternative path
> separators (os.path.altsep).
>
> There as a very capable module os.path which handles path manipulation.
> Please see
> <http://docs.python.org/library/os.path.html><http://docs.python.org/library/os.path.html>for
> more information.
>
> The line above should be:
>
> etc_root = os.path.dirname(etc_path)
>
> Which more readable, easy to understand, speaks for itself, handles
> alternate separators and is shorter, too.
>
Yes, it's me sorry :)
Path cutting and so is something I didn't like. But now with path I think I
will like it more thanks :)
Jean
> --
> Schönen Gruß - Regards
> Hartmut Goebel
> Dipl.-Informatiker (univ.), CISSP, CSSLP
>
> Goebel Consult
> Spezialist für IT-Sicherheit in komplexen
> Umgebungenhttp://www.goebel-consult.de
>
> Monatliche Kolumne: http://www.cissp-gefluester.de/
> Goebel Consult mit Mitglied bei http://www.7-it.de
>
> [...]
>
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Shinken-devel mailing list
Shinken-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shinken-devel