mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
Replace library print()'s with calls to _logger
This commit is contained in:
parent
fb4885aed0
commit
0b9d76bda1
|
@ -246,7 +246,7 @@ class MtProtoSender:
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
print('Unknown message: {}'.format(hex(code)))
|
self._logger.warning('Unknown message: {}'.format(hex(code)))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# endregion
|
# endregion
|
||||||
|
|
|
@ -142,7 +142,8 @@ class TelegramClient:
|
||||||
|
|
||||||
return True
|
return True
|
||||||
except RPCError as error:
|
except RPCError as error:
|
||||||
print('Could not stabilise initial connection: {}'.format(error))
|
self._logger.warning('Could not stabilise initial connection: {}'
|
||||||
|
.format(error))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _reconnect_to_dc(self, dc_id):
|
def _reconnect_to_dc(self, dc_id):
|
||||||
|
@ -263,7 +264,6 @@ class TelegramClient:
|
||||||
|
|
||||||
except RPCError as error:
|
except RPCError as error:
|
||||||
if error.message.startswith('PHONE_CODE_'):
|
if error.message.startswith('PHONE_CODE_'):
|
||||||
print(error)
|
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
@ -681,7 +681,8 @@ class TelegramClient:
|
||||||
file_path = '{} - {}'.format(attr.performer, attr.title)
|
file_path = '{} - {}'.format(attr.performer, attr.title)
|
||||||
|
|
||||||
if file_path is None:
|
if file_path is None:
|
||||||
print('Could not determine a filename for the document')
|
raise ValueError('Could not infer a file_path for the document'
|
||||||
|
'. Please provide a valid file_path manually')
|
||||||
|
|
||||||
if add_extension:
|
if add_extension:
|
||||||
file_path += get_extension(message_media_document)
|
file_path += get_extension(message_media_document)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user