Skip to content

Commit 3d0fa7e

Browse files
committed
Apply formatter and linter
1 parent ed44ec6 commit 3d0fa7e

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

src/rpft/parsers/creation/flowparser.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ def _get_row_action(self, row):
514514
)
515515
elif row.type == "remove_from_group":
516516
if not row.mainarg_groups:
517-
LOGGER.warning(f"Removing contact from ALL groups.")
517+
LOGGER.warning("Removing contact from ALL groups.")
518518
return RemoveContactGroupAction(groups=[], all_groups=True)
519519
elif row.mainarg_groups[0] == "ALL":
520520
return RemoveContactGroupAction(groups=[], all_groups=True)
@@ -559,7 +559,8 @@ def _get_or_create_group(self, name, uuid=None):
559559
def _get_row_node(self, row):
560560
if (
561561
row.type in ["add_to_group", "remove_from_group", "split_by_group"]
562-
and row.obj_id and row.mainarg_groups
562+
and row.obj_id
563+
and row.mainarg_groups
563564
):
564565
self.rapidpro_container.record_group_uuid(row.mainarg_groups[0], row.obj_id)
565566

@@ -804,8 +805,9 @@ def _compile_flow(self):
804805
to fill in these missing UUIDs in a consistent way.
805806
"""
806807

807-
# Caveat/TODO: Need to ensure starting node comes first.
808-
flow_container = FlowContainer(flow_name=self.flow_name, uuid=self.flow_uuid, type=self.flow_type)
808+
flow_container = FlowContainer(
809+
flow_name=self.flow_name, uuid=self.flow_uuid, type=self.flow_type
810+
)
809811
if not len(self.node_group_stack) == 1:
810812
raise Exception("Unexpected end of flow. Did you forget end_for/end_block?")
811813
self.current_node_group().add_nodes_to_flow(flow_container)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
class RapidProActionError(Exception):
22
"Raised if some parameter of a RapidProAction is invalid."
3+
34
pass
45

56

67
class RapidProRouterError(Exception):
78
"Raised if some parameter of a RapidProRouter is invalid."
9+
810
pass

tests/test_contentindexparser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ def test_basic_user_model(self):
137137

138138
def test_flow_type(self):
139139
ci_sheet = (
140-
"type,sheet_name,data_sheet,data_row_id,new_name,data_model,options\n"
141-
"create_flow,my_basic_flow,,,,,\n"
142-
"create_flow,my_basic_flow,,,my_other_flow,,flow_type;messaging_background\n"
140+
"type,sheet_name,new_name,data_model,options\n"
141+
"create_flow,my_basic_flow,,,\n"
142+
"create_flow,my_basic_flow,my_other_flow,,flow_type;messaging_background\n"
143143
)
144144
my_basic_flow = csv_join(
145145
"row_id,type,from,message_text",

tests/test_rowparser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def test_convert_empty(self):
173173
self.assertEqual(out, self.emptyModel)
174174

175175
def test_convert_single_element(self):
176-
self.oneModel = DictModel(**{"dict_field": {"K" : "V"}})
176+
self.oneModel = DictModel(**{"dict_field": {"K": "V"}})
177177
inputs = [
178178
{"dict_field": ["K", "V"]},
179179
{"dict_field": [["K", "V"]]},
@@ -184,7 +184,7 @@ def test_convert_single_element(self):
184184
self.assertEqual(out, self.oneModel)
185185

186186
def test_convert_two_element(self):
187-
self.onetwoModel = DictModel(**{"dict_field": {"K1" : "V1", "K2" : "V2"}})
187+
self.onetwoModel = DictModel(**{"dict_field": {"K1": "V1", "K2": "V2"}})
188188
inputs = [
189189
{"dict_field": [["K1", "V1"], ["K2", "V2"]]},
190190
{"dict_field.K1": "V1", "dict_field.K2": "V2"},

0 commit comments

Comments
 (0)