Permalink
Browse files

Support OnGetAvailableMods in python. #98

Currently this needs patched SWIG.
Upstream version crashes ZNC.
Hopefully they'll apply my patches upstream soon...
As for now, working modpython tarball is available at
http://people.znc.in/~darthgandalf/znc/modpython/
  • Loading branch information...
1 parent 85252f2 commit 5e711011c5fd69b75b6a614b97fe85d3a9c89208 @DarthGandalf DarthGandalf committed Jul 26, 2012
Showing with 4 additions and 8 deletions.
  1. +1 −0 modules/modpython/functions.in
  2. +2 −8 modules/modpython/modpython.i
  3. +1 −0 modules/modpython/module.h
View
1 modules/modpython/functions.in
@@ -71,3 +71,4 @@ void OnClientCapRequest(CClient* pClient, const CString& sCap, bool bState)
EModRet OnModuleLoading(const CString& sModName, const CString& sArgs, CModInfo::EModuleType eType, bool& bSuccess, CString& sRetMsg)
EModRet OnModuleUnloading(CModule* pModule, bool& bSuccess, CString& sRetMsg)
EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule, bool& bSuccess, CString& sRetMsg)
+void OnGetAvailableMods(std::set<CModInfo>& ssMods, CModInfo::EModuleType eType)
View
10 modules/modpython/modpython.i
@@ -47,14 +47,7 @@ using std::allocator;
%include <typemaps.i>
%include <stl.i>
%include <std_list.i>
-
-namespace std {
- template<class K> class set {
- public:
- set();
- set(const set<K>&);
- };
-}
+%include <std_set.i>
%include "modpython/cstring.i"
%template(_stringlist) std::list<CString>;
@@ -71,6 +64,7 @@ namespace std {
%template(VIRCNetworks) std::vector<CIRCNetwork*>;
%template(VChannels) std::vector<CChan*>;
%template(MNicks) std::map<CString, CNick>;
+%template(SModInfo) std::set<CModInfo>;
%typemap(in) CString& {
String* p;
View
1 modules/modpython/module.h
@@ -122,6 +122,7 @@ class CPyModule : public CModule {
virtual EModRet OnModuleUnloading(CModule* pModule, bool& bSuccess, CString& sRetMsg);
virtual EModRet OnGetModInfo(CModInfo& ModInfo, const CString& sModule,
bool& bSuccess, CString& sRetMsg);
+ virtual void OnGetAvailableMods(std::set<CModInfo>& ssMods, CModInfo::EModuleType eType);
};
static inline CPyModule* AsPyModule(CModule* p) {

0 comments on commit 5e71101

Please sign in to comment.