コード例 #1
0
 def load(self, path):
     """fill document with information from .profile file"""
     from solipsis.services.profile.editor.file_document import FileDocument
     doc = FileDocument()
     result = doc.load(path)
     self.import_document(doc)
     return result
コード例 #2
0
 def on_import(self, event):
     """match current filter with given profile"""
     dlg = wx.FileDialog(
         self, message="Match profile ...",
         defaultDir=get_prefs("profile_dir"),
         defaultFile="",
         wildcard="Solipsis file (*.prf)|*.prf",
         style=wx.OPEN)
     if dlg.ShowModal() == wx.ID_OK:
         path = dlg.GetPath()[:-4]
         loader = FileDocument()
         loader.load(path + PROFILE_EXT)
         get_facade().fill_data(loader.get_pseudo(), loader)
         get_filter_facade().match(PeerDescriptor(loader.get_pseudo(),
                                                  document = loader))
     event.Skip()