eric6/UI/BrowserModel.py

changeset 8243
cc717c2ae956
parent 8235
78e6d29eb773
child 8260
2161475d9639
equal deleted inserted replaced
8242:aa713ac50c0d 8243:cc717c2ae956
8 """ 8 """
9 9
10 import os 10 import os
11 import fnmatch 11 import fnmatch
12 import json 12 import json
13 import contextlib
13 14
14 from PyQt5.QtCore import ( 15 from PyQt5.QtCore import (
15 QDir, QModelIndex, QAbstractItemModel, QFileSystemWatcher, Qt, QProcess, 16 QDir, QModelIndex, QAbstractItemModel, QFileSystemWatcher, Qt, QProcess,
16 QCoreApplication 17 QCoreApplication
17 ) 18 )
646 for key in keys: 647 for key in keys:
647 if key.startswith("@@"): 648 if key.startswith("@@"):
648 # special treatment done later 649 # special treatment done later
649 continue 650 continue
650 cl = dictionary[key] 651 cl = dictionary[key]
651 try: 652 with contextlib.suppress(AttributeError):
652 if cl.module == moduleName: 653 if cl.module == moduleName:
653 node = BrowserClassItem(parentItem, cl, fileName) 654 node = BrowserClassItem(parentItem, cl, fileName)
654 self._addItem(node, parentItem) 655 self._addItem(node, parentItem)
655 except AttributeError:
656 pass
657 if "@@Coding@@" in keys and Preferences.getUI("BrowserShowCoding"): 656 if "@@Coding@@" in keys and Preferences.getUI("BrowserShowCoding"):
658 node = BrowserCodingItem( 657 node = BrowserCodingItem(
659 parentItem, 658 parentItem,
660 QCoreApplication.translate("BrowserModel", "Coding: {0}") 659 QCoreApplication.translate("BrowserModel", "Coding: {0}")
661 .format(dictionary["@@Coding@@"].coding), 660 .format(dictionary["@@Coding@@"].coding),

eric ide

mercurial