Remove \ from base code #259

This commit is contained in:
Leandro Toledo 2016-05-14 23:26:56 -03:00
parent d445d35ceb
commit 49122d6a99
26 changed files with 52 additions and 77 deletions

View file

@ -2,6 +2,7 @@
sha: 'v0.7.1'
hooks:
- id: yapf
args: ['-i']
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: 'v0.5.0'
@ -13,4 +14,4 @@
sha: 'v1.5.5'
hooks:
- id: pylint
args: ['--errors-only', '--disable=no-name-in-module,import-error', 'telegram']
args: ['--errors-only', '--disable=no-name-in-module,import-error', 'telegram']

View file

@ -22,8 +22,8 @@
import logging
import functools
from telegram import User, Message, Update, UserProfilePhotos, File, \
ReplyMarkup, TelegramObject, NullHandler
from telegram import (User, Message, Update, UserProfilePhotos, File, ReplyMarkup, TelegramObject,
NullHandler)
from telegram.utils import request
from telegram.utils.validate import validate_token
@ -120,12 +120,10 @@ class Bot(TelegramObject):
url, data = func(self, *args, **kwargs)
if kwargs.get('reply_to_message_id'):
data['reply_to_message_id'] = \
kwargs.get('reply_to_message_id')
data['reply_to_message_id'] = kwargs.get('reply_to_message_id')
if kwargs.get('disable_notification'):
data['disable_notification'] = \
kwargs.get('disable_notification')
data['disable_notification'] = kwargs.get('disable_notification')
if kwargs.get('reply_markup'):
reply_markup = kwargs.get('reply_markup')

View file

@ -1,6 +1,6 @@
#!/usr/bin/env python
# flake8: noqa
# pylint: disable=C0103,C0301,R0903
# pylint: disable=C0103,R0903
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
@ -162,26 +162,26 @@ class Emoji(object):
SQUARED_SOS = n(b'\xF0\x9F\x86\x98')
SQUARED_UP_WITH_EXCLAMATION_MARK = n(b'\xF0\x9F\x86\x99')
SQUARED_VS = n(b'\xF0\x9F\x86\x9A')
REGIONAL_INDICATOR_SYMBOL_LETTER_D_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_E \
= n(b'\xF0\x9F\x87\xA9\xF0\x9F\x87\xAA')
REGIONAL_INDICATOR_SYMBOL_LETTER_G_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_B \
= n(b'\xF0\x9F\x87\xAC\xF0\x9F\x87\xA7')
REGIONAL_INDICATOR_SYMBOL_LETTER_C_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_N \
= n(b'\xF0\x9F\x87\xA8\xF0\x9F\x87\xB3')
REGIONAL_INDICATOR_SYMBOL_LETTER_J_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_P \
= n(b'\xF0\x9F\x87\xAF\xF0\x9F\x87\xB5')
REGIONAL_INDICATOR_SYMBOL_LETTER_K_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_R \
= n(b'\xF0\x9F\x87\xB0\xF0\x9F\x87\xB7')
REGIONAL_INDICATOR_SYMBOL_LETTER_F_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_R \
= n(b'\xF0\x9F\x87\xAB\xF0\x9F\x87\xB7')
REGIONAL_INDICATOR_SYMBOL_LETTER_E_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_S \
= n(b'\xF0\x9F\x87\xAA\xF0\x9F\x87\xB8')
REGIONAL_INDICATOR_SYMBOL_LETTER_I_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_T \
= n(b'\xF0\x9F\x87\xAE\xF0\x9F\x87\xB9')
REGIONAL_INDICATOR_SYMBOL_LETTER_U_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_S \
= n(b'\xF0\x9F\x87\xBA\xF0\x9F\x87\xB8')
REGIONAL_INDICATOR_SYMBOL_LETTER_R_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_U \
= n(b'\xF0\x9F\x87\xB7\xF0\x9F\x87\xBA')
REGIONAL_INDICATOR_SYMBOL_LETTER_D_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_E = n(
b'\xF0\x9F\x87\xA9\xF0\x9F\x87\xAA')
REGIONAL_INDICATOR_SYMBOL_LETTER_G_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_B = n(
b'\xF0\x9F\x87\xAC\xF0\x9F\x87\xA7')
REGIONAL_INDICATOR_SYMBOL_LETTER_C_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_N = n(
b'\xF0\x9F\x87\xA8\xF0\x9F\x87\xB3')
REGIONAL_INDICATOR_SYMBOL_LETTER_J_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_P = n(
b'\xF0\x9F\x87\xAF\xF0\x9F\x87\xB5')
REGIONAL_INDICATOR_SYMBOL_LETTER_K_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_R = n(
b'\xF0\x9F\x87\xB0\xF0\x9F\x87\xB7')
REGIONAL_INDICATOR_SYMBOL_LETTER_F_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_R = n(
b'\xF0\x9F\x87\xAB\xF0\x9F\x87\xB7')
REGIONAL_INDICATOR_SYMBOL_LETTER_E_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_S = n(
b'\xF0\x9F\x87\xAA\xF0\x9F\x87\xB8')
REGIONAL_INDICATOR_SYMBOL_LETTER_I_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_T = n(
b'\xF0\x9F\x87\xAE\xF0\x9F\x87\xB9')
REGIONAL_INDICATOR_SYMBOL_LETTER_U_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_S = n(
b'\xF0\x9F\x87\xBA\xF0\x9F\x87\xB8')
REGIONAL_INDICATOR_SYMBOL_LETTER_R_PLUS_REGIONAL_INDICATOR_SYMBOL_LETTER_U = n(
b'\xF0\x9F\x87\xB7\xF0\x9F\x87\xBA')
SQUARED_KATAKANA_KOKO = n(b'\xF0\x9F\x88\x81')
SQUARED_KATAKANA_SA = n(b'\xF0\x9F\x88\x82')
SQUARED_CJK_UNIFIED_IDEOGRAPH_7121 = n(b'\xF0\x9F\x88\x9A')

