From 7c0579b4bbd7d2c746a8a264d54557ec1e209fd4 Mon Sep 17 00:00:00 2001 From: SaNeOr Date: Sun, 25 Jun 2023 18:02:55 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8D=20=E5=AF=BC=E5=87=BA?= =?UTF-8?q?python=E6=95=B0=E6=8D=AE,=20DBool=E7=B1=BB=E5=9E=8B=20=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E9=97=AE=E9=A2=98=20(#53)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Source/DataVisitors/ToPythonLiteralVisitor.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Luban.Job.Cfg/Source/DataVisitors/ToPythonLiteralVisitor.cs b/src/Luban.Job.Cfg/Source/DataVisitors/ToPythonLiteralVisitor.cs index 686ad56..afdea98 100644 --- a/src/Luban.Job.Cfg/Source/DataVisitors/ToPythonLiteralVisitor.cs +++ b/src/Luban.Job.Cfg/Source/DataVisitors/ToPythonLiteralVisitor.cs @@ -10,6 +10,11 @@ namespace Luban.Job.Cfg.DataVisitors { public static ToPythonLiteralVisitor Ins { get; } = new(); + public override string Accept(DBool type) + { + return type.Value ? "True" : "False"; + } + public override string Accept(DText type) { return $"{{\"{DText.KEY_NAME}\":\"{type.Key}\",\"{DText.TEXT_NAME}\":\"{DataUtil.EscapeString(type.TextOfCurrentAssembly)}\"}}";