Skip to content

Commit

Permalink
Reformat the code
Browse files Browse the repository at this point in the history
  • Loading branch information
qlaym-backup committed Apr 3, 2020
1 parent 94d14a5 commit 6ddd5d1
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 46 deletions.
3 changes: 1 addition & 2 deletions docs/autogen.py
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import print_function, unicode_literals

import inspect
import os
Expand Down
1 change: 1 addition & 0 deletions fbotics/__init__.py
Expand Up @@ -3,6 +3,7 @@
from fbotics.models.payloads.button_template import ButtonTemplatePayload
from fbotics.models.recipient import Recipient
from fbotics.models.request import Request

from ._version import get_versions

__version__ = get_versions()["version"]
Expand Down
7 changes: 3 additions & 4 deletions fbotics/models/attachment.py
@@ -1,12 +1,11 @@
from schematics.models import Model
from schematics.types import StringType
from schematics.types.compound import PolyModelType

from fbotics.models.payloads.button_template import ButtonTemplatePayload
from fbotics.models.payloads.generic_template import GenericTemplatePayload
from fbotics.models.payloads.list_template import ListTemplatePayload
from fbotics.models.payloads.receipt_template import ReceiptTemplatePayload
from fbotics.models.payloads.rich_media import RichMediaPayload
from schematics.models import Model
from schematics.types import StringType
from schematics.types.compound import PolyModelType


def payload_claim_function(field, data):
Expand Down
8 changes: 3 additions & 5 deletions fbotics/models/message.py
@@ -1,12 +1,10 @@
from fbotics.models.attachment import Attachment
from fbotics.models.quick_reply import QuickReply
from schematics.exceptions import ValidationError
from schematics.models import Model
from schematics.types import ListType
from schematics.types import StringType
from schematics.types import ListType, StringType
from schematics.types.compound import ModelType

from fbotics.models.attachment import Attachment
from fbotics.models.quick_reply import QuickReply


class Message(Model):
"""Represent a message object in a request sent to Facebook.
Expand Down
5 changes: 2 additions & 3 deletions fbotics/models/payloads/button_template.py
@@ -1,7 +1,6 @@
from fbotics.models.buttons import CallButton, PostbackButton, WebUrlButton
from schematics import Model
from schematics.types import StringType, ListType, PolyModelType, BooleanType

from fbotics.models.buttons import PostbackButton, WebUrlButton, CallButton
from schematics.types import BooleanType, ListType, PolyModelType, StringType


def button_claim_function(field, data):
Expand Down
5 changes: 2 additions & 3 deletions fbotics/models/payloads/element.py
@@ -1,9 +1,8 @@
from fbotics.models.buttons import PostbackButton, WebUrlButton
from schematics import Model
from schematics.types import StringType, ListType, ModelType
from schematics.types import ListType, ModelType, StringType
from schematics.types.compound import PolyModelType

from fbotics.models.buttons import PostbackButton, WebUrlButton


def button_claim_function(field, data):
if "url" in data:
Expand Down
5 changes: 2 additions & 3 deletions fbotics/models/payloads/generic_template.py
@@ -1,8 +1,7 @@
from schematics import Model
from schematics.types import StringType, ListType, ModelType, BooleanType

from fbotics.models.buttons import PostbackButton, WebUrlButton
from fbotics.models.payloads.element import Element
from schematics import Model
from schematics.types import BooleanType, ListType, ModelType, StringType


def button_claim_function(field, data):
Expand Down
7 changes: 3 additions & 4 deletions fbotics/models/payloads/list_template.py
@@ -1,9 +1,8 @@
from schematics import Model
from schematics.types import StringType, ListType, ModelType, BooleanType
from schematics.types.compound import PolyModelType

from fbotics.models.buttons import PostbackButton, WebUrlButton
from fbotics.models.payloads.element import Element
from schematics import Model
from schematics.types import BooleanType, ListType, ModelType, StringType
from schematics.types.compound import PolyModelType


def button_claim_function(field, data):
Expand Down
8 changes: 4 additions & 4 deletions fbotics/models/payloads/receipt_template.py
@@ -1,11 +1,11 @@
from schematics import Model
from schematics.types import (
StringType,
ListType,
ModelType,
BooleanType,
IntType,
DecimalType,
IntType,
ListType,
ModelType,
StringType,
)


Expand Down
2 changes: 1 addition & 1 deletion fbotics/models/payloads/rich_media.py
@@ -1,5 +1,5 @@
from schematics import Model
from schematics.types import StringType, BooleanType
from schematics.types import BooleanType, StringType


class RichMediaPayload(Model):
Expand Down
5 changes: 2 additions & 3 deletions fbotics/models/request.py
@@ -1,11 +1,10 @@
from fbotics.models.message import Message
from fbotics.models.recipient import Recipient
from schematics.exceptions import ValidationError
from schematics.models import Model
from schematics.types import StringType
from schematics.types.compound import ModelType

from fbotics.models.message import Message
from fbotics.models.recipient import Recipient


class Request(Model):
"""Model for a request to be send by the client.
Expand Down
2 changes: 1 addition & 1 deletion fbotics/tests/client/test_retrieve_supported_tags.py
@@ -1,4 +1,4 @@
from pytest_voluptuous import S, Partial
from pytest_voluptuous import Partial, S


