

Во время отладки произошла ошибка в строка 39 и стек трассировки:
Произошла ошибка: Microsoft.Scripting.ArgumentTypeException: NoneType не вызывается 在
Microsoft.Scripting.Interpreter.ThrowInstruction.Run(Кадр InterpretedFrame) 在
Microsoft.Scripting.Interpreter.Interpreter.Run(Кадр InterpretedFrame) Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) 在
System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](сайт CallSite, T0 arg0, T1 arg1, T2 arg2) 在
$6.DataChanged$37(PythonFunction $function, Object e) 位置 E:\Codes\DemoSln\PythonApplication\Empty.py:行号 39
Моя компания разработала приложение, используя .net, приложение интегрировано с IronPython. исходный код — это просто плагин.
вот исходный код моего IronPython:
import clr
clr.AddReference('System')
clr.AddReference('Kingdee.BOS.Core')
clr.AddReference('Newtonsoft.Json')
from System import *
from Kingdee.BOS.Core import *
from Kingdee.BOS.Core.List import *
from Kingdee.BOS.Core.Bill import *
from Kingdee.BOS.Core.Metadata import *
from Kingdee.BOS.Core.SqlBuilder import *
from Kingdee.BOS.Core.DynamicForm import *
from Newtonsoft.Json.Linq import JObject
def DataChanged(e):
if e.Field.Key == "F_QXQV_StartGotTime":
try:
startGotTime = this.View.Model.GetValue("F_QXQV_StartGotTime", e.Row);
originalExtendProp = this.View.Model.GetValue("FExtendProperty", e.Row);
if startGotTime is not None:
origin = DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
diff = startGotTime.ToUniversalTime() - origin;
timstamp = Convert.ToInt64(diff.TotalMilliseconds).ToString();
if originalExtendProp is None or String.IsNullOrWhiteSpace(originalExtendProp):
this.View.Model.SetValue("FExtendProperty", String.Format("{{{0} \"startGotTime\": \"{1}\" {0}}}", Environment.NewLine, timstamp), e.Row);
else:
extendObj = JObject.Parse(originalExtendProp);
extendObj["startGotTime"] = timstamp;
this.View.Model.SetValue("FExtendProperty", String.Format("{0}", extendObj), e.Row);
else:
if originalExtendProp is not None:
extendObj = JObject.Parse(originalExtendProp);
extendObj.Remove("startGotTime");
if extendObj.HasValues:
this.View.Model.SetValue("FExtendProperty", String.Format("{0}", extendObj), e.Row);
else:
this.View.Model.SetValue("FExtendProperty", "", e.Row);
except Exception as e:
this.View.ShowMessage(String.Format("Error occured: {0}", e));
Подробнее здесь: https://stackoverflow.com/questions/798 ... python-app
Мобильная версия