Modify context reload for better maintainability

This commit is contained in:
nemunaire 2014-10-09 07:39:38 +02:00
commit 4776fbe931
7 changed files with 83 additions and 16 deletions

View file

@ -17,6 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from datetime import datetime, timezone
import imp
class AbstractMessage:
@ -158,3 +159,13 @@ class OwnerCommand(Command):
"""This class represents a special command incomming from the owner"""
pass
def reload():
import message.visitor
imp.reload(message.visitor)
import message.printer
imp.reload(message.printer)
message.printer.reload()

View file

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Nemubot is a smart and modulable IM bot.
# Copyright (C) 2012-2014 nemunaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import imp
def reload():
import message.printer.IRC
imp.reload(message.printer.IRC)