Skip to content

Commit

Permalink
Apply black to all project python code
Browse files Browse the repository at this point in the history
Signed-off-by: arthurtemporim <arthurrtl@gmail.com>
  • Loading branch information
arthurTemporim committed Oct 28, 2020
1 parent f501ab3 commit 9c36977
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bot/actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def run(
domain: Dict[Text, Any],
) -> List[Dict[Text, Any]]:

telefone = tracker.get_slot('telefone')
telefone = tracker.get_slot("telefone")

try:
dispatcher.utter_message("O seu telefone é {}?".format(telefone))
Expand Down
11 changes: 5 additions & 6 deletions bot/actions/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def required_slots(tracker: Tracker) -> List[Text]:

def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
"""A dictionary to map required slots to
- an extracted entity
- intent: value pairs
- a whole message
or a list of them, where a first match will be picked"""
- an extracted entity
- intent: value pairs
- a whole message
or a list of them, where a first match will be picked"""
return {
"cpf": self.from_text(not_intent="cancelar"),
"data_nascimento": self.from_text(not_intent="cancelar"),
Expand All @@ -45,7 +45,7 @@ def submit(
domain: Dict[Text, Any],
) -> List[Dict]:
"""Define what the login form will do after
all required slots are filled"""
all required slots are filled"""

cpf = tracker.get_slot("cpf")
data_nascimento = tracker.get_slot("data_nascimento")
Expand Down Expand Up @@ -94,4 +94,3 @@ def validate_data_nascimento(
# validation failed, set this slot to None, meaning the
# user will be asked for the slot again
return {"data_nascimento": None}

5 changes: 4 additions & 1 deletion modules/analytics/setup_elastic.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@
if not es.indices.exists(index_name):
logger.debug(
es.indices.create(
index=index_name, ignore=400, params=param, body=settings,
index=index_name,
ignore=400,
params=param,
body=settings,
)
)
logger.info("Created Index")
Expand Down
5 changes: 4 additions & 1 deletion modules/rabbitmq/consumer/consume_bot_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@

connection = pika.BlockingConnection(
pika.ConnectionParameters(
host="rabbitmq", credentials=credentials, connection_attempts=20, retry_delay=5,
host="rabbitmq",
credentials=credentials,
connection_attempts=20,
retry_delay=5,
)
)

Expand Down
6 changes: 3 additions & 3 deletions modules/rocketchat/bot_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def create_bot_user():
print("User already created.")

api_post(
"users.setAvatar", {"avatarUrl": bot["avatar"], "username": bot["username"]},
"users.setAvatar",
{"avatarUrl": bot["avatar"], "username": bot["username"]},
)


Expand Down Expand Up @@ -169,6 +170,7 @@ def configure_rocketchat():
rocket_available = True
except Exception:
import time

logger.info("\n\n --------- Rocket Chat Unavailable! --------\n\n")
logger.info(">> Waiting for 3 seconds...")
time.sleep(3)
Expand All @@ -188,7 +190,5 @@ def configure_rocketchat():
except Exception as e:
logger.error(f"Problem while trying to configure bot in Rocketchat: {e}")



else:
logger.error(">> Login Failed")

0 comments on commit 9c36977

Please sign in to comment.