From 20ff4e405d55f999558d86c289e58220343ff960 Mon Sep 17 00:00:00 2001 From: Atterratio Aeternus Date: Tue, 3 Nov 2015 17:17:26 +0300 Subject: [PATCH 1/2] add: ad-hoc config logging in-out users --- plugins/logger.py | 53 ++++++++++++++++++++++++----------------------- plugins/main.py | 3 ++- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/plugins/logger.py b/plugins/logger.py index 3bd8067..556048e 100644 --- a/plugins/logger.py +++ b/plugins/logger.py @@ -174,33 +174,34 @@ def presence_logger(room,jid,nick,type,mass,mode,logfile): if not os.path.exists(curr_path): os.mkdir(curr_path) curr_file = ['%s/%02d.txt','%s/%02d.html'][GT('html_logs_enable')] % (curr_path,lt[2]) ott = onlytimeadd(lt) - log_body = ['[%s] ' % ott,'

%s ' % (ott,ott,ott,ott)][GT('html_logs_enable')] - if type == 'unavailable': - log_body += ['*** %s','%s'][GT('html_logs_enable')] % nick - if mode and jid != 'None': log_body += ' (%s)' % jid - if len(exit_type): log_body += ' %s' % exit_type - else: log_body += ' %s' % L('leave') - if exit_message != '': log_body += ' (%s)' % exit_message - if mode and '\r' in mass[4]: log_body += ', %s %s' % (L('Client:'),mass[4].split('\r')[1]) - log_body += '%s\n' % ['','

'][GT('html_logs_enable')] - else: - log_body += ['*** %s','%s'][GT('html_logs_enable')] % nick - if not_found == 0: + if GT('movement_logs_enable'): + log_body = ['[%s] ' % ott,'

%s ' % (ott,ott,ott,ott)][GT('html_logs_enable')] + if type == 'unavailable': + log_body += ['*** %s','%s'][GT('html_logs_enable')] % nick if mode and jid != 'None': log_body += ' (%s)' % jid - log_body += ' %s %s' % (L('join as'),L("%s/%s" % (role,affiliation))) - status_type = '%s_log_join' - elif not_found == 1: - log_body += ' %s %s' % (L('now is'),L("%s/%s" % (role,affiliation))) - if exit_message: log_body += ' (%s)' % exit_message - elif not_found == 2: status_type = '%s_log_change' - if not_found == 0 or not_found == 2: - status_mask = ' %s' if not_found else ', %s' - if show != 'None': log_body += status_mask % L(status_type % show).replace(status_type % '','') - else: log_body += status_mask % L(status_type % "online").replace(status_type % '','') - if priority != 'None': log_body += ' [%s]' % priority - else: log_body += ' [0]' - if text != 'None': log_body += ' (%s)' % text - log_body += '%s\n' % ['','

'][GT('html_logs_enable')] + if len(exit_type): log_body += ' %s' % exit_type + else: log_body += ' %s' % L('leave') + if exit_message != '': log_body += ' (%s)' % exit_message + if mode and '\r' in mass[4]: log_body += ', %s %s' % (L('Client:'),mass[4].split('\r')[1]) + log_body += '%s\n' % ['','

'][GT('html_logs_enable')] + else: + log_body += ['*** %s','%s'][GT('html_logs_enable')] % nick + if not_found == 0: + if mode and jid != 'None': log_body += ' (%s)' % jid + log_body += ' %s %s' % (L('join as'),L("%s/%s" % (role,affiliation))) + status_type = '%s_log_join' + elif not_found == 1: + log_body += ' %s %s' % (L('now is'),L("%s/%s" % (role,affiliation))) + if exit_message: log_body += ' (%s)' % exit_message + elif not_found == 2: status_type = '%s_log_change' + if not_found == 0 or not_found == 2: + status_mask = ' %s' if not_found else ', %s' + if show != 'None': log_body += status_mask % L(status_type % show).replace(status_type % '','') + else: log_body += status_mask % L(status_type % "online").replace(status_type % '','') + if priority != 'None': log_body += ' [%s]' % priority + else: log_body += ' [0]' + if text != 'None': log_body += ' (%s)' % text + log_body += '%s\n' % ['','

'][GT('html_logs_enable')] lht = '%s - %02d/%02d/%02d' % (room,lt[0],lt[1],lt[2]) log_he = ['%s\t\thttp://isida-bot.com\n\n' % lht,log_header+lht+'
\n'][GT('html_logs_enable')] try: log_he += initial_log_users(room,ott) + ['[%s] ' % ott,'

%s ' % (ott,ott,ott,ott)][GT('html_logs_enable')] + ['*** %s\n','%s

'][GT('html_logs_enable')] % [topics[room],html_escape(topics[room]).replace('\n','
')][GT('html_logs_enable')] diff --git a/plugins/main.py b/plugins/main.py index 1ca41f0..8b5ee34 100644 --- a/plugins/main.py +++ b/plugins/main.py @@ -1754,6 +1754,7 @@ config_groups = [config_group_mucfilter,config_group_mucfilter_newbie,config_gro # XXe - execute latest field by eval owner_prefs = {'syslogs_enable': ['Logger. Enable system logs','b',True], + 'movement_logs_enable':['Logger. Enable logging ins and outs of the conference','b',True], 'status_logs_enable':['Logger. Enable status change logging','b',True], 'aff_role_logs_enable':['Logger. Enable role and affiliation logging','b',True], 'html_logs_enable':['Logger. Html logs. Otherwize in text','b',True], @@ -1877,7 +1878,7 @@ owner_group_juick = ['Juick settings','#owner-juick', ['juick_user_post_limit','juick_user_post_size','juick_msg_answers_default','juick_user_tags_limit']] owner_group_logs = ['Logs settings','#owner-logs', - ['syslogs_enable','status_logs_enable','aff_role_logs_enable','html_logs_enable','html_logs_end_text','chatlogs_logs_gmt']] + ['syslogs_enable','status_logs_enable','aff_role_logs_enable','movement_logs_enable','html_logs_enable','html_logs_end_text','chatlogs_logs_gmt']] owner_group_youtube = ['Youtube settings','#owner-youtube', ['youtube_max_videos','youtube_default_videos','youtube_max_page_size','youtube_default_lang']] From bbd41e8fe11e15bd923531a9f3f626bb0103ef0d Mon Sep 17 00:00:00 2001 From: Atterratio Aeternus Date: Wed, 4 Nov 2015 12:41:34 +0300 Subject: [PATCH 2/2] fix: translation --- data/locales/ru.txt | 4 +++- plugins/main.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/data/locales/ru.txt b/data/locales/ru.txt index a2c8949..901a748 100644 --- a/data/locales/ru.txt +++ b/data/locales/ru.txt @@ -1744,6 +1744,7 @@ Troll. Delay between messages for troll command Troll. Задержка отпр Karma. Minimal karma for allow krama change for participants Karma. Минимальная карма при которой изменение кармы доступно не постоянным участникам Iq. Allow answer to service discovery Iq. Разрешение отвечать на запрос обзора сервисов Msgtoadmin. Time limit for next message for msgtoadmin Msgtoadmin. Лимит времени следующей посылки сообщения для команды msgtoadmin +Logger. Enable logins and logouts logging Logger. Запись в логи входов и выходов Muc-filter. A kind words count Muc-filter. Счётчик одинаковых слов Whereis. Frequency for answer check for whereis command Whereis. Частота проверки ответа для команды whereis Kernel. Bot status. Show different status for bot loading Kernel. Bot status. Особый статус при загрузке @@ -1858,5 +1859,6 @@ API settings Настройки API World of Tanks settings Настройки плагина World of Tanks # write locale file: ru.txt -# total: 1435 +# total: 1436 # regenarated without mistakes! + diff --git a/plugins/main.py b/plugins/main.py index 8b5ee34..f65300c 100644 --- a/plugins/main.py +++ b/plugins/main.py @@ -1754,7 +1754,7 @@ config_groups = [config_group_mucfilter,config_group_mucfilter_newbie,config_gro # XXe - execute latest field by eval owner_prefs = {'syslogs_enable': ['Logger. Enable system logs','b',True], - 'movement_logs_enable':['Logger. Enable logging ins and outs of the conference','b',True], + 'movement_logs_enable':['Logger. Enable logins and logouts logging','b',True], 'status_logs_enable':['Logger. Enable status change logging','b',True], 'aff_role_logs_enable':['Logger. Enable role and affiliation logging','b',True], 'html_logs_enable':['Logger. Html logs. Otherwize in text','b',True],