mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-28 00:56:19 +00:00
Keep namespaces in constructors names
This commit is contained in:
parent
a21dd9f131
commit
2f82e753d6
@ -65,13 +65,19 @@ def generate(source_path, base):
|
|||||||
if level:
|
if level:
|
||||||
full_path = base + "/" + full_path
|
full_path = base + "/" + full_path
|
||||||
|
|
||||||
|
namespace = path.split("/")[-1]
|
||||||
|
if namespace in ["base", "types", "functions"]:
|
||||||
|
namespace = ""
|
||||||
|
|
||||||
|
full_name = f"{(namespace + '.') if namespace else ''}{name}"
|
||||||
|
|
||||||
os.makedirs(os.path.dirname(DESTINATION + "/" + full_path), exist_ok=True)
|
os.makedirs(os.path.dirname(DESTINATION + "/" + full_path), exist_ok=True)
|
||||||
|
|
||||||
with open(DESTINATION + "/" + full_path, "w", encoding="utf-8") as f:
|
with open(DESTINATION + "/" + full_path, "w", encoding="utf-8") as f:
|
||||||
f.write(
|
f.write(
|
||||||
page_template.format(
|
page_template.format(
|
||||||
title=name,
|
title=full_name,
|
||||||
title_markup="=" * len(name),
|
title_markup="=" * len(full_name),
|
||||||
full_class_path="pyrogram.raw.{}".format(
|
full_class_path="pyrogram.raw.{}".format(
|
||||||
".".join(full_path.split("/")[:-1]) + "." + name
|
".".join(full_path.split("/")[:-1]) + "." + name
|
||||||
)
|
)
|
||||||
@ -90,7 +96,7 @@ def generate(source_path, base):
|
|||||||
entities = []
|
entities = []
|
||||||
|
|
||||||
for i in v:
|
for i in v:
|
||||||
entities.append(snek(i).replace("_", "-"))
|
entities.append(f'{i} <{snek(i).replace("_", "-")}>')
|
||||||
|
|
||||||
if k != base:
|
if k != base:
|
||||||
inner_path = base + "/" + k + "/index" + ".rst"
|
inner_path = base + "/" + k + "/index" + ".rst"
|
||||||
|
Loading…
Reference in New Issue
Block a user