Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Sourcery refactored master branch #6

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions nonebot_plugin_puppet/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,18 @@ def get_conv(
for type_a in self.__conv_mapping:
for id_a in self.__conv_mapping[type_a]:
tmp_conv_mapping[type_a].append(id_a)
elif reverse:
for type_b in conv:
for id_b in conv[type_b]:
for type_a in self.__conv_mapping:
for id_a in self.__conv_mapping[type_a]:
if id_b in self.__conv_mapping[type_a][id_a][type_b]:
tmp_conv_mapping[type_a].append(id_a)
else:
if reverse:
for type_b in conv:
for id_b in conv[type_b]:
for type_a in self.__conv_mapping:
for id_a in self.__conv_mapping[type_a]:
if id_b in self.__conv_mapping[type_a][id_a][type_b]:
tmp_conv_mapping[type_a].append(id_a)
else:
for type_a in conv:
for id_a in conv[type_a]:
if id_a in self.__conv_mapping[type_a]:
tmp_conv_mapping = self.__conv_mapping[type_a][id_a]
for type_a in conv:
for id_a in conv[type_a]:
if id_a in self.__conv_mapping[type_a]:
tmp_conv_mapping = self.__conv_mapping[type_a][id_a]
Comment on lines +26 to +37
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ConvMapping.get_conv refactored with the following changes:


return tmp_conv_mapping

Expand Down