2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-31 06:16:06 +00:00

Make unknown errors with known error codes inherit from base categories

This commit is contained in:
Dan
2019-06-27 11:59:44 +02:00
parent 40bcd4e59d
commit fa1b66f914
2 changed files with 39 additions and 34 deletions

View File

@@ -81,6 +81,8 @@ def start():
sub_classes = []
f_all.write(" \"_\": \"{}\",\n".format(super_class))
for j, row in enumerate(reader):
if j == 0:
continue
@@ -90,13 +92,13 @@ def start():
if not row: # Row is empty (blank line)
continue
id, message = row
error_id, error_message = row
sub_class = caml(re.sub(r"_X", "_", id))
sub_class = caml(re.sub(r"_X", "_", error_id))
f_all.write(" \"{}\": \"{}\",\n".format(id, sub_class))
f_all.write(" \"{}\": \"{}\",\n".format(error_id, sub_class))
sub_classes.append((sub_class, id, message))
sub_classes.append((sub_class, error_id, error_message))
with open("{}/template/class.txt".format(HOME), "r", encoding="utf-8") as f_class_template:
class_template = f_class_template.read()