Skip to content

Commit feec1dd

Browse files
committed
fix: little style fixes
1 parent 54eba94 commit feec1dd

7 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎examples/deep_linking.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
# steps are not shown here. Only steps 5 to 7 are illustrated, some in pseudo-code, with this example.
3232

3333
import telebot
34-
import time
3534

3635
bot = telebot.TeleBot('TOKEN')
3736

‎examples/step_example.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"""
33
This Example will show you how to use register_next_step handler.
44
"""
5-
import time
65

76
import telebot
87
from telebot import types

‎telebot/__init__.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,14 +1294,14 @@ def _notify_next_handlers(self, new_messages):
12941294
was_poped = False
12951295
if chat_id in self.next_step_handlers.keys():
12961296
handlers = self.next_step_handlers.pop(chat_id, None)
1297-
if (handlers):
1297+
if handlers:
12981298
for handler in handlers:
12991299
self._exec_task(handler["callback"], message, *handler["args"], **handler["kwargs"])
13001300
new_messages.pop(i) # removing message that detects with next_step_handler
13011301
was_poped = True
13021302
if self.next_step_saver is not None:
13031303
self.next_step_saver.start_save_timer()
1304-
if (not was_poped):
1304+
if not was_poped:
13051305
i += 1
13061306

13071307

‎telebot/apihelper.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ def get_file(token, file_id):
9999

100100

101101
def get_file_url(token, file_id):
102-
method_url = r'getFile'
103102
return FILE_URL.format(token, get_file(token, file_id).file_path)
104103

105104

@@ -123,6 +122,8 @@ def send_message(token, chat_id, text, disable_web_page_preview=None, reply_to_m
123122
:param disable_web_page_preview:
124123
:param reply_to_message_id:
125124
:param reply_markup:
125+
:param parse_mode:
126+
:param disable_notification:
126127
:return:
127128
"""
128129
method_url = r'sendMessage'
@@ -769,7 +770,8 @@ def send_invoice(token, chat_id, title, description, invoice_payload, provider_t
769770
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
770771
:param reply_to_message_id: If the message is a reply, ID of the original message
771772
:param reply_markup: A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button
772-
:return:
773+
:param provider_data:
774+
:return:
773775
"""
774776
method_url = r'sendInvoice'
775777
payload = {'chat_id': chat_id, 'title': title, 'description': description, 'payload': invoice_payload,

‎telebot/util.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def extract_arguments(text):
243243
:param text: String to extract the arguments from a command
244244
:return: the arguments if `text` is a command (according to is_command), else None.
245245
"""
246-
regexp = re.compile("\/\w*(@\w*)*\s*([\s\S]*)",re.IGNORECASE)
246+
regexp = re.compile("/\w*(@\w*)*\s*([\s\S]*)",re.IGNORECASE)
247247
result = regexp.match(text)
248248
return result.group(2) if is_command(text) else None
249249

‎tests/test_telebot.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,8 @@ def test_edit_markup(self):
402402
new_msg = tb.edit_message_reply_markup(chat_id=CHAT_ID, message_id=ret_msg.message_id, reply_markup=markup)
403403
assert new_msg.message_id
404404

405-
def create_text_message(self, text):
405+
@staticmethod
406+
def create_text_message(text):
406407
params = {'text': text}
407408
chat = types.User(11, False, 'test')
408409
return types.Message(1, None, None, chat, 'text', params, "")

‎tests/test_types.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_json_Message_Sticker_without_thumb():
5959
json_string = r'{"message_id":98,"from":{"id":10734,"first_name":"Fd","last_name":"Wd","username":"dd","is_bot":true },"chat":{"id":10734,"first_name":"Fd","type":"private","last_name":"Wd","username":"dd"},"date":1435479551,"sticker":{"width":550,"height":368,"file_id":"BQADBQADNAIAAsYifgYdGJOa6bGAsQI","file_size":30320}}'
6060
msg = types.Message.de_json(json_string)
6161
assert msg.sticker.height == 368
62-
assert msg.sticker.thumb == None
62+
assert msg.sticker.thumb is None
6363
assert msg.content_type == 'sticker'
6464

6565

0 commit comments

Comments
 (0)