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 -3
View File
@@ -14,8 +14,11 @@
#
# 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 telethon.tl.types import *
from telethon.tl.types import User as TLUser
from .db import User as DBUser, Message as DBMessage
from .tgclient import MautrixTelegramClient
from . import portal as po, puppet as pu
@@ -24,7 +27,7 @@ config = None
class User:
log = None
log = logging.getLogger("mau.user")
db = None
az = None
by_mxid = {}
@@ -306,8 +309,7 @@ class User:
def init(context):
global config
User.az, User.db, log, config = context
User.log = log.getChild("user")
User.az, User.db, config = context
users = [User.from_db(user) for user in DBUser.query.all()]
for user in users: