I'm extending TryPython to (along with various other things) allow users to save a file and subsequently import that file. TryPython overloads the built in file operations, so I need to know what parts of import need to hooked into in order for import to use the overloaded file operations.
我正在擴展TryPython(以及其他各種事物),允許用戶保存文件並隨后導入該文件。 TryPython重載內置文件操作,因此我需要知道導入的哪些部分需要掛鈎才能導入以使用重載文件操作。
Really, a basic overview of IronPython's import when used in Silverlight would be extremely helpful. I don't need a complete working solution (although I won't stop you from writing one! :). I'm a Python newbie, and I really have no idea where to even begin.
實際上,在Silverlight中使用IronPython導入的基本概述非常有用。我不需要一個完整的工作解決方案(雖然我不會阻止你寫一個!:)。我是一個Python新手,我真的不知道從哪里開始。
Thanks!
謝謝!
1 个解决方案
#1
2
IronPython's import basically works as usual but the file system is abstracted away in Silverlight. This is done by the DLR hosting API's PlatformAdaptionLayer. The end result is that all requests for files to be imported go to the XAP file rather than going to the file system.
IronPython的導入基本上和往常一樣,但文件系統在Silverlight中被抽象出來。這是由DLR托管API的PlatformAdaptionLayer完成的。最終結果是所有要導入的文件請求都轉到XAP文件而不是轉到文件系統。
I would suggest using one of the various ways you can replace importing functionality. You could either redefine import or better yet use the importer hooks
我建議使用各種方法中的一種來替換導入功能。您可以重新定義導入或更好地使用導入程序掛鈎