[SVN] release 0.4.0
[SVN] all comments in code now in English; Sofia ♥ Fuck you with this barbarian language in code comments! (no, no fuck please) [FIX] monkey-patched telethon library to fix updates receiving in some sessions (fix github issue #686; commit b20aa0ccc91b3d767c26702f3611c44772d87f5a) [FIX] fixed "normal" quotation, such as `> text`, in previous releases it was intended to be message id to reply [FIX] now processing bots in contact list, in roster with `b` prefix [FIX] fixed message editing and deleting in supergroups [FIX] now removing old telegram session from database when initiating a new one for current JID [FIX] fixed group creating; group, supergroup, channels creating is now OK and tested [FIX] fixed processing bot in roster; now it does not crashes gateway [UPD] default status update interval is now 30 [UPD] slighly (and finally) changed behaviour of presences: `Last seen recently` = `dnd (do not disturb)`, because user that enabled this privacy settings does not want you to disturb `Last seen a long time ago` = `xa (extended away)`, because it is 'long' away 'Last seen at %date%` = `away`, because user just got away [ADD] basic interaction with bots (now only with text commands)
This commit is contained in:
10
start.py
10
start.py
@@ -13,7 +13,7 @@ xmpp_logger = logging.getLogger('sleekxmpp')
|
||||
|
||||
class StreamToLogger:
|
||||
"""
|
||||
Прикидывается файловым объектом. Нужен для перехвата стандартных потоков ввода-вывода.
|
||||
Stream logger.
|
||||
"""
|
||||
def __init__(self, logger, level=logging.INFO, old_out=None):
|
||||
self.logger = logger
|
||||
@@ -24,7 +24,7 @@ class StreamToLogger:
|
||||
self._prev = None
|
||||
|
||||
def write(self, buf):
|
||||
if self._prev == buf == '\n': # Надо на буфер переделывать
|
||||
if self._prev == buf == '\n':
|
||||
self._prev = buf
|
||||
buf = ''
|
||||
else:
|
||||
@@ -39,7 +39,7 @@ class StreamToLogger:
|
||||
pass
|
||||
|
||||
|
||||
# Настраиваем логгирование
|
||||
# Logger config
|
||||
logging.basicConfig(
|
||||
level=logging.DEBUG if CONFIG['debug'] else logging.INFO,
|
||||
format='%(asctime)s :: %(levelname)s:%(name)s :: %(message)s',
|
||||
@@ -47,7 +47,7 @@ logging.basicConfig(
|
||||
handlers=[logging.handlers.RotatingFileHandler(filename=CONFIG['logfile']), logging.StreamHandler(sys.stdout)]
|
||||
)
|
||||
|
||||
# Создаем логгеры и перехватчики для STDOUT/STDERR
|
||||
# Stdout/stderr
|
||||
logger_stdout = logging.getLogger('__stdout')
|
||||
sys.stdout = StreamToLogger(logger_stdout, logging.INFO)
|
||||
|
||||
@@ -58,7 +58,7 @@ logging.getLogger().log(logging.INFO, '~'*81)
|
||||
logging.getLogger().log(logging.INFO, ' RESTART '*9)
|
||||
logging.getLogger().log(logging.INFO, '~'*81)
|
||||
print('----------------------------------------------------------------------')
|
||||
print('--- Telegram (MTProto) <---> XMPP Gateway ---')
|
||||
print('--- Telegram (MTProto) <-> XMPP Gateway ---')
|
||||
print('----------------------------------------------------------------------')
|
||||
print()
|
||||
print('Starting...')
|
||||
|
||||
Reference in New Issue
Block a user