Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: znc/znc
base: ee8f0b09589c
...
head fork: znc/znc
compare: d56c4437156f
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
2  modules/modperl.cpp
@@ -208,7 +208,7 @@ class CModPerl: public CModule {
PUSH_STR(sName);
PUSH_PTR(CModInfo*, &ModInfo);
PCALL("ZNC::Core::ModInfoByPath");
- if (!SvTRUE(ERRSV) && ret == 2) {
+ if (!SvTRUE(ERRSV)) {
ssMods.insert(ModInfo);
}
PEND;
View
17 modules/modperl/startup.pl
@@ -144,15 +144,7 @@ sub GetModInfo {
ZNC::CModules::FindModPath("$modname.pm", $modpath, $datapath) or return ($ZNC::Perl_NotFound, "Unable to find module [$modname]");
$modpath = $modpath->GetPerlStr;
return ($ZNC::Perl_LoadError, "Incorrect perl module.") unless IsModule $modpath, $modname;
- require $modpath;
- my $pmod = bless {}, $modname;
- my @types = $pmod->module_types;
- $modinfo->SetDefaultType($types[0]);
- $modinfo->SetDescription($pmod->description);
- $modinfo->SetWikiPage($pmod->wiki_page);
- $modinfo->SetName($modname);
- $modinfo->SetPath($modpath);
- $modinfo->AddType($_) for @types;
+ ModInfoByPath($modpath, $modname, $modinfo);
return ($ZNC::Perl_Loaded)
}
@@ -165,6 +157,8 @@ sub ModInfoByPath {
$modinfo->SetDefaultType($types[0]);
$modinfo->SetDescription($pmod->description);
$modinfo->SetWikiPage($pmod->wiki_page);
+ $modinfo->SetArgsHelpText($pmod->args_help_text);
+ $modinfo->SetHasArgs($pmod->has_args);
$modinfo->SetName($modname);
$modinfo->SetPath($modpath);
$modinfo->AddType($_) for @types;
@@ -291,6 +285,11 @@ sub module_types {
$ZNC::CModInfo::NetworkModule
}
+sub args_help_text { '' }
+
+sub has_args { 0 }
+
+
# Default implementations for module hooks. They can be overriden in derived modules.
sub OnLoad {1}
sub OnBoot {}
View
24 modules/modpython/znc.py
@@ -154,6 +154,9 @@ class Module:
wiki_page = ''
+ has_args = False
+ args_help_text = ''
+
def __str__(self):
return self.GetModName()
@@ -575,6 +578,14 @@ def unload_all():
unload_module(mod)
+def gather_mod_info(cl, modinfo):
+ modinfo.SetDescription(cl.description)
+ modinfo.SetWikiPage(cl.wiki_page)
+ modinfo.SetDefaultType(cl.module_types[0])
+ for module_type in cl.module_types:
+ modinfo.AddType(module_type)
+
+
def get_mod_info(modname, retmsg, modinfo):
'''0-not found, 1-error, 2-success'''
pymodule, datadir = find_open(modname)
@@ -585,13 +596,9 @@ def get_mod_info(modname, retmsg, modinfo):
pymodule.__file__, modname)
return 1
cl = pymodule.__dict__[modname]
- modinfo.SetDefaultType(cl.module_types[0])
- for module_type in cl.module_types:
- modinfo.AddType(module_type)
- modinfo.SetDescription(cl.description)
- modinfo.SetWikiPage(cl.wiki_page)
modinfo.SetName(modname)
modinfo.SetPath(pymodule.__file__)
+ gather_mod_info(cl, modinfo)
return 2
@@ -616,14 +623,9 @@ def get_mod_info_path(path, modname, modinfo):
if modname not in pymodule.__dict__:
return 0
cl = pymodule.__dict__[modname]
- modinfo.SetDescription(cl.description)
- modinfo.SetWikiPage(cl.wiki_page)
modinfo.SetName(modname)
modinfo.SetPath(pymodule.__file__)
- modinfo.SetDefaultType(cl.module_types[0])
- for module_type in cl.module_types:
- modinfo.AddType(module_type)
-
+ gather_mod_info(cl, modinfo)
return 1

No commit comments for this range

Something went wrong with that request. Please try again.