use infection to convert from snake case to camel case

This commit is contained in:
xyqyear 2023-10-27 16:36:23 +08:00
parent 4cad01035f
commit 79aee1e18c

View File

@ -753,24 +753,10 @@ class Importer:
for user_udeame_row in user_udemae_result: for user_udeame_row in user_udemae_result:
user_udeame = user_udeame_row._asdict() user_udeame = user_udeame_row._asdict()
udemae = { user_udeame.pop("id")
"rate": user_udeame["rate"], user_udeame.pop("user_id")
"maxRate": user_udeame["max_rate"],
"classValue": user_udeame["class_value"], udemae = {inflection.camelize(k, False): v for k, v in user_udeame.items()}
"maxClassValue": user_udeame["max_class_value"],
"totalWinNum": user_udeame["total_win_num"],
"totalLoseNum": user_udeame["total_lose_num"],
"maxWinNum": user_udeame["max_win_num"],
"maxLoseNum": user_udeame["max_lose_num"],
"winNum": user_udeame["win_num"],
"loseNum": user_udeame["lose_num"],
"npcTotalWinNum": user_udeame["npc_total_win_num"],
"npcTotalLoseNum": user_udeame["npc_total_lose_num"],
"npcMaxWinNum": user_udeame["npc_max_win_num"],
"npcMaxLoseNum": user_udeame["npc_max_lose_num"],
"npcWinNum": user_udeame["npc_win_num"],
"npcLoseNum": user_udeame["npc_lose_num"],
}
return ( return (
ratings["recent_rating"], ratings["recent_rating"],
@ -1100,6 +1086,7 @@ class Importer:
f"Imported {version_str} userFriendSeasonRanking: {artemis_user}, {tmp['seasonId']}" f"Imported {version_str} userFriendSeasonRanking: {artemis_user}, {tmp['seasonId']}"
) )
def main(): def main():
parser = argparse.ArgumentParser(description="AQUA to ARTEMiS") parser = argparse.ArgumentParser(description="AQUA to ARTEMiS")
parser.add_argument( parser.add_argument(