def test_retrieve_supported_tags_response_status_code_is_200(client, recipient_id):
Expand Down
2 changes: 1 addition & 1 deletion fbotics/tests/client/test_send_button_template.py
@@ -1,4 +1,4 @@
from fbotics.models.buttons import WebUrlButton, CallButton
from fbotics.models.buttons import CallButton, WebUrlButton
from fbotics.models.quick_reply import QuickReply


Expand Down
4 changes: 2 additions & 2 deletions fbotics/tests/client/test_send_receipt_template.py
@@ -1,8 +1,8 @@
from fbotics.models.payloads.receipt_template import (
Element,
Address,
Adjustment,
Element,
Summary,
Address,
)
from fbotics.models.quick_reply import QuickReply

Expand Down
2 changes: 1 addition & 1 deletion fbotics/tests/models/test_message.py
@@ -1,7 +1,7 @@
import pytest
from schematics.exceptions import DataError

from fbotics.models.message import Message
from schematics.exceptions import DataError


def test_validation_when_text_of_message_is_too_long(client):
Expand Down
6 changes: 3 additions & 3 deletions fbotics/tests/models/test_quick_reply.py
@@ -1,7 +1,7 @@
import pytest
from schematics.exceptions import DataError

from fbotics.models.quick_reply import QuickReply
from schematics.exceptions import DataError


def test_validation_when_content_type_is_text_and_title_does_not_exist(client):
Expand All @@ -16,7 +16,7 @@ def test_validation_when_content_type_is_text_and_title_does_not_exist(client):


def test_validation_when_content_type_is_text_and_image_url_is_set_but_payload_is_not_set(
client
client,
):
"""
GIVEN a QuickReply object with a text content type and an image url, but without a payload
Expand All @@ -29,7 +29,7 @@ def test_validation_when_content_type_is_text_and_image_url_is_set_but_payload_i


def test_validation_when_content_type_is_text_and_title_is_empty_and_image_url_is_not_set(
client
client,
):
"""
GIVEN a QuickReply object with a text content type and an empty title, but without an image_url
Expand Down
2 changes: 1 addition & 1 deletion fbotics/tests/models/test_recipient.py
@@ -1,7 +1,7 @@
import pytest
from schematics.exceptions import DataError

from fbotics.models.recipient import Recipient
from schematics.exceptions import DataError


def test_validation_when_id_and_phone_number_are_both_set(client):
Expand Down
2 changes: 1 addition & 1 deletion fbotics/tests/models/test_request.py
@@ -1,7 +1,7 @@
import pytest
from schematics.exceptions import DataError

from fbotics.models.request import Request
from schematics.exceptions import DataError


def test_if_supported_tags_are_valid(client):
Expand Down
9 changes: 5 additions & 4 deletions versioneer.py
Expand Up @@ -277,17 +277,18 @@

from __future__ import print_function

try:
import configparser
except ImportError:
import ConfigParser as configparser
import errno
import json
import os
import re
import subprocess
import sys

try:
import configparser
except ImportError:
import ConfigParser as configparser


class VersioneerConfig:
"""Container for Versioneer configuration parameters."""
Expand Down

0 comments on commit 6ddd5d1

Please sign in to comment.