Stop passing loggers around and organize imports

This commit is contained in:
Tulir Asokan
2018-02-06 18:10:19 +02:00
parent 9ea0ab3df1
commit 13c2d327fb
11 changed files with 45 additions and 30 deletions
+5 -2
View File
@@ -14,6 +14,8 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
from matrix_client.errors import MatrixRequestError
from .user import User
@@ -23,9 +25,10 @@ from .commands import CommandHandler
class MatrixHandler:
log = logging.getLogger("mau.mx")
def __init__(self, context):
self.az, self.db, log, self.config = context
self.log = log.getChild("mx")
self.az, self.db, self.config = context
self.commands = CommandHandler(context)
self.az.matrix_event_handler(self.handle_event)