Commit Graph

134 Commits

Author SHA1 Message Date
Lonami Exo
f31ca142a3 Support autocast to InputMessage 2018-04-23 11:05:38 +02:00
Lonami Exo
6328e032e4 Fix local URLs on the generated docs 2018-04-15 14:59:07 +02:00
Lonami Exo
3ed81481f8 Enhance setup.py gen command 2018-04-15 13:19:25 +02:00
Lonami Exo
6058b80877 Further clean-up of the documentation generator 2018-04-15 12:15:43 +02:00
Lonami Exo
5b5edff624 Remove special case from documentation's formatter 2018-04-15 11:54:34 +02:00
Lonami Exo
b88a2ef208 Reuse more code to get class names 2018-04-15 11:47:33 +02:00
Lonami Exo
c18971da54 Add a new section in the docs listing known RPC errors 2018-04-15 11:18:26 +02:00
Lonami Exo
d0fb371515 Fix some documentation methods misusing relative paths 2018-04-15 10:59:04 +02:00
Lonami Exo
d924f97b58 Fix relative paths when generating documentation 2018-04-15 10:47:55 +02:00
Lonami Exo
1f8316c0bb Fix import errors for the documentation generator 2018-04-14 21:15:58 +02:00
Lonami Exo
daebf5b7e8 Move docs generator into the telethon_generator package 2018-04-14 20:35:05 +02:00
Lonami Exo
3b7c4fe278 Further TLObject generator clean-up
Split everything into several functions, reused some more
common code (like accessing the "real" arguments instead
constantly filtering) and more, like using classmethods
instead staticmethods and then hardcoding the class name.
2018-04-14 20:28:25 +02:00
Lonami Exo
748f2db23d Fix wrong camel case for all names 2018-04-14 19:04:07 +02:00
Lonami Exo
70f5af44de Move data to its own subdirectory 2018-04-14 18:20:29 +02:00
Lonami Exo
0af4699994 Move tl_generator to generators/ and remove the class 2018-04-14 18:17:59 +02:00
Lonami Exo
200d3c0360 Clean-up unused methods and reuse more common utils 2018-04-14 17:22:39 +02:00
Lonami Exo
ab15f3699f Clean-up the TLObject class/parser from redundant comments 2018-04-14 16:05:09 +02:00
Lonami Exo
fc1bc05ca1 Move tlobject and source_builder into their correct folders 2018-04-14 15:16:13 +02:00
Lonami Exo
463fcedf27 Split error_generator code into parsers/generators packages 2018-04-14 13:56:39 +02:00
Lonami Exo
8b2afa3530 Separate error fetching from generation 2018-04-14 13:21:27 +02:00
Lonami Exo
cb226e7f45 Revisit telethon_generator (closes #724) 2018-04-01 12:46:44 +02:00
Lonami Exo
7bc021bba4 Update to layer 75 (again) 2018-03-30 20:28:07 +02:00
Lonami Exo
500792975e Handle AUTH_KEY_DUPLICATED on connection 2018-03-30 12:18:18 +02:00
Tulir Asokan
935de0afbb Add Python type hints to attributes of TL types (#678) 2018-03-12 10:58:56 +01:00
Lonami Exo
2e31a686e8 Upgrade to layer 75
Captions are now "messages" and also support message entities.
2018-03-02 21:28:33 +01:00
Lonami Exo
39621ceae9 Use req_pq_multi instead req_pq when creating an auth_key 2018-02-19 20:31:47 +01:00
Dmitry D. Chernov
55bcc29ae0 Errors: Fix passing 'self' to the constructors of the superclasses
This is necessary only if the superclass name is specified explicitly instead of super() call.
2018-02-14 17:09:22 +10:00
Lonami Exo
7286f77008 Sort keys and use Mozilla agent on error generator, update file 2018-01-28 14:02:42 +01:00
Lonami Exo
2873dcf1c6 Add '_' key to TLObject's .to_dict() and remove recursive param
Closes #559
2018-01-25 09:44:07 +01:00
Lonami Exo
0e43022959 Remove redundant import, show type instead TLObject on docstring 2018-01-19 13:40:04 +01:00
Lonami Exo
33e50aaee1 Reuse .on_response/.__str__/.stringify, override iff necessary 2018-01-19 12:12:52 +01:00
Lonami Exo
1c9fa76ede Add new method to .resolve() parameters instead on init
TLObject's __init__ used to call utils.get_input_* methods and
similar to auto-cast things like User into InputPeerUser as
required. Now there's a custom .resolve() method for this purpose
with several advantages:
- Old behaviour still works, autocasts work like usual.

- A request can be constructed and later modified, before the
  autocast only occured on the constructor but now while invoking.

- This allows us to not only use the utils module but also the
  client, so it's even possible to use usernames or phone numbers
  for things that require an InputPeer. This actually assumes
  the TelegramClient subclass is being used and not the bare version
  which would fail when calling .get_input_peer().
2018-01-19 11:47:45 +01:00
Lonami Exo
eaef392a9b Add and except missing FLOOD_TEST_PHONE_WAIT_X error 2018-01-10 17:34:34 +01:00
Lonami Exo
6eef6f5d23 Update to layer 74 2018-01-02 00:02:31 +01:00
Lonami Exo
3537e9bcc9 Support more types to represent a date 2017-12-28 12:32:16 +01:00
Lonami Exo
b11c2e885b Fix assertion for multiple same flag parameters 2017-12-25 18:00:24 +01:00
Lonami Exo
9c66f0b2b4 Fix empty strings not working as expected for flag parameters 2017-12-24 15:15:19 +01:00
Lonami Exo
d515ede7da Fix TLParser not stripping inline comments 2017-11-30 13:34:55 +01:00
Lonami Exo
a1c669333e Update scheme to layer 73 2017-11-15 12:22:37 +01:00
Lonami Exo
d59b17c6fc Clear up confusing error and trailing brace (closes #429) 2017-11-14 09:48:40 +01:00
Lonami Exo
e8248b4b8b Remove now unused Emoji ranges generator 2017-11-06 09:37:07 +01:00
Lonami Exo
1e35c1cfed Update to layer 72 2017-11-04 13:40:43 +01:00
Lonami Exo
f5fafc6a27 Enhance emoji detection 2017-10-29 16:41:30 +01:00
Lonami Exo
2f28050cac Fix generated __bytes__ failing with flag indicator but no flags
Likely since the code was ported to get rid of the BinaryWriter,
since the flag calculation was inlined. Some types (only
channelMessages as of layer 71) had a flag indicator but no flag
arguments, so the calculation of which were not None failed.

This special case is now handled correctly.
2017-10-28 11:09:55 +02:00
Andrei Fokau
e6ac61c1b9 Add missing __init__.py to telethon_generator package (#382) 2017-10-25 19:48:46 +02:00
Lonami Exo
e427559d4c Fix username invalid error having wrong username regex 2017-10-25 12:22:38 +02:00
Lonami Exo
b3ca68b7d9 Avoid cyclic imports caused by #348 (fix #357) 2017-10-24 10:07:31 +02:00
Lonami Exo
5f0faee013 Attempt at fixing redundant import from ee01724 (#357) 2017-10-22 11:12:42 +02:00
Joscha Götzer
9937d58a2d Remove f-strings from codegen to support py <3.6 (#366) 2017-10-21 00:43:26 +02:00
Lonami Exo
be9358282a Generate and fetch new errors from setup.py 2017-10-20 17:29:45 +02:00