28
28
# from black import format_str, FileMode
29
29
30
30
HOME_PATH = Path ("compiler/api" )
31
- DESTINATION_PATH = Path ("pyrogram /raw" )
31
+ DESTINATION_PATH = Path ("pyrogramv2 /raw" )
32
32
NOTICE_PATH = "NOTICE"
33
33
34
34
SECTION_RE = re .compile (r"---(\w+)---" )
@@ -176,13 +176,13 @@ def get_docstring_arg_type(t: str):
176
176
else :
177
177
return f"``{ t .lower ()} ``"
178
178
elif t == "TLObject" or t == "X" :
179
- return "Any object from :obj:`~pyrogram .raw.types`"
179
+ return "Any object from :obj:`~pyrogramv2 .raw.types`"
180
180
elif t == "!X" :
181
- return "Any function from :obj:`~pyrogram .raw.functions`"
181
+ return "Any function from :obj:`~pyrogramv2 .raw.functions`"
182
182
elif t .lower ().startswith ("vector" ):
183
183
return "List of " + get_docstring_arg_type (t .split ("<" , 1 )[1 ][:- 1 ])
184
184
else :
185
- return f":obj:`{ t } <pyrogram .raw.base.{ t } >`"
185
+ return f":obj:`{ t } <pyrogramv2 .raw.base.{ t } >`"
186
186
187
187
188
188
def get_references (t : str , kind : str ):
@@ -336,7 +336,7 @@ def start(format: bool = False):
336
336
337
337
docstring += f"\n \n Constructors:\n " \
338
338
f" This base type has { constr_count } constructor{ 's' if constr_count > 1 else '' } available.\n \n " \
339
- f" .. currentmodule:: pyrogram .raw.types\n \n " \
339
+ f" .. currentmodule:: pyrogramv2 .raw.types\n \n " \
340
340
f" .. autosummary::\n " \
341
341
f" :nosignatures:\n \n " \
342
342
f" { items } "
@@ -346,7 +346,7 @@ def start(format: bool = False):
346
346
if references :
347
347
docstring += f"\n \n Functions:\n This object can be returned by " \
348
348
f"{ ref_count } function{ 's' if ref_count > 1 else '' } .\n \n " \
349
- f" .. currentmodule:: pyrogram .raw.functions\n \n " \
349
+ f" .. currentmodule:: pyrogramv2 .raw.functions\n \n " \
350
350
f" .. autosummary::\n " \
351
351
f" :nosignatures:\n \n " \
352
352
f" " + references
@@ -419,7 +419,7 @@ def start(format: bool = False):
419
419
constructor_docs = "Telegram API type."
420
420
421
421
docstring += constructor_docs + "\n "
422
- docstring += f"\n Constructor of :obj:`~pyrogram .raw.base.{ c .qualtype } `."
422
+ docstring += f"\n Constructor of :obj:`~pyrogramv2 .raw.base.{ c .qualtype } `."
423
423
else :
424
424
function_docs = docs ["method" ].get (c .qualname , None )
425
425
@@ -440,7 +440,7 @@ def start(format: bool = False):
440
440
if references :
441
441
docstring += f"\n Functions:\n This object can be returned by " \
442
442
f"{ count } function{ 's' if count > 1 else '' } .\n \n " \
443
- f" .. currentmodule:: pyrogram .raw.functions\n \n " \
443
+ f" .. currentmodule:: pyrogramv2 .raw.functions\n \n " \
444
444
f" .. autosummary::\n " \
445
445
f" :nosignatures:\n \n " \
446
446
f" " + references
@@ -630,23 +630,23 @@ def start(format: bool = False):
630
630
f .write ("objects = {" )
631
631
632
632
for c in combinators :
633
- f .write (f'\n { c .id } : "pyrogram .raw.{ c .section } .{ c .qualname } ",' )
633
+ f .write (f'\n { c .id } : "pyrogramv2 .raw.{ c .section } .{ c .qualname } ",' )
634
634
635
- f .write ('\n 0xbc799737: "pyrogram .raw.core.BoolFalse",' )
636
- f .write ('\n 0x997275b5: "pyrogram .raw.core.BoolTrue",' )
637
- f .write ('\n 0x1cb5c415: "pyrogram .raw.core.Vector",' )
638
- f .write ('\n 0x73f1f8dc: "pyrogram .raw.core.MsgContainer",' )
639
- f .write ('\n 0xae500895: "pyrogram .raw.core.FutureSalts",' )
640
- f .write ('\n 0x0949d9dc: "pyrogram .raw.core.FutureSalt",' )
641
- f .write ('\n 0x3072cfa1: "pyrogram .raw.core.GzipPacked",' )
642
- f .write ('\n 0x5bb8e511: "pyrogram .raw.core.Message",' )
635
+ f .write ('\n 0xbc799737: "pyrogramv2 .raw.core.BoolFalse",' )
636
+ f .write ('\n 0x997275b5: "pyrogramv2 .raw.core.BoolTrue",' )
637
+ f .write ('\n 0x1cb5c415: "pyrogramv2 .raw.core.Vector",' )
638
+ f .write ('\n 0x73f1f8dc: "pyrogramv2 .raw.core.MsgContainer",' )
639
+ f .write ('\n 0xae500895: "pyrogramv2 .raw.core.FutureSalts",' )
640
+ f .write ('\n 0x0949d9dc: "pyrogramv2 .raw.core.FutureSalt",' )
641
+ f .write ('\n 0x3072cfa1: "pyrogramv2 .raw.core.GzipPacked",' )
642
+ f .write ('\n 0x5bb8e511: "pyrogramv2 .raw.core.Message",' )
643
643
644
644
f .write ("\n }\n " )
645
645
646
646
647
647
if "__main__" == __name__ :
648
648
HOME_PATH = Path ("." )
649
- DESTINATION_PATH = Path ("../../pyrogram /raw" )
649
+ DESTINATION_PATH = Path ("../../pyrogramv2 /raw" )
650
650
NOTICE_PATH = Path ("../../NOTICE" )
651
651
652
652
start (format = False )
0 commit comments