osdir.com


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

Module Issue


Abdur-Rahmaan Janhangeer <arj.python at gmail.com> writes:
> i have a project at
>
> https://github.com/Abdur-rahmaanJ/honeybot
>
> see https://github.com/Abdur-rahmaanJ/honeybot/tree/master/honeybot
>
> my question is :
>
> how to include a util file / module that can be imported in both
> core_plugins and
> user_plugins?
>
> if that is too difficult, let us take only core_plugins
>
> make a module not found error not appear when running main.py

Have a look at so called "namespace package"s.

A "namespace package" is in some sense a "virtual package" consisting
of an extensible set of subpackages (real and
potentially other "namespace" packages).
The subpackages may declare dependencies on other subpackages
of the "namespace package" and thereby ensure, that the subset
they depend on are installed if they are installed.


"dm.zope.rpc" is an example for such a "namespace package".
It contains common (= cross protocol) RPC (= "Remote Procedure Call")
infrastructure (and some protocol plugins);
"dm.zope.rpc.wsdl_suds" is a subpackage providing support
for the SOAP/WSDL protocol (using "suds" as basic implementation
component).