Re: Porting func on gentoo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Il giorno 23/ago/08, alle ore 17:33, Krzysztof A. Adamski ha scritto:
this one seems better suited for a global minion config (could just be a runtime variable - a thing like this should be autodetected and not provided by the user) since it would be the same information for all modules...
I just personally don't like the code looking like this:
if os == 'fedora':
 [...]
elif os == 'gentoo':
 [...]
elif os == 'debian':
 [...]
... with dozen of different cases...
You don't have to do that at every single point of choice in the code.

For example, I'd like to add service support for gentoo services.

func is OOP structured so it could use a python class defining a common interface (that's actually called Interface in other oop languages :) and implement that interface in different classes for the various operating systems.
The initialization code for a module could select the correct class (and this is the only place where you would put the choose-right-os logic) or raise exception if that particular os isn't supported by that particular module.

Have you got any better idea on how to achieve that? If you really want func to reach outside the fedora world, you'll have to consider this task sooner or later.

If nothing better comes out, I will probably try that way and propose the results to the list (if/when I'll have something working :)

--
Luca Lesinigo


--
Luca Lesinigo


_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list

[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux