From bb64a3864d4a202fbb8576f01613ef210568c627 Mon Sep 17 00:00:00 2001 From: diSabler Date: Sat, 10 May 2014 10:04:21 +0400 Subject: [PATCH] fix: nicknames in iq plugin; upd: icon in locale generator --- data/locales/ru.txt | 8 +++++-- data/locales/ua.txt | 4 ++-- dev-tools/locale_generator/icons/isida.png | Bin 635 -> 1261 bytes kernel.py | 2 +- plugins/iq.py | 24 +++++++++++++-------- 5 files changed, 24 insertions(+), 14 deletions(-) diff --git a/data/locales/ru.txt b/data/locales/ru.txt index d1ca519..ad43ec6 100644 --- a/data/locales/ru.txt +++ b/data/locales/ru.txt @@ -649,18 +649,22 @@ KB КБ users/all-hosts/total всего пользователей на всех хостах users/all-hosts/online онлайн пользователей на всех хостах users/total всего пользователей -Caps %s is %s У %s капс %s I can't get caps of %s Я не знаю капс %s %s has empty caps! У %s пустой капс! +Your caps is %s Твой капс: %s +Caps %s is %s У %s капс %s vCard: Визитка: Empty! Пусто! type %s, %s тип %s, %s +Your uptime: %s Твой аптайм: %s Uptime %s: %s Аптайм %s: %s I can't do it Не получается... Ping from you %s sec. Пинг от тебя %s сек. Ping from %s %s sec. Пинг от %s %s сек. +Your time is %s Твоё время: %s Time %s is %s У %s время %s Unknown server answer! Неизвестный ответ сервера! +Your version is %s Твоя версия: %s Version %s is %s У %s версия %s Unavailable! Недоступно! Server statistic: %s\n%s Статистика сервера: %s\n%s @@ -1840,5 +1844,5 @@ Youtube settings Настройки youtube API settings Настройки API # write locale file: ru.txt -# total: 1419 +# total: 1423 # regenarated without mistakes! diff --git a/data/locales/ua.txt b/data/locales/ua.txt index 2e7f1c0..86c9474 100644 --- a/data/locales/ua.txt +++ b/data/locales/ua.txt @@ -1836,5 +1836,5 @@ Youtube settings Налаштування Youtube API settings Налаштування API # write locale file: ua.txt -# total: 1419 -# missed translations: 4 +# total: 1423 +# missed translations: 8 diff --git a/dev-tools/locale_generator/icons/isida.png b/dev-tools/locale_generator/icons/isida.png index bc9d4c6c76c5e9ba0c8e485841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kvXXu0mjfn66Y9 literal 635 zcmV->0)+jEP)1}jl(mU`1DjVa%#IVqXapOW`VuGed(|8NIvI)^Dl2Bb#5Uto!f1*Mm zjX-HYev4KifRg^9725(&&wNAuib)rqWHRv0oaemfof(7wj83ORHk&1v%h7B$F<4uJ zR7$NJn$(q1-|GGDcFE`S1OfqSwVD7%M!+y&Yz!O@SXfZIs7k{942;ghxi|3ivjr@b zN<<~;+p7|^rLW~y<7p|)kRSl)oCWec#mxrxW)=_!z27#f1XK^Pu}nHh7_ z+1Ie!>uN{lxw6&5($W&qXq0$7j?s}1U6%{oZdhOcTjlsPJT4pne6s*bL8H;2)oO`? z-iCXbt|@sxk_|Ze1a2qcYZEHJthI8vjMwX>UaxDwBdKJc)r;G0-S3SkT$gb<1V=pZ zAgc?hs8*{?OiYkSBrsaL;F85tGrDJ$;46ubVqSU`PQH{=mf7|UPS3$_*{{xje0X2`;^JaIKvmCMJ~AuDU3w2nrHa)S zoS1I&Ar!*tbjtlp^#iViwcP#qBYw0GT+l56ote`LLIR1!V*P+uQt{@3WmexCkha`% zWu}T<3WWkbpO0d(r~&aGBJG8)cK)q~?EV9}`w6bj>+ec|-|shlFn;d9EjjB8?_jc^ zt54?PqWpKJ;c-b VnSZMNZe0KX002ovPDHLkV1hn0GNk|j diff --git a/kernel.py b/kernel.py index 6b594b9..175de96 100644 --- a/kernel.py +++ b/kernel.py @@ -1707,7 +1707,7 @@ if os.path.isdir(sm_f): else: smiles_dirs, smiles_dirs_case = [], [] logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG,) # включение логгирования -capsNode = 'http://isida-bot.com/4' +capsNode = 'http://v4.isida-bot.com' god = SuperAdmin.lower() pprint('-'*50,'blue') diff --git a/plugins/iq.py b/plugins/iq.py index 3512674..be1ab95 100644 --- a/plugins/iq.py +++ b/plugins/iq.py @@ -97,9 +97,11 @@ def get_caps(room,nick): def noiq_caps(type, jid, nick, text): text = [text,nick][text == ''] - msg = L('Caps %s is %s','%s/%s'%(jid,nick)) % (text,get_caps(jid,text)) - if not msg: msg = L('I can\'t get caps of %s','%s/%s'%(jid,nick)) % text - elif len(msg) == msg.count(' ')+msg.count('\n'): msg = L('%s has empty caps!','%s/%s'%(jid,nick)) % text + caps = get_caps(jid,text) + if not caps: msg = L('I can\'t get caps of %s','%s/%s'%(jid,nick)) % text + elif len(caps) == caps.count(' ') + caps.count('\n'): msg = L('%s has empty caps!','%s/%s'%(jid,nick)) % text + elif text == nick: msg = L('Your caps is %s','%s/%s'%(jid,nick)) % caps + else: msg = L('Caps %s is %s','%s/%s'%(jid,nick)) % (text,caps) send_msg(type, jid, nick, msg) def iq_vcard(type, jid, nick, text): @@ -171,7 +173,9 @@ def uptime_async(type, jid, nick, text, is_answ): if not text: text = nick isa = is_answ[1][0] try: - msg = L('Uptime %s: %s','%s/%s'%(jid,nick)) % (text,un_unix(int(get_tag_item(isa,'query','seconds')),'%s/%s'%(jid,nick))) + tstr = un_unix(int(get_tag_item(isa,'query','seconds')),'%s/%s'%(jid,nick)) + if text == nick: msg = L('Your uptime: %s','%s/%s'%(jid,nick)) % tstr + else: msg = L('Uptime %s: %s','%s/%s'%(jid,nick)) % (text,tstr) up_stat = esc_min(get_tag(isa,'query')) if len(up_stat): msg = '%s // %s' % (msg,up_stat) except: msg = L('I can\'t do it','%s/%s'%(jid,nick)) @@ -226,7 +230,8 @@ def time_async(type, jid, nick, text, mode, is_answ): msg = isa[0] if mode: msg += ', Raw time: %s, TimeZone: %s' % (isa[1],isa[2]) else: msg = ' '.join(isa) - msg = L('Time %s is %s','%s/%s'%(jid,nick)) % (text,msg) + if text == nick: msg = L('Your time is %s','%s/%s'%(jid,nick)) % msg + else: msg = L('Time %s is %s','%s/%s'%(jid,nick)) % (text,msg) send_msg(type, jid, nick, msg) def iq_utime(type, jid, nick, text): @@ -250,13 +255,13 @@ def utime_async(type, jid, nick, text, mode, is_answ): try: ttup = isa[0].replace('T','-').replace('Z','').replace(':','-').split('-')+['0','0',str(tuple(time.localtime())[8])] lt = time.localtime(time.mktime([int(tmp.split('.',1)[0]) for tmp in ttup])+(int(isa[1].split(':')[0])*60+int(isa[1].split(':')[1]))*60) - timeofset = float(isa[1].replace(':','.')) if timeofset < 0: t_gmt = 'GMT%s' % int(timeofset) else: t_gmt = 'GMT+%s' % int(timeofset) if timeofset%1: t_gmt += ':%02d' % int((timeofset%1*60/100) * 100) - - msg = L('Time %s is %s','%s/%s'%(jid,nick)) % (text,'%02d:%02d:%02d, %02d.%s\'%s, %s, %s' % (lt[3],lt[4],lt[5],lt[2],L(wmonth[lt[1]-1],'%s/%s'%(jid,nick)),lt[0],L(wday[lt[6]],'%s/%s'%(jid,nick)),t_gmt)) + tstr = '%02d:%02d:%02d, %02d.%s\'%s, %s, %s' % (lt[3],lt[4],lt[5],lt[2],L(wmonth[lt[1]-1],'%s/%s'%(jid,nick)),lt[0],L(wday[lt[6]],'%s/%s'%(jid,nick)),t_gmt) + if text in ['',nick]: msg = L('Your time is %s','%s/%s'%(jid,nick)) % tstr + else: msg = L('Time %s is %s','%s/%s'%(jid,nick)) % (text,tstr) if mode: msg = '%s | %s %s' % (msg,isa[0],isa[1]) except: msg = '%s %s' % (L('Unknown server answer!','%s/%s'%(jid,nick)),isa[0]) send_msg(type, jid, nick, msg) @@ -280,7 +285,8 @@ def version_async(type, jid, nick, text, with_caps, is_answ): if with_caps: caps = get_caps(jid,[text,nick][text == '']) if caps: msg += ' || %s' % caps - msg = L('Version %s is %s','%s/%s'%(jid,nick)) % (text,msg) + if text in ['',nick]: msg = L('Your version is %s','%s/%s'%(jid,nick)) % msg + else: msg = L('Version %s is %s','%s/%s'%(jid,nick)) % (text,msg) send_msg(type, jid, nick, msg) def iq_stats(type, jid, nick, text):