コード例 #1
0
    def refreshCtrl(self):
        ListCtrlView.refreshCtrl(self)
        i = 0
        modSort = self.model.modules.keys()
        modSort.sort()
        for mod in modSort:
            # XXX Show a broken icon as default
            imgIdx = -1
            modTpe = 'Unknown'
            if self.model.moduleModels.has_key(mod):
                imgIdx = self.model.moduleModels[mod].imgIdx
                modTpe = self.model.moduleModels[mod].modelIdentifier
            else:
                self.model.idModel(mod)
                if self.model.moduleModels.has_key(mod):
                    imgIdx = self.model.moduleModels[mod].imgIdx
                    modTpe = self.model.moduleModels[mod].modelIdentifier

            appMod = self.model.modules[mod]

            if appMod[0]:
                modTpe = '*%s*' % modTpe

            i = self.addReportItems(i, (mod, modTpe, appMod[1], appMod[2]),
                                    imgIdx)

        self.pastelise()
コード例 #2
0
ファイル: AppViews.py プロジェクト: nyimbi/boa-constructor
    def refreshCtrl(self):
        ListCtrlView.refreshCtrl(self)
        i = 0
        modSort = self.model.modules.keys()
        modSort.sort()
        for mod in modSort:
            # XXX Show a broken icon as default
            imgIdx = -1
            modTpe = "Unknown"
            if self.model.moduleModels.has_key(mod):
                imgIdx = self.model.moduleModels[mod].imgIdx
                modTpe = self.model.moduleModels[mod].modelIdentifier
            else:
                self.model.idModel(mod)
                if self.model.moduleModels.has_key(mod):
                    imgIdx = self.model.moduleModels[mod].imgIdx
                    modTpe = self.model.moduleModels[mod].modelIdentifier

            appMod = self.model.modules[mod]

            if appMod[0]:
                modTpe = "*%s*" % modTpe

            i = self.addReportItems(i, (mod, modTpe, appMod[1], appMod[2]), imgIdx)

        self.pastelise()
コード例 #3
0
ファイル: AppViews.py プロジェクト: nyimbi/boa-constructor
    def refreshCtrl(self):
        ListCtrlView.refreshCtrl(self)
        i = 0
        self.listResultIdxs = []
        for mod in self.results.keys():
            for result in self.results[mod]:
                self.listResultIdxs.append((mod, result))
                i = self.addReportItems(i, (os.path.basename(mod), ` result[0] `, ` result[1] `, result[2].strip()))

        self.model.editor.statusBar.setHint(_('%d matches of "%s".') % (i, self.findPattern))

        self.pastelise()
コード例 #4
0
ファイル: ProfileView.py プロジェクト: aricsanders/boa
 def refreshCtrl(self):
     ListCtrlView.refreshCtrl(self)
     if self.stats:
         self.statKeyList = self.stats.keys()
         self.statKeyList.sort()
         i = 0
         for filename, lineno, funcname in self.statKeyList:
             stats = self.stats[(filename, lineno, funcname)]
             i = self.addReportItems(
                 i, (os.path.basename(filename), str(lineno), funcname,
                     '%d' % stats[0], '%f' % stats[2], stats[0] and '%f' %
                     (stats[2] / stats[0]) or '', '%f' % stats[3],
                     stats[0] and '%f' % (stats[3] / stats[0]) or ''))
             self.SetItemData(i - 1, i - 1)
     self.pastelise()
コード例 #5
0
    def refreshCtrl(self):
        ListCtrlView.refreshCtrl(self)
        i = 0
        self.listResultIdxs = []
        for mod in self.results.keys():
            for result in self.results[mod]:
                self.listResultIdxs.append((mod, result))
                i = self.addReportItems(i,
                                        (os.path.basename(mod), ` result[0]
                                         `, ` result[1] `, result[2].strip()))

        self.model.editor.statusBar.setHint(
            _('%d matches of "%s".') % (i, self.findPattern))

        self.pastelise()
コード例 #6
0
ファイル: ProfileView.py プロジェクト: cwt/boa-constructor
 def refreshCtrl(self):
     ListCtrlView.refreshCtrl(self)
     if self.stats:
         self.statKeyList = self.stats.keys()
         self.statKeyList.sort()
         i = 0
         for filename, lineno, funcname in self.statKeyList:
             stats = self.stats[(filename, lineno, funcname)]
             i = self.addReportItems(i, (os.path.basename(filename), str(lineno),
                   funcname, '%d' % stats[0], '%f' % stats[2],
                   stats[0] and '%f' % (stats[2]/stats[0]) or '',
                   '%f' % stats[3],
                   stats[0] and '%f' % (stats[3]/stats[0]) or ''))
             self.SetItemData(i-1, i-1)
     self.pastelise()
コード例 #7
0
    def refreshCtrl(self):
        ListCtrlView.refreshCtrl(self)

        todos = []
        prog = 0
        from Models.PythonEditorModels import ModuleModel
        absModPaths = self.model.absModulesPaths()
        progStep = 100.0 / len(absModPaths)
        for module in absModPaths:
            #module = 'file://'+absModPath
            self.model.editor.statusBar.progress.SetValue(int(prog * progStep))
            prog += 1
            self.model.editor.setStatus(_('Parsing %s...') % module)
            #module = self.modules[moduleName]
            #filename = self.normaliseModuleRelativeToApp(module[2])
            if module[:7] != 'file://':
                print _(
                    '%s skipped, only local files supported for Imports View')
                continue
            else:
                fn = module[7:]
            try:
                f = open(fn)
            except IOError:
                print _("couldn't load %s") % module
                continue
            else:
                data = f.read()
                f.close()
                name = os.path.splitext(os.path.basename(module))[0]
                model = ModuleModel(data, name, self.model.editor, 1)

                m = model.getModule()
                if m.todos:
                    todos.append((name, len(m.todos), module))

        self.model.editor.statusBar.progress.SetValue(0)
        self.model.editor.setStatus(_('Finished parsing'))

        i = 0
        for name, numTodos, path in todos:
            self.addReportItems(i, (name, numTodos, path))
            i += 1

        self.pastelise()

        self.todos = todos
コード例 #8
0
ファイル: AppViews.py プロジェクト: nyimbi/boa-constructor
    def refreshCtrl(self):
        ListCtrlView.refreshCtrl(self)

        todos = []
        prog = 0
        from Models.PythonEditorModels import ModuleModel

        absModPaths = self.model.absModulesPaths()
        progStep = 100.0 / len(absModPaths)
        for module in absModPaths:
            # module = 'file://'+absModPath
            self.model.editor.statusBar.progress.SetValue(int(prog * progStep))
            prog += 1
            self.model.editor.setStatus(_("Parsing %s...") % module)
            # module = self.modules[moduleName]
            # filename = self.normaliseModuleRelativeToApp(module[2])
            if module[:7] != "file://":
                print _("%s skipped, only local files supported for Imports View")
                continue
            else:
                fn = module[7:]
            try:
                f = open(fn)
            except IOError:
                print _("couldn't load %s") % module
                continue
            else:
                data = f.read()
                f.close()
                name = os.path.splitext(os.path.basename(module))[0]
                model = ModuleModel(data, name, self.model.editor, 1)

                m = model.getModule()
                if m.todos:
                    todos.append((name, len(m.todos), module))

        self.model.editor.statusBar.progress.SetValue(0)
        self.model.editor.setStatus(_("Finished parsing"))

        i = 0
        for name, numTodos, path in todos:
            self.addReportItems(i, (name, numTodos, path))
            i += 1

        self.pastelise()

        self.todos = todos
コード例 #9
0
    def refreshCtrl(self):
        ListCtrlView.refreshCtrl(self)

        from Models.PythonEditorModels import BaseAppModel
        otherApp = BaseAppModel('', self.compareTo, '', self.model.editor,
                                True, {})

        from Explorers.Explorer import openEx
        otherApp.transport = openEx(self.compareTo)

        otherApp.load()
        otherApp.readModules()

        filename, otherFilename = self.model.assertLocalFile(
        ), otherApp.assertLocalFile()

        i = 0
        # Compare apps
        if not cmp(filename, otherFilename):
            i = self.addReportItems(i, (os.path.splitext(
                os.path.basename(filename))[0], otherFilename, _('changed')))

        # Find changed modules and modules not occuring in other module
        for module in self.model.modules.keys():
            if otherApp.modules.has_key(module):
                otherFile = otherApp.assertLocalFile(
                    otherApp.moduleFilename(module))
                filename = self.model.assertLocalFile(
                    self.model.moduleFilename(module))
                try:
                    if not cmp(filename, otherFile):
                        i = self.addReportItems(
                            i, (module, otherFile, _('changed')))
                except OSError:
                    pass
            else:
                i = self.addReportItems(i, (module, '', _('deleted')))

        # Find modules only occuring in other module
        for module in otherApp.modules.keys():
            if not self.model.modules.has_key(module):
                #otherFile = otherApp.moduleFilename(module)
                i = self.addReportItems(i, (module, '', _('added')))

        self.pastelise()
コード例 #10
0
ファイル: AppViews.py プロジェクト: nyimbi/boa-constructor
    def refreshCtrl(self):
        ListCtrlView.refreshCtrl(self)

        from Models.PythonEditorModels import BaseAppModel

        otherApp = BaseAppModel("", self.compareTo, "", self.model.editor, True, {})

        from Explorers.Explorer import openEx

        otherApp.transport = openEx(self.compareTo)

        otherApp.load()
        otherApp.readModules()

        filename, otherFilename = self.model.assertLocalFile(), otherApp.assertLocalFile()

        i = 0
        # Compare apps
        if not cmp(filename, otherFilename):
            i = self.addReportItems(i, (os.path.splitext(os.path.basename(filename))[0], otherFilename, _("changed")))

        # Find changed modules and modules not occuring in other module
        for module in self.model.modules.keys():
            if otherApp.modules.has_key(module):
                otherFile = otherApp.assertLocalFile(otherApp.moduleFilename(module))
                filename = self.model.assertLocalFile(self.model.moduleFilename(module))
                try:
                    if not cmp(filename, otherFile):
                        i = self.addReportItems(i, (module, otherFile, _("changed")))
                except OSError:
                    pass
            else:
                i = self.addReportItems(i, (module, "", _("deleted")))

        # Find modules only occuring in other module
        for module in otherApp.modules.keys():
            if not self.model.modules.has_key(module):
                # otherFile = otherApp.moduleFilename(module)
                i = self.addReportItems(i, (module, "", _("added")))

        self.pastelise()