mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Fix logging and cleanup imports in client.py
This commit is contained in:
parent
9d32b28f94
commit
431a983d5b
@ -16,9 +16,7 @@
|
|||||||
# You should have received a copy of the GNU Lesser General Public License
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import base64
|
|
||||||
import binascii
|
import binascii
|
||||||
import json
|
|
||||||
import logging
|
import logging
|
||||||
import math
|
import math
|
||||||
import mimetypes
|
import mimetypes
|
||||||
@ -1105,7 +1103,10 @@ class Client(Methods, BaseClient):
|
|||||||
try:
|
try:
|
||||||
self.session_storage.load_session(self.session_name)
|
self.session_storage.load_session(self.session_name)
|
||||||
except SessionDoesNotExist:
|
except SessionDoesNotExist:
|
||||||
log.info('Session {} was not found, initializing new one')
|
session_name = self.session_name[:32]
|
||||||
|
if session_name != self.session_name:
|
||||||
|
session_name += '...'
|
||||||
|
log.info('Could not load session "{}", initializing new one'.format(self.session_name))
|
||||||
self.auth_key = Auth(self.dc_id, self.test_mode, self.ipv6, self._proxy).create()
|
self.auth_key = Auth(self.dc_id, self.test_mode, self.ipv6, self._proxy).create()
|
||||||
|
|
||||||
def load_plugins(self):
|
def load_plugins(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user