UNO错误:在呼叫期间处理二进制URP桥

时间:2017-05-19 13:58:30

标签: python python-3.x archlinux uno

我正在尝试使用LibreOffice测试 Python UNO api ,这会产生一个奇怪的错误。

import socket
import uno
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext(
                                   "com.sun.star.bridge.UnoUrlResolver", localContext )
ctx = resolver.resolve( "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" )
smgr = ctx.ServiceManager
desktop = smgr.createInstanceWithContext("com.sun.star.frame.Desktop",ctx) //this line is generating error
model = desktop.getCurrentComponent()
text = model.Text
cursor = text.createTextCursor()
text.insertString( cursor, "Hello World", 0 )
ctx.ServiceManager                        

以下是我的代码:

var AuthenticationManager = HttpContext.GetOwinContext().Authentication;
var Identity = User.Identity as ClaimsIdentity;
if (Identity.HasClaim(c => c.Type == "custom"))
{
    Identity.RemoveClaim(Identity.FindFirst("custom"));
}
Identity.AddClaim(new Claim("custom", "value", ClaimValueTypes.Integer32));
AuthenticationManager.AuthenticationResponseGrant =
            new AuthenticationResponseGrant(new ClaimsPrincipal(Identity), new AuthenticationProperties { IsPersistent = true });

正如我在代码中提到的,这一行产生了错误 smgr.createInstanceWithContext(" com.sun.star.frame.Desktop",CTX)

我正在尝试使用python3在ARCH LINUX上使用KDE环境构建它。

0 个答案:

没有答案