Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/alkorgun/blacksmith-2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Korgun <alkorgun@gmail.com>2013-07-21 00:26:55 +0400
committerAl Korgun <alkorgun@gmail.com>2013-07-21 00:26:55 +0400
commitb3306ccf9d026db030c822aeb6f33ebf4cefcdef (patch)
tree6bbcab49db35a2e9de6ebb9a43af53d01e28661c
parent61c88ec046e8d640dfdafa5ff2a28def871404b1 (diff)
expansion "config" fixed
-rw-r--r--expansions/allweb/code.py22
-rw-r--r--expansions/config/code.py12
-rw-r--r--expansions/session_stats/insc.py2
-rw-r--r--expansions/wtf/insc.py20
4 files changed, 25 insertions, 31 deletions
diff --git a/expansions/allweb/code.py b/expansions/allweb/code.py
index 9959fab..4dd0d2e 100644
--- a/expansions/allweb/code.py
+++ b/expansions/allweb/code.py
@@ -1,8 +1,8 @@
# coding: utf-8
# BlackSmith mark.2
-# exp_name = "allweb" # /code.py v.x25
-# Id: 25~25c
+# exp_name = "allweb" # /code.py v.x26
+# Id: 25~26c
# Code © (2011-2013) by WitcherGeralt [alkorgun@gmail.com]
class expansion_temp(expansion):
@@ -18,6 +18,8 @@ class expansion_temp(expansion):
UserAgent_Moz = (UserAgent[0], "Mozilla/5.0 (Windows NT 6.1; WOW64; {0}) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1".format(UserAgents.get(DefLANG, "en-US")))
+ Web.Opener.addheaders = [UserAgent_Moz]
+
edefs = dict()
for Name, Numb in htmlentitydefs.name2codepoint.iteritems():
@@ -25,21 +27,13 @@ class expansion_temp(expansion):
del Name, Numb
- Web.Opener.addheaders = [UserAgent_Moz]
+ edefs["&apos;"] = unichr(39)
- REP_desc = {
+ TagsDesc = {
"<br>": chr(10),
"<br />": chr(10)
}
- XML_ls = [
- ("&lt;", "<"),
- ("&gt;", ">"),
- ("&quot;", '"'),
- ("&apos;", "'"),
- ("&amp;", "&")
- ]
-
compile_st = compile__("<[^<>]+?>")
compile_ehtmls = compile__("&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));")
@@ -67,7 +61,7 @@ class expansion_temp(expansion):
return data
def decodeHTML(self, data):
- data = sub_desc(data, self.REP_desc)
+ data = sub_desc(data, self.TagsDesc)
data = self.compile_st.sub("", data)
data = self.sub_ehtmls(data)
return data.strip()
@@ -876,7 +870,7 @@ class expansion_temp(expansion):
Numb, Name, Quote = data.groups()
lt = chr(10)*3
answer = self.decodeHTML("Quote: #%s | by %s\n%s" % (Numb, Name, Quote))
- while answer.count(lt):
+ while (lt in answer):
answer = answer.replace(lt, lt[:2])
else:
answer = self.AnsBase[1]
diff --git a/expansions/config/code.py b/expansions/config/code.py
index e76c4f3..496a3fa 100644
--- a/expansions/config/code.py
+++ b/expansions/config/code.py
@@ -1,8 +1,8 @@
# coding: utf-8
# BlackSmith mark.2
-# exp_name = "config" # /code.py v.x6
-# Id: 19~5c
+# exp_name = "config" # /code.py v.x7
+# Id: 19~6c
# Code © (2011-2013) by WitcherGeralt [alkorgun@gmail.com]
class expansion_temp(expansion):
@@ -131,7 +131,7 @@ class expansion_temp(expansion):
else:
answer = self.AnsBase[7]
else:
- answer = self.AnsBase[11]
+ answer = self.AnsBase[11] % (Name)
elif body in ("add", "добавить".decode("utf-8")):
if len(args) >= 3:
host = (args.pop(0)).lower()
@@ -193,16 +193,16 @@ class expansion_temp(expansion):
for x in xrange(24):
code += choice(symbols)
if locals().has_key("changed"):
- self.answer_register(disp, xmpp.Iq(Types[8]), stype, source, code, disp)
+ self.answer_register(Name, xmpp.Iq(Types[8]), stype, source, code, disp)
elif online(Name):
Disp = Clients[Name]
iq = xmpp.Iq(Types[9] , xmpp.NS_REGISTER, to = Disp.Server, payload = [xmpp.Node("username", payload = [Disp.User]), xmpp.Node("password", payload = [code])])
Info["outiq"].plus()
CallForResponse(Disp, iq, self.answer_register, {"stype": stype, "source": source, "code": code, "str_disp": get_disp(disp)})
else:
- answer = self.AnsBase[12]
+ answer = self.AnsBase[12] % (Name)
else:
- answer = self.AnsBase[11]
+ answer = self.AnsBase[11] % (Name)
else:
answer = AnsBase[2]
else:
diff --git a/expansions/session_stats/insc.py b/expansions/session_stats/insc.py
index 1825137..ef433f8 100644
--- a/expansions/session_stats/insc.py
+++ b/expansions/session_stats/insc.py
@@ -13,7 +13,7 @@ if DefLANG in ("RU", "UA"):
"\n# Зафиксировано %d пользователей", # 8
"", # 9
"\n# Произошло %d ошибок и %s Dispatch-Errors", # 10
- "\n# Записей crash логов %s", # 11
+ "\n# Записей crash-логов %s", # 11
"\n# Создано %s тредов, %d из них активно", # 12
"\n# Потрачено %.2f секунд процессора", # 13
"\n# Потрачено %s мегабайт оперативной памяти", # 14
diff --git a/expansions/wtf/insc.py b/expansions/wtf/insc.py
index 8c8c750..690dc48 100644
--- a/expansions/wtf/insc.py
+++ b/expansions/wtf/insc.py
@@ -2,30 +2,30 @@
if DefLANG in ("RU", "UA"):
AnsBase_temp = tuple([line.decode("utf-8") for line in (
- "Всего %d определений в глобальной базе:\n%s", # 0
- "Всего %d определений в базе %s:\n%s", # 1
+ "Всего %d определени(я)й в глобальной базе:\n%s", # 0
+ "Всего %d определени(я)й в базе %s:\n%s", # 1
"Базы пусты.", # 2
- "%s - %d соответствий.", # 3
+ "%s - %d соответстви(я)й.", # 3
"Нет соответсвий в базах.", # 4
"\->\n%s:\n\t%s\n\nDefined by %s (on %s)", # 5
"Определения «%s» в базе нет.", # 6
- "Всего %d определений в глобальной базе.", # 7
- "Всего %d определений в базе %s.", # 8
+ "Всего %d определени(я)й в глобальной базе.", # 7
+ "Всего %d определени(я)й в базе %s.", # 8
"Определение «%s» уже есть в глобальной базе.", # 9
"Не существует локальной базы для ростера.", # 10
"\->\n" # -1
)])
else:
AnsBase_temp = (
- "There are %d definitions in global base:\n%s", # 0
- "There are %d definitions in the base of %s:\n%s", # 1
+ "There are %d definition(s) in global base:\n%s", # 0
+ "There are %d definition(s) in the base of %s:\n%s", # 1
"The bases are empty.", # 2
- "%s - %d hits.", # 3
+ "%s - %d hit(s).", # 3
"No hits in the bases.", # 4
"\->\n%s:\n\t%s\n\nDefined by %s (on %s)", # 5
"There is no '%s' in the base.", # 6
- "There are %d definitions in the global base.", # 7
- "There are %d definitions in the base of %s.", # 8
+ "There are %d definition(s) in the global base.", # 7
+ "There are %d definition(s) in the base of %s.", # 8
"'%s' is already in the global base.", # 9
"There is no local base for the roster.", # 10
"\->\n" # -1