View file

@ -44,9 +44,8 @@ class InlineKeyboardMarkup(ReplyMarkup):
if not data:
return None
data['inline_keyboard'] = \
[InlineKeyboardButton.de_list(inline_keyboard) for inline_keyboard
in data['inline_keyboard']]
data['inline_keyboard'] = [InlineKeyboardButton.de_list(inline_keyboard)
for inline_keyboard in data['inline_keyboard']]
return InlineKeyboardMarkup(**data)

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultArticle"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultArticle(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultAudio"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultAudio(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultCachedAudio"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultCachedAudio(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultCachedDocument"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultCachedDocument(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultCachedGif"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultCachedGif(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultMpeg4Gif"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultCachedMpeg4Gif(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultPhoto"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultCachedPhoto(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultCachedSticker"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultCachedSticker(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultCachedVideo"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultCachedVideo(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultCachedVoice"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultCachedVoice(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultContact"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultContact(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultDocument"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultDocument(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultGif"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultGif(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultLocation"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultLocation(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultMpeg4Gif"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultMpeg4Gif(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultPhoto"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultPhoto(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultVenue"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultVenue(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultVideo"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultVideo(InlineQueryResult):

View file

@ -19,8 +19,7 @@
"""This module contains the classes that represent Telegram
InlineQueryResultVoice"""
from telegram import InlineQueryResult, InlineKeyboardMarkup, \
InputMessageContent
from telegram import InlineQueryResult, InlineKeyboardMarkup, InputMessageContent
class InlineQueryResultVoice(InlineQueryResult):

View file

@ -36,8 +36,7 @@ from future.moves.urllib.request import urlopen
from telegram import TelegramError
DEFAULT_MIME_TYPE = 'application/octet-stream'
USER_AGENT = 'Python Telegram Bot' \
' (https://github.com/python-telegram-bot/python-telegram-bot)'
USER_AGENT = 'Python Telegram Bot (https://github.com/python-telegram-bot/python-telegram-bot)'
class InputFile(object):

View file

@ -161,8 +161,7 @@ class Message(TelegramObject):
data['forward_from'] = User.de_json(data.get('forward_from'))
data['forward_from_chat'] = Chat.de_json(data.get('forward_from_chat'))
data['forward_date'] = Message._fromtimestamp(data.get('forward_date'))
data['reply_to_message'] = \
Message.de_json(data.get('reply_to_message'))
data['reply_to_message'] = Message.de_json(data.get('reply_to_message'))
data['audio'] = Audio.de_json(data.get('audio'))
data['document'] = Document.de_json(data.get('document'))
data['photo'] = PhotoSize.de_list(data.get('photo'))

View file

@ -65,9 +65,7 @@ class Update(TelegramObject):
data['message'] = Message.de_json(data.get('message'))
data['inline_query'] = InlineQuery.de_json(data.get('inline_query'))
data['chosen_inline_result'] = \
ChosenInlineResult.de_json(data.get('chosen_inline_result'))
data['callback_query'] = \
CallbackQuery.de_json(data.get('callback_query'))
data['chosen_inline_result'] = ChosenInlineResult.de_json(data.get('chosen_inline_result'))
data['callback_query'] = CallbackQuery.de_json(data.get('callback_query'))
return Update(**data)