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: 288f450
...
head fork: znc/znc
compare: afbd741
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 10 additions and 10 deletions.
  1. +2 −2 main.h
  2. +8 −8 modules/modpython/znc.py
View
4 main.h
@@ -78,8 +78,8 @@
* inherits from CModule. Use #MODCONSTRUCTOR for the module's constructor and
* call #MODULEDEFS at the end of your source file.
* Congratulations, you just wrote your first module. <br>
- * For global modules, the procedure is similar. Instead of CModule you inherit
- * from CModule.
+ * For global modules, the procedure is similar. Instead of #MODULEDEFS call
+ * #GLOBALMODULEDEFS.
*
* If you want your module to actually do something, you should override some
* of the hooks from CModule. These are the functions whose names start with
View
16 modules/modpython/znc.py
@@ -150,7 +150,7 @@ def __len__(self):
class Module:
description = '< Placeholder for a description >'
- module_types = [ModuleTypeUser]
+ module_types = [CModInfo.UserModule]
wiki_page = ''
@@ -443,9 +443,9 @@ def load_module(modname, args, module_type, user, retmsg, modpython):
return 1
module = cl()
- if module_type == ModuleTypeUser:
+ if module_type == CModInfo.UserModule:
module._cmod = CreateUserPyModule(user, modname, datapath, module, modpython)
- elif module_type == ModuleTypeGlobal:
+ elif module_type == CModInfo.GlobalModule:
module._cmod = CreateGlobalPyModule(modname, datapath, module, modpython)
else:
retmsg.s = "Module [modpython] doesn't support module type."
@@ -457,13 +457,13 @@ def load_module(modname, args, module_type, user, retmsg, modpython):
module.SetModPath(pymodule.__file__)
module.SetType(module_type)
- if module_type == ModuleTypeUser:
+ if module_type == CModInfo.UserModule:
if not user:
- retmsg.s = "Module [modpython] needs user for for ModuleTypeUser."
+ retmsg.s = "Module [modpython] needs user for for UserModule."
unload_module(module)
return 1
user.GetModules().push_back(module._cmod)
- elif module_type == ModuleTypeGlobal:
+ elif module_type == CModInfo.GlobalModule:
CZNC.Get().GetModules().push_back(module._cmod)
else:
retmsg.s = "Module [modpython] doesn't support module type."
@@ -509,9 +509,9 @@ def load_module(modname, args, module_type, user, retmsg, modpython):
def unload_module(module):
module.OnShutdown()
cmod = module._cmod
- if module.GetType() == ModuleTypeUser:
+ if module.GetType() == CModInfo.UserModule:
cmod.GetUser().GetModules().removeModule(cmod)
- elif module.GetType() == ModuleTypeGlobal:
+ elif module.GetType() == CModInfo.GlobalModule:
CZNC.Get().GetModules().removeModule(cmod)
del module._cmod
cmod.DeletePyModule()

No commit comments for this range

Something went wrong with that request. Please try again.