Skip to content

Commit

Permalink
Fix modpython about renaming EModuleType.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Sokolov committed Aug 21, 2011
1 parent 288f450 commit fca0d83
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/modpython/znc.py
Expand Up @@ -150,7 +150,7 @@ def __len__(self):

class Module:
description = '< Placeholder for a description >'
module_types = [ModuleTypeUser]
module_types = [CModInfo.UserModule]

wiki_page = ''

Expand Down Expand Up @@ -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."
Expand All @@ -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."
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit fca0d83

Please sign in to comment.