我希望使用def read_buffer_line(f):
line = ""
while not f.channel.exit_status_ready():
c = f.read(1)
if c == '\n':
yield line
line = ''
else:
line += c
yield line + f.read()
def ssh_run(ssh, cmd):
stdin, stdout, sterr = ssh.exec_command(cmd, get_pty=True, bufsize=1)
for l in read_buffer_line(stdout):
print l
应用程序为Excel加载项设置最低manifest.xml
。
首先,我制作了一个非常小且工作正常的mean-stack
,其中manifest.xml
是我机器上的文件。
aLocalFile.html
然后,我使用<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp
xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
<Id>eae66e72-84b6-4eed-b1b2-ba6fdbdb3ecf</Id>
<Version>1.0.0.0</Version>
<ProviderName>Microsoft</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Test"/>
<Description DefaultValue="Test"/>
<Capabilities>
<Capability Name="Workbook" />
</Capabilities>
<DefaultSettings>
<SourceLocation DefaultValue="https://localhost/aLocalFile.html" />
</DefaultSettings>
<Permissions>ReadWriteDocument</Permissions>
</OfficeApp>
在本地启动我的应用程序,因此我可以在浏览器中打开由npm start
等应用程序提供的静态网页。 (https://localhost:3000/customFunction/page.html
的内容仅为page.html
)
但是,如果我在<html><body>hello</body></html>
,manifest.xml
中替换<SourceLocation DefaultValue="https://localhost/aLocalFile.html" />
,则加载项将无法正确加载。我尝试在Excel Online上加载它,它给了我一个错误:<SourceLocation DefaultValue="https://localhost:3000/customFunction/page.html" />
点击Add-in Error Something went wrong and we couldn't start this add-in. Please try again later or contact your system administrator.
后,它给了我Retry
。然后点击Add-in Error This add-in may not load properly, but you can still try to start it.
会打开该页面。
有谁知道这里有什么问题?
修改1:我还尝试了START
其中<SourceLocation DefaultValue="https://localhost:3000/aPage" />
是应用程序的aPage
页面,它可以正常运行。所以似乎麻烦主要来自提供静态文件。