Hi,

I think Class is useful for easy wrote, because the module manager won't
have to manage all "inheritance" things. If the method is not implemented,
it will just pass or raise (whatever we want), so it will be easier to wrote
modules with a good "Class API".

But the code you send are useful to see how we can load/call them for
testing purpose in shell. So we take both ways : class for easy code, and
testrun helping way for the code that will load/call them for testing
purpose :)


Jean

On Tue, Jan 25, 2011 at 10:50 PM, Hartmut Goebel <h.goe...@goebel-consult.de
> wrote:

>  Am 25.01.2011 14:17, schrieb Laurent Guyon:
>
>  > One very important thing for this should be a way to call theses
> "modules"
> > from the shell (like a dummy command that load the module and "run" it
> with
> > parameters).
>
>
>
> This can be done using a decorator perhaps, each "module" beeing a class.
>
> There is no need for a class (wherever it may ease implementation of the
> "checker" interface). One can easily implement something like this:
>
> def check(..):
>    # .... implementation
>
> def testrun(...):
>     #... parse args
>     #... put a lot of magic here
>     #... and run check
>
> if __name__ == '__main__':
>     testrun()
>
> You may want to have a look at
> <http://svn.origo.ethz.ch/wsvn/pdfposter/trunk/pdftools/pdfposter/cmd.py><http://svn.origo.ethz.ch/wsvn/pdfposter/trunk/pdftools/pdfposter/cmd.py>and
> <http://svn.origo.ethz.ch/wsvn/pdfposter/trunk/pdftools/pdfposter/__init__.py><http://svn.origo.ethz.ch/wsvn/pdfposter/trunk/pdftools/pdfposter/__init__.py>.
> Just think of both modules concatenated.
>
> --
> 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/blog
>
> Monatliche Kolumne: http://www.cissp-gefluester.de/
> Goebel Consult mit Mitglied bei http://www.7-it.de
>
>
>
> ------------------------------------------------------------------------------
> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
> Finally, a world-class log management solution at an even better
> price-free!
> Download using promo code Free_Logger_4_Dev2Dev. Offer expires
> February 28th, so secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsight-sfd2d
> _______________________________________________
> Shinken-devel mailing list
> Shinken-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/shinken-devel
>
>
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Shinken-devel mailing list
Shinken-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shinken-devel

Reply via email to