mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-13 11:18:20 +01:00
Add docstring style checker and fixing some
This commit is contained in:
parent
a539a0c3a5
commit
dfc75cc64e
32 changed files with 41 additions and 41 deletions
6
Makefile
6
Makefile
|
@ -7,11 +7,14 @@ clean:
|
||||||
find . -name '*.pyo' -exec rm -f {} \;
|
find . -name '*.pyo' -exec rm -f {} \;
|
||||||
find . -name '*~' -exec rm -f {} \;
|
find . -name '*~' -exec rm -f {} \;
|
||||||
|
|
||||||
|
pep257:
|
||||||
|
pep257 telegram
|
||||||
|
|
||||||
pep8:
|
pep8:
|
||||||
flake8 telegram
|
flake8 telegram
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
pylint -E telegram
|
pylint -E telegram --disable=no-name-in-module,import-error
|
||||||
|
|
||||||
test:
|
test:
|
||||||
nosetests
|
nosetests
|
||||||
|
@ -22,6 +25,7 @@ install:
|
||||||
help:
|
help:
|
||||||
@echo "Available targets:"
|
@echo "Available targets:"
|
||||||
@echo "- clean Clean up the source directory"
|
@echo "- clean Clean up the source directory"
|
||||||
|
@echo "- pep257 Check docstring style with pep257"
|
||||||
@echo "- pep8 Check style with flake8"
|
@echo "- pep8 Check style with flake8"
|
||||||
@echo "- lint Check style with pylint"
|
@echo "- lint Check style with pylint"
|
||||||
@echo "- test Run tests"
|
@echo "- test Run tests"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
flake8
|
flake8
|
||||||
nose
|
nose
|
||||||
|
pep257
|
||||||
pylint
|
pylint
|
||||||
unittest2
|
unittest2
|
||||||
|
|
|
@ -52,9 +52,9 @@ from .dispatcher import Dispatcher
|
||||||
from .jobqueue import JobQueue
|
from .jobqueue import JobQueue
|
||||||
from .updater import Updater
|
from .updater import Updater
|
||||||
|
|
||||||
__all__ = ['Bot', 'Updater', 'Dispatcher', 'Emoji', 'TelegramError',
|
__all__ = ('Bot', 'Updater', 'Dispatcher', 'Emoji', 'TelegramError',
|
||||||
'InputFile', 'ReplyMarkup', 'ForceReply', 'ReplyKeyboardHide',
|
'InputFile', 'ReplyMarkup', 'ForceReply', 'ReplyKeyboardHide',
|
||||||
'ReplyKeyboardMarkup', 'UserProfilePhotos', 'ChatAction',
|
'ReplyKeyboardMarkup', 'UserProfilePhotos', 'ChatAction',
|
||||||
'Location', 'Contact', 'Video', 'Sticker', 'Document', 'File',
|
'Location', 'Contact', 'Video', 'Sticker', 'Document', 'File',
|
||||||
'Audio', 'PhotoSize', 'Chat', 'Update', 'ParseMode', 'Message',
|
'Audio', 'PhotoSize', 'Chat', 'Update', 'ParseMode', 'Message',
|
||||||
'User', 'TelegramObject', 'NullHandler', 'Voice', 'JobQueue']
|
'User', 'TelegramObject', 'NullHandler', 'Voice', 'JobQueue')
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram Audio"""
|
"""This module contains a object that represents a Telegram Audio."""
|
||||||
|
|
||||||
from telegram import TelegramObject
|
from telegram import TelegramObject
|
||||||
|
|
||||||
|
|
|
@ -17,14 +17,14 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""Base class for Telegram Objects"""
|
"""Base class for Telegram Objects."""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from abc import ABCMeta
|
from abc import ABCMeta
|
||||||
|
|
||||||
|
|
||||||
class TelegramObject(object):
|
class TelegramObject(object):
|
||||||
"""Base class for most telegram objects"""
|
"""Base class for most telegram objects."""
|
||||||
|
|
||||||
__metaclass__ = ABCMeta
|
__metaclass__ = ABCMeta
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram Bot"""
|
"""This module contains a object that represents a Telegram Bot."""
|
||||||
|
|
||||||
import functools
|
import functools
|
||||||
import logging
|
import logging
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram Chat"""
|
"""This module contains a object that represents a Telegram Chat."""
|
||||||
|
|
||||||
from telegram import TelegramObject
|
from telegram import TelegramObject
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram ChatAction"""
|
"""This module contains a object that represents a Telegram ChatAction."""
|
||||||
|
|
||||||
|
|
||||||
class ChatAction(object):
|
class ChatAction(object):
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram Contact"""
|
"""This module contains a object that represents a Telegram Contact."""
|
||||||
|
|
||||||
from telegram import TelegramObject
|
from telegram import TelegramObject
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,8 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
|
"""This module contains the Dispatcher class."""
|
||||||
|
|
||||||
"""
|
|
||||||
This module contains the Dispatcher class.
|
|
||||||
"""
|
|
||||||
import logging
|
import logging
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from inspect import getargspec
|
from inspect import getargspec
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram Document"""
|
"""This module contains a object that represents a Telegram Document."""
|
||||||
|
|
||||||
from telegram import PhotoSize, TelegramObject
|
from telegram import PhotoSize, TelegramObject
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents an Emoji"""
|
"""This module contains a object that represents an Emoji."""
|
||||||
|
|
||||||
from future.utils import bytes_to_native_str as n
|
from future.utils import bytes_to_native_str as n
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram Error"""
|
"""This module contains a object that represents a Telegram Error."""
|
||||||
|
|
||||||
|
|
||||||
def _lstrip_str(in_s, lstr):
|
def _lstrip_str(in_s, lstr):
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram File"""
|
"""This module contains a object that represents a Telegram File."""
|
||||||
|
|
||||||
from os.path import basename
|
from os.path import basename
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram ForceReply"""
|
"""This module contains a object that represents a Telegram ForceReply."""
|
||||||
|
|
||||||
from telegram import ReplyMarkup
|
from telegram import ReplyMarkup
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram InputFile"""
|
"""This module contains a object that represents a Telegram InputFile."""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from email.generator import _make_boundary as choose_boundary
|
from email.generator import _make_boundary as choose_boundary
|
||||||
|
|
|
@ -17,9 +17,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""
|
"""This module contains the class JobQueue."""
|
||||||
This module contains the class JobQueue
|
|
||||||
"""
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram Location"""
|
"""This module contains a object that represents a Telegram Location."""
|
||||||
|
|
||||||
from telegram import TelegramObject
|
from telegram import TelegramObject
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram Message"""
|
"""This module contains a object that represents a Telegram Message."""
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from time import mktime
|
from time import mktime
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a logging NullHandler"""
|
"""This module contains a object that represents a logging NullHandler."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram
|
"""This module contains a object that represents a Telegram
|
||||||
Message Parse Modes"""
|
Message Parse Modes."""
|
||||||
|
|
||||||
|
|
||||||
class ParseMode(object):
|
class ParseMode(object):
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram PhotoSize"""
|
"""This module contains a object that represents a Telegram PhotoSize."""
|
||||||
|
|
||||||
from telegram import TelegramObject
|
from telegram import TelegramObject
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram
|
"""This module contains a object that represents a Telegram
|
||||||
ReplyKeyboardHide"""
|
ReplyKeyboardHide."""
|
||||||
|
|
||||||
from telegram import ReplyMarkup
|
from telegram import ReplyMarkup
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram
|
"""This module contains a object that represents a Telegram
|
||||||
ReplyKeyboardMarkup"""
|
ReplyKeyboardMarkup."""
|
||||||
|
|
||||||
from telegram import ReplyMarkup
|
from telegram import ReplyMarkup
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""Base class for Telegram ReplyMarkup Objects"""
|
"""Base class for Telegram ReplyMarkup Objects."""
|
||||||
|
|
||||||
from telegram import TelegramObject
|
from telegram import TelegramObject
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram Sticker"""
|
"""This module contains a object that represents a Telegram Sticker."""
|
||||||
|
|
||||||
from telegram import PhotoSize, TelegramObject
|
from telegram import PhotoSize, TelegramObject
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram Update"""
|
"""This module contains a object that represents a Telegram Update."""
|
||||||
|
|
||||||
from telegram import Message, TelegramObject
|
from telegram import Message, TelegramObject
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,9 @@
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""This module contains the class Updater, which tries to make creating
|
||||||
This module contains the class Updater, which tries to make creating Telegram
|
Telegram bots intuitive."""
|
||||||
Bots intuitive!
|
|
||||||
"""
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import ssl
|
import ssl
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram User"""
|
"""This module contains a object that represents a Telegram User."""
|
||||||
|
|
||||||
from telegram import TelegramObject
|
from telegram import TelegramObject
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram
|
"""This module contains a object that represents a Telegram
|
||||||
UserProfilePhotos"""
|
UserProfilePhotos."""
|
||||||
|
|
||||||
from telegram import PhotoSize, TelegramObject
|
from telegram import PhotoSize, TelegramObject
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram Video"""
|
"""This module contains a object that represents a Telegram Video."""
|
||||||
|
|
||||||
from telegram import PhotoSize, TelegramObject
|
from telegram import PhotoSize, TelegramObject
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU Lesser Public License
|
# You should have received a copy of the GNU Lesser Public License
|
||||||
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
# along with this program. If not, see [http://www.gnu.org/licenses/].
|
||||||
|
|
||||||
"""This module contains a object that represents a Telegram Voice"""
|
"""This module contains a object that represents a Telegram Voice."""
|
||||||
|
|
||||||
from telegram import TelegramObject
|
from telegram import TelegramObject
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue