當前位置: 首頁>>代碼示例>>Python>>正文


Python Explorer.openEx方法代碼示例

本文整理匯總了Python中Explorers.Explorer.openEx方法的典型用法代碼示例。如果您正苦於以下問題:Python Explorer.openEx方法的具體用法?Python Explorer.openEx怎麽用?Python Explorer.openEx使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Explorers.Explorer的用法示例。


在下文中一共展示了Explorer.openEx方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from Explorers import Explorer [as 別名]
# 或者: from Explorers.Explorer import openEx [as 別名]
    def __init__(self, parent, editor, resourceFilename, imageName='',
          onlyIcons=False):
        self._init_ctrls(parent)

        from Explorers import Explorer

        model = PyResourceBitmapModel('', resourceFilename, editor, True)
        model.transport = Explorer.openEx(resourceFilename)
        model.load(notify=False)
        self.resources = PyResourceImagesSelectionView(self, model,
              listStyle=wx.LC_SMALL_ICON | wx.LC_ALIGN_TOP,
              imgLstStyle=wx.IMAGE_LIST_SMALL)
        self.resources.onlyIcons = onlyIcons

        self.boxSizerMain.Prepend(self.resources, 1,
                                  wx.LEFT|wx.RIGHT|wx.TOP|wx.GROW, 15)
        self.resources.refreshCtrl()

        if imageName:
            sel = -1
            for idx, r in zip(range(len(self.resources.imageSrcInfo)),
                              self.resources.imageSrcInfo):
                if r[0] == imageName:
                    sel = idx
                    break

            if sel != -1:
                self.resources.Select(sel)
                self.resources.EnsureVisible(sel)

        self.resources.SetFocus()
開發者ID:cbaeseman,項目名稱:boa-constructor,代碼行數:33,代碼來源:ResourceSupport.py

示例2: OnEditIndex

# 需要導入模塊: from Explorers import Explorer [as 別名]
# 或者: from Explorers.Explorer import openEx [as 別名]
    def OnEditIndex(self, event):
        if self.selected != -1:
            keyword, location, c = self.model.indexes[self.selected]

            docsDir = os.path.dirname(self.model.filename)
            try:
                data = Explorer.openEx(
                      os.path.join(docsDir, location.split('#')[0])).load()
            except ExplorerNodes.TransportLoadError:
                data = ''
            prs = parseHelpFile(data, HtmlDocDetailParser)
            dlg = createIndexDlg(None, keyword, location, prs.anchors)
            try:
                if dlg.ShowModal() != wx.ID_OK:
                    return

                res = dlg.GetResult()
            finally:
                dlg.Destroy()

            if res != (keyword, location):
                keyword, location = res
                self.model.indexes[self.selected] = (keyword, location, None)

                self.model.setModified('indexes')
                self.updateEditor()

                self.refreshCtrl()
開發者ID:cwt,項目名稱:boa-constructor,代碼行數:30,代碼來源:HelpBook.plug-in.py

示例3: OnSaveHistory

# 需要導入模塊: from Explorers import Explorer [as 別名]
# 或者: from Explorers.Explorer import openEx [as 別名]
 def OnSaveHistory(self, event):
     fn, ok = self.editor.saveAsDlg('history.pcl', 'AllFiles')
     if ok:
         data = pickle.dumps(self.history)
         from Explorers import Explorer
         n = Explorer.openEx(fn)
         n.save(n.resourcepath, data)
開發者ID:cbaeseman,項目名稱:boa-constructor,代碼行數:9,代碼來源:ErrorStackFrm.py

示例4: writeTimes

# 需要導入模塊: from Explorers import Explorer [as 別名]
# 或者: from Explorers.Explorer import openEx [as 別名]
    def writeTimes(self):
        from cStringIO import StringIO
        timesFile = StringIO('')#open(self.getTTVFilename(), 'w')
        for start, end, desc in self.times:
            self.writeTimeEntry(timesFile, start, end, desc)
        timesFile.seek(0)

        uri = self.getTTVFilename()
        transp = Explorer.openEx(uri)
        transp.save(transp.currentFilename(), timesFile.read())
開發者ID:cwt,項目名稱:boa-constructor,代碼行數:12,代碼來源:AppTimeTrack.plug-in.py

示例5: getFunctions

# 需要導入模塊: from Explorers import Explorer [as 別名]
# 或者: from Explorers.Explorer import openEx [as 別名]
    def getFunctions(self, module):
        from Explorers import Explorer
        extPath = self.getExtPath(module)

        src = Explorer.openEx(extPath).load()
        sep = src.count('\r\n') < src.count('\n') and '\n' or '\r\n'
        srclines = src.split(sep)

        import moduleparse
        module = moduleparse.Module('test', srclines)

        return module.functions.keys()
開發者ID:cwt,項目名稱:boa-constructor,代碼行數:14,代碼來源:ExtMethDlg.py

示例6: openTransportFromProperties

# 需要導入模塊: from Explorers import Explorer [as 別名]
# 或者: from Explorers.Explorer import openEx [as 別名]
    def openTransportFromProperties(self):
        zopePath = self.properties['localpath']

        svr, name = self.getParentResource()
        res = svr.zoa.props.ExternalMethod(name)

        module = res['module']

        emf = ExtMethDlg.ExternalMethodFinder(zopePath)
        extPath = emf.getExtPath(module)

        from Explorers import Explorer
        return Explorer.openEx(extPath)
開發者ID:cbaeseman,項目名稱:boa-constructor,代碼行數:15,代碼來源:ZopeExplorer.py

示例7: doContentsDlg

# 需要導入模塊: from Explorers import Explorer [as 別名]
# 或者: from Explorers.Explorer import openEx [as 別名]
def doContentsDlg(title, text, docsDir):
    #text, anchor = (text.split('#')+[''])[:2]
    data = Explorer.openEx(os.path.join(docsDir, text.split('#')[0])).load()
    prs = parseHelpFile(data, HtmlDocDetailParser)
    if title is None:
        title = prs.title
    dlg = createContentsDlg(None, title, prs.title, text, prs.anchors)
    try:
        if dlg.ShowModal() != wx.ID_OK:
            return None, None

        title, location = dlg.GetResult()
    finally:
        dlg.Destroy()
    return title, location
開發者ID:cwt,項目名稱:boa-constructor,代碼行數:17,代碼來源:HelpBook.plug-in.py

示例8: __init__

# 需要導入模塊: from Explorers import Explorer [as 別名]
# 或者: from Explorers.Explorer import openEx [as 別名]
    def __init__(self, data, name, editor, saved):
        EditorModels.SourceModel.__init__(self, data, name, editor, saved)

        contents = os.path.splitext(name)[0]+'.hhc'
        try:
            transport = Explorer.openEx(contents)
            data = transport.load()
        except ExplorerNodes.TransportError:
            transport = None
            data = ''
        self.contentsModel = EditorModels.SourceModel(data, contents, editor, saved)
        self.contentsModel.transport = transport

        indexes = os.path.splitext(name)[0]+'.hhk'
        try:
            transport = Explorer.openEx(indexes)
            data = transport.load()
        except ExplorerNodes.TransportError:
            transport = None
            data = ''
        self.indexesModel = EditorModels.SourceModel(data, indexes, editor, saved)
        self.indexesModel.transport = transport

        self.update()
開發者ID:cwt,項目名稱:boa-constructor,代碼行數:26,代碼來源:HelpBook.plug-in.py

示例9: OnDropFiles

# 需要導入模塊: from Explorers import Explorer [as 別名]
# 或者: from Explorers.Explorer import openEx [as 別名]
    def OnDropFiles(self, x, y, files):
        docsDir = os.path.dirname(self.list.model.filename)

        for filename in files:
            data = Explorer.openEx(os.path.join(docsDir, filename)).load()
            prs = parseHelpFile(data, HtmlDocDetailParser)
            dlg = createIndexDlg(None, '', filename, prs.anchors)
            try:
                if dlg.ShowModal() != wx.ID_OK:
                    return

                keyword, location = dlg.GetResult()
            finally:
                dlg.Destroy()

            #item, flags = self.list.HitTest( (x, y) )
            self.list.model.indexes.append((keyword, location, None))

        self.list.model.setModified('indexes')
        self.list.updateEditor()

        self.list.refreshCtrl()
開發者ID:cwt,項目名稱:boa-constructor,代碼行數:24,代碼來源:HelpBook.plug-in.py

示例10: OnGetItemText

# 需要導入模塊: from Explorers import Explorer [as 別名]
# 或者: from Explorers.Explorer import openEx [as 別名]
 def OnGetItemText(self, item, col):
     f = self.model.config.files[item]
     if col == 0:
         return repr(item)
     elif col == 1:
         return os.path.basename(f)
     elif col == 2:
         return f
     elif Preferences.hbShowDocumentTitles and col == 3:
         if not self.cached[item]:
             title = ''
             try:
                 if os.path.splitext(f)[1].lower() not in ('.htm', '.html'):
                     return ''
                 docsDir = os.path.dirname(self.model.filename)
                 try: data = Explorer.openEx(os.path.join(docsDir, f)).load()
                 except ExplorerNodes.TransportError: return ''
                 fmtr = formatter.NullFormatter(formatter.NullWriter())
                 try: HtmlDocDetailParser(fmtr, breakOnTitle=True).feed(data)
                 except BreakOnTitle, title: return str(title)
                 except: return ''
                 else: return ''
             finally:
                 self.cached[item] = title
開發者ID:cwt,項目名稱:boa-constructor,代碼行數:26,代碼來源:HelpBook.plug-in.py

示例11: readTimes

# 需要導入模塊: from Explorers import Explorer [as 別名]
# 或者: from Explorers.Explorer import openEx [as 別名]
    def readTimes(self):
        from cStringIO import StringIO
        transp = Explorer.openEx(self.getTTVFilename())
        data = StringIO(transp.load())

        return map(lambda line: eval(line), data.readlines())
開發者ID:cwt,項目名稱:boa-constructor,代碼行數:8,代碼來源:AppTimeTrack.plug-in.py

示例12: OnLoadHistory

# 需要導入模塊: from Explorers import Explorer [as 別名]
# 或者: from Explorers.Explorer import openEx [as 別名]
 def OnLoadHistory(self, event):
     fn = self.editor.openFileDlg('AllFiles')
     if fn:
         from Explorers import Explorer
         data = Explorer.openEx(fn).load()
         self.history = pickle.loads(data)
開發者ID:cbaeseman,項目名稱:boa-constructor,代碼行數:8,代碼來源:ErrorStackFrm.py

示例13: OnInputDoubleClick

# 需要導入模塊: from Explorers import Explorer [as 別名]
# 或者: from Explorers.Explorer import openEx [as 別名]
 def OnInputDoubleClick(self, event):
     filename = self.editor.openFileDlg()
     if filename:
         from Explorers import Explorer
         self.inputPage.SetValue(Explorer.openEx(filename).load())
開發者ID:cbaeseman,項目名稱:boa-constructor,代碼行數:7,代碼來源:ErrorStackFrm.py


注:本文中的Explorers.Explorer.openEx方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。