Fix setup.py for source distributions

This commit is contained in:
Lonami Exo 2017-07-04 11:02:32 +02:00
parent 127e5f70d8
commit 3585fb8cc6

View File

@ -18,7 +18,6 @@ from os import path
# Always prefer setuptools over distutils
from setuptools import find_packages, setup
from telethon_generator.tl_generator import TLGenerator
try:
from telethon import TelegramClient
except ImportError:
@ -27,6 +26,7 @@ except ImportError:
if __name__ == '__main__':
if len(argv) >= 2 and argv[1] == 'gen_tl':
from telethon_generator.tl_generator import TLGenerator
generator = TLGenerator('telethon/tl')
if generator.tlobjects_exist():
print('Detected previous TLObjects. Cleaning...')
@ -39,6 +39,7 @@ if __name__ == '__main__':
print('Done.')
elif len(argv) >= 2 and argv[1] == 'clean_tl':
from telethon_generator.tl_generator import TLGenerator
print('Cleaning...')
TLGenerator('telethon/tl').clean_tlobjects()
print('Done.')