Commit graph

191 commits

Author SHA1 Message Date
Noam Meltzer
3608c2bbe5 dispatcher: if connection pool is already initialized raise exception
this will better protect the user from wrong usage
2016-06-01 22:30:34 +03:00
Jannes Höke
6b457bada5 use keepalive for connection pool 2016-05-31 13:45:43 +02:00
Jannes Höke
74283bd414 use HTTPSConnectionPool instead of PoolManager 2016-05-30 17:12:50 +02:00
Jannes Höke
dd91ce1f39 use single queue for thread pool, initialize connection pool with n+3 2016-05-30 13:09:23 +02:00
Noam Meltzer
574fc8cddf urllib3: validate https certificate 2016-05-30 01:05:19 +03:00
Noam Meltzer
3076dfc086 use urllib3 instead of urllib(2) 2016-05-30 01:05:19 +03:00
Rahiel Kasim
f31bd91673 Merge pull request #305 from python-telegram-bot/move-botan
move botan from utils to contrib
2016-05-28 21:32:07 +02:00
Rahiel Kasim
c8497424b7 move botan to contrib 2016-05-28 09:12:10 +02:00
Leandro Toledo
9a13de4a96 Merge remote-tracking branch 'origin/master' into bot2.1
Conflicts:
	telegram/bot.py
	tests/test_bot.py
