mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
Run setup.py gen_tl when installing (may fix #271)
This commit is contained in:
parent
7838f8561b
commit
c134d9ba27
17
setup.py
17
setup.py
|
@ -42,8 +42,7 @@ class TempWorkDir:
|
|||
os.chdir(self.original)
|
||||
|
||||
|
||||
def main():
|
||||
if len(argv) >= 2 and argv[1] == 'gen_tl':
|
||||
def gen_tl():
|
||||
from telethon_generator.tl_generator import TLGenerator
|
||||
generator = TLGenerator('telethon/tl')
|
||||
if generator.tlobjects_exist():
|
||||
|
@ -56,6 +55,11 @@ def main():
|
|||
)
|
||||
print('Done.')
|
||||
|
||||
|
||||
def main():
|
||||
if len(argv) >= 2 and argv[1] == 'gen_tl':
|
||||
gen_tl()
|
||||
|
||||
elif len(argv) >= 2 and argv[1] == 'clean_tl':
|
||||
from telethon_generator.tl_generator import TLGenerator
|
||||
print('Cleaning...')
|
||||
|
@ -78,8 +82,11 @@ def main():
|
|||
|
||||
else:
|
||||
if not TelegramClient:
|
||||
print('Run `python3', argv[0], 'gen_tl` first.')
|
||||
quit()
|
||||
gen_tl()
|
||||
from telethon import TelegramClient as TgClient
|
||||
version = TgClient.__version__
|
||||
else:
|
||||
version = TelegramClient.__version__
|
||||
|
||||
# Get the long description from the README file
|
||||
with open('README.rst', encoding='utf-8') as f:
|
||||
|
@ -89,7 +96,7 @@ def main():
|
|||
name='Telethon',
|
||||
|
||||
# Versions should comply with PEP440.
|
||||
version=TelegramClient.__version__,
|
||||
version=version,
|
||||
description="Full-featured Telegram client library for Python 3",
|
||||
long_description=long_description,
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user