2016-05-26 16:15:50 -03:00
Noam Meltzer
561f1c3f02 bot: validate token does not contain white spaces (#306)
in addition move validation code from validate.py into bot.py and delete
the former file
2016-05-26 22:09:14 +03:00
Leandro Toledo
3907e64966 Adds telegram.utils.botan back using deprecate 2016-05-26 14:13:27 -03:00
Leandro Toledo
1e398821a0 Introducing telegram.error.BadRequest and testLeaveChat testcase #302 2016-05-25 21:15:17 -03:00
Rahiel Kasim
c4d5eff9f3 move botan from utils to ext 2016-05-24 23:40:09 +02:00
Leandro Toledo
d445d35ceb Running yapf for codebase #259 2016-05-14 22:46:40 -03:00
Rahiel Kasim
5971cb35f8 fix merge conflict snakes with master 2016-04-30 14:56:48 +02:00
Rahiel Kasim
9d367e9f2c telegram.utils.deprecate: helper module to facilitate deprecation 2016-04-28 14:24:12 +02:00
Noam Meltzer
0c74b3cfb9 bot.py + request.py: network_delay is unique for getUpdates 2016-04-28 01:41:32 +03:00
Noam Meltzer
0ca3ef7a38 utils.request: clean imports using feature.moves 2016-04-28 01:41:32 +03:00
Noam Meltzer
02243f6fda utils.validater: remove dead code 2016-04-26 17:47:37 +03:00
Jannes Höke
cfdfdeb4fc Merge branch 'bot-api-2.0' into dispatcher-rework 2016-04-21 17:20:05 +02:00
Leandro Toledo
ba7e1cada7 Bot class refactor and its docstrings #232 2016-04-21 08:15:38 -03:00
Jannes Höke
48eb623f15 Merge branch 'bot-api-2.0' into dispatcher-rework 2016-04-19 01:24:02 +02:00
Leandro Toledo
9a340d2ea9 Endorsing if empty or 0 or empty string and minor typo fix #232 2016-04-18 20:18:32 -03:00
Jannes Höke
ad211655ea Merge branch 'master' into dispatcher-rework
Conflicts:
	README.rst
2016-04-17 12:45:31 +02:00
Noam Meltzer
ecc86d4bcd request: catch socket.error
socket.error is another exception which is thrown by the underlying
infrastacture and not handled by the urllib2 or httplib layers

fixes #236
2016-04-16 19:09:45 +03:00
Jannes Höke
1e19084a0d initial commit for dispatcher rework. deleted updatequeue.py as it is not needed. added handler base class, messagehandler, commandhandler, regexhandler. adjusted dispatcher for new system 2016-04-14 23:57:40 +02:00
Rahiel Kasim
01b90e7ede small improvements 2016-04-02 23:13:49 +02:00
Jannes Höke
45a47d54bd move updatequeue to telegram.utils 2016-03-22 02:42:19 +01:00
Leandro Toledo
1e4ae6546f Changing INFO logs to DEBUG and minor fixes 2016-03-14 22:56:20 -03:00
Jannes Höke
cd42524fd4 Merge pull request #174 from python-telegram-bot/inlinebots
Implement Inlinebots
2016-02-28 02:10:21 +01:00
Jannes Höke
4aca4d1d1f Merge pull request #187 from python-telegram-bot/flaky-tests
Flaky tests
2016-02-28 01:02:11 +01:00
Noam Meltzer
ccb24d1288 request.py: fix for python2.7 2016-02-27 23:13:29 +02:00
Noam Meltzer
fc618274ae bot.py: allow specifying timeout for sendVideo operations 2016-02-27 23:00:33 +02:00
Jannes Höke
efd10507d0 remove kwargs in favor of named keyword arguments, validate argument types 2016-02-21 11:33:34 +01:00
Noam Meltzer
2338377eda request: better parsing of URLError exception 2016-02-20 15:20:00 +02:00
Noam Meltzer
4945d99de6 webhookhandler: better handling of invalid POST data 2016-02-19 18:00:57 +02:00
Rahiel Kasim
d02e656700 raise NetworkError for HTTP 502 (Bad Gateway) 2016-02-09 15:26:59 +01:00
Jannes Höke
bec81b5c3b Merge pull request #161 from tsnoam/master
better exception handling
2016-02-07 22:34:49 +01:00
Jannes Höke
eac3d8842d remove json import 2016-02-07 15:09:41 +01:00
Jannes Höke
17ac73c3c4 fix message to json 2016-02-07 14:46:36 +01:00
Noam Meltzer
7ebbc60694 Unauthorized is HTTP code 401
I am not certain where the older 403 came from, but for now going to
leave it as is
2016-02-07 00:56:30 +02:00
Noam Meltzer
d4beb94059 Add specific exceptions types for important errors
maintain backward compatibility with the 'old' exception by inherting
from TelegramError and using the same message
2016-02-06 18:48:55 +02:00
Noam Meltzer
2859a8873f utils.request: catch URLError in _try_except_req decorator 2016-02-06 18:48:55 +02:00
Oleg Shlyazhko
c3bca9af48 remove checking for non 200 http codes, exceptions already handle it 2016-01-24 18:28:27 +03:00
Oleg Shlyazhko
9eec34edd1 pep8 fix 2016-01-23 20:13:48 +03:00
Oleg Shlyazhko
383a2d3742 fix httperror error output 2016-01-23 20:03:29 +03:00
Oleg Shlyazhko
d1e4eeaf30 fix urlopen data format 2016-01-23 19:49:55 +03:00
Oleg Shlyazhko
80b53f1ab7 fix urlopen call 2016-01-23 19:44:40 +03:00
Oleg Shlyazhko
0faa38b8af fix httperror logging 2016-01-23 19:29:01 +03:00
Oleg Shlyazhko
7508c2f8bf add detailed comment in class and src key to tracking url 2016-01-23 16:59:53 +03:00
Oleg Shlyazhko
2c12bd6775 replace print with logging 2016-01-23 16:58:01 +03:00
Oleg Shlyazhko
5b05bcc8f2 add http error exception handling 2016-01-23 15:21:13 +03:00
Oleg Shlyazhko
adb446abf6 fix pep8 styling 2016-01-23 15:14:17 +03:00
Oleg Shlyazhko
17c2857622 add module for botan analytics 2016-01-23 14:24:34 +03:00
Noam Meltzer
dc032b349c _try_except_req(): catch httplib.HTTPException
fixes #153
2016-01-19 22:02:34 +02:00
Jannes Höke
aa8966832b release 3.2 and update copyright notice to 2015-2016 2016-01-05 14:12:03 +01:00
Noam Meltzer
bc2679f2ae utils.request: provide HTTP error code with unknown errors 2016-01-04 00:32:17 +02:00
Noam Meltzer
21fdaa4ff7 utils.request: decorate functions with general try... except...
refs #134
2016-01-04 00:31:40 +02:00
Noam Meltzer
79f29c4b9e properly handle utf-8 server response & identify json parsing errors
refs #134
2016-01-04 00:31:40 +02:00
Jannes Höke
ea7c54ba07 Release v3.1.1, change author email everywhere 2015-12-21 21:18:53 +01:00
Jannes Höke
f49f592f0d log warning 2015-11-24 19:33:03 +01:00
Jannes Höke
c2853fa1ef WebhookServer: Lock serve_forever() and shutdown() 2015-11-24 15:39:00 +01:00
Jannes Höke
fca8aee177 improve logging 2015-11-21 23:09:19 +01:00
Jannes Höke
7c9928c58f Let shutdown return immediately if server is not running 2015-11-21 21:22:11 +01:00
Jannes Höke
ee8b78aa0d pep8 and docs 2015-11-16 20:43:35 +01:00
Jannes Höke
0b8fd24771 fixed issues with python2 2015-11-16 20:35:27 +01:00
Jannes Höke
396dc6cd3c Implement webhook listener server 2015-11-16 13:05:57 +01:00
Jannes Höke
10451509f1 fix for issue #79 2015-11-12 19:15:39 +01:00
Jannes Höke
0b4c23f50e improve error handling on timeouts 2015-11-11 14:06:10 +01:00
Jannes Höke
93afd3eabe remove check for network_delay 2015-11-10 23:12:20 +01:00
Jannes Höke
61dac76bee don't send network_delay to telegram servers 2015-11-10 22:40:19 +01:00
Jannes Höke
4bc03ed56a Add parameter network_delay for slow connections and increase default to 2 seconds 2015-11-10 19:47:21 +01:00
Leandro Toledo
6c13762c93 Fixes PEP8 and Lint minor issues 2015-11-10 12:10:50 -02:00
Jannes Höke
cd5e805692 added documentation 2015-11-10 05:16:16 +01:00
Rahiel Kasim
dcb9129809 raise exception if telegram times out on long-polling 2015-11-02 20:30:37 +01:00
Leandro Toledo
6c9490f2c6 Handles HTTP Bad Gateway error (503) on request module #63 2015-09-24 09:17:50 -03:00
Leandro Toledo
a1f35355f6 Keep bleeding edge features on testing branch 2015-09-20 12:43:32 -03:00
Leandro Toledo
b79530b10c Adding File and its tests 2015-09-20 12:28:10 -03:00
Leandro Toledo
f623db06ea Revert "Feature/requests" 2015-09-16 00:21:45 -03:00
pecheny
d5a9c185f0 use requests instead of urllib if possible; add timeout and decorator to get and post 2015-09-14 19:13:22 +03:00
Leandro Toledo
eb557e0eba Keeping features under development off this release 2015-09-10 20:37:25 -03:00
Leandro Toledo
a7ac4193fe PEP8, lint and TelegramError class refactor 2015-09-10 20:08:24 -03:00
leandrotoledo
009862593b Fix Py3 2015-09-09 09:34:45 -03:00
leandrotoledo
e2fa052f54 Send JSON requests over urlencoded post data 2015-09-09 09:29:23 -03:00
leandrotoledo
e1edeb7bec Improve design of this class 2015-09-07 15:54:12 -03:00
leandrotoledo
c590d9c2fd Moving _requestURL method to utils package 2015-09-05 11:56:06 -03:00
leandrotoledo
30749c3b66 Merging testing 2015-09-04 23:21:31 -03:00
leandrotoledo
f355af1d2b Restoring new features after rebase 2015-09-04 19:11:31 -03:00
leandrotoledo
245238b3a2 Keep off some features still in progress 2015-09-04 18:03:04 -03:00
leandrotoledo
fdb5f2339c Improving the design of existing Telegram classes and adding docstrings 2015-08-21 23:15:29 -03:00
leandrotoledo
1d6e9502cb Adding botan.io support 2015-08-20 21:07:49 -03:00