1109 self._moduleName = '' |
1109 self._moduleName = '' |
1110 |
1110 |
1111 pixName = "" |
1111 pixName = "" |
1112 if self.isPython2File(): |
1112 if self.isPython2File(): |
1113 if self.fileext == '.py': |
1113 if self.fileext == '.py': |
1114 pixName = "filePython.png" |
1114 pixName = "filePython" |
1115 else: |
1115 else: |
1116 pixName = "filePython2.png" |
1116 pixName = "filePython2" |
1117 self._populated = False |
1117 self._populated = False |
1118 self._lazyPopulation = True |
1118 self._lazyPopulation = True |
1119 self._moduleName = os.path.basename(finfo) |
1119 self._moduleName = os.path.basename(finfo) |
1120 elif self.isPython3File(): |
1120 elif self.isPython3File(): |
1121 pixName = "filePython.png" |
1121 pixName = "filePython" |
1122 self._populated = False |
1122 self._populated = False |
1123 self._lazyPopulation = True |
1123 self._lazyPopulation = True |
1124 self._moduleName = os.path.basename(finfo) |
1124 self._moduleName = os.path.basename(finfo) |
1125 elif self.isRubyFile(): |
1125 elif self.isRubyFile(): |
1126 pixName = "fileRuby.png" |
1126 pixName = "fileRuby" |
1127 self._populated = False |
1127 self._populated = False |
1128 self._lazyPopulation = True |
1128 self._lazyPopulation = True |
1129 self._moduleName = os.path.basename(finfo) |
1129 self._moduleName = os.path.basename(finfo) |
1130 elif self.isDesignerFile(): |
1130 elif self.isDesignerFile(): |
1131 pixName = "fileDesigner.png" |
1131 pixName = "fileDesigner" |
1132 elif self.isLinguistFile(): |
1132 elif self.isLinguistFile(): |
1133 if self.fileext == '.ts': |
1133 if self.fileext == '.ts': |
1134 pixName = "fileLinguist.png" |
1134 pixName = "fileLinguist" |
1135 else: |
1135 else: |
1136 pixName = "fileLinguist2.png" |
1136 pixName = "fileLinguist2" |
1137 elif self.isResourcesFile(): |
1137 elif self.isResourcesFile(): |
1138 pixName = "fileResource.png" |
1138 pixName = "fileResource" |
1139 elif self.isProjectFile(): |
1139 elif self.isProjectFile(): |
1140 pixName = "fileProject.png" |
1140 pixName = "fileProject" |
1141 elif self.isMultiProjectFile(): |
1141 elif self.isMultiProjectFile(): |
1142 pixName = "fileMultiProject.png" |
1142 pixName = "fileMultiProject" |
1143 elif self.isIdlFile(): |
1143 elif self.isIdlFile(): |
1144 pixName = "fileIDL.png" |
1144 pixName = "fileIDL" |
1145 self._populated = False |
1145 self._populated = False |
1146 self._lazyPopulation = True |
1146 self._lazyPopulation = True |
1147 self._moduleName = os.path.basename(finfo) |
1147 self._moduleName = os.path.basename(finfo) |
1148 elif self.isProtobufFile(): |
1148 elif self.isProtobufFile(): |
1149 pixName = "protobuf.png" |
1149 pixName = "protobuf" |
1150 self._populated = False |
1150 self._populated = False |
1151 self._lazyPopulation = True |
1151 self._lazyPopulation = True |
1152 self._moduleName = os.path.basename(finfo) |
1152 self._moduleName = os.path.basename(finfo) |
1153 elif self.isSvgFile(): |
1153 elif self.isSvgFile(): |
1154 pixName = "fileSvg.png" |
1154 pixName = "fileSvg" |
1155 elif self.isPixmapFile(): |
1155 elif self.isPixmapFile(): |
1156 pixName = "filePixmap.png" |
1156 pixName = "filePixmap" |
1157 elif self.isDFile(): |
1157 elif self.isDFile(): |
1158 pixName = "fileD.png" |
1158 pixName = "fileD" |
1159 elif self.isJavaScriptFile(): |
1159 elif self.isJavaScriptFile(): |
1160 pixName = "fileJavascript.png" |
1160 pixName = "fileJavascript" |
1161 self._populated = False |
1161 self._populated = False |
1162 self._lazyPopulation = True |
1162 self._lazyPopulation = True |
1163 self._moduleName = os.path.basename(finfo) |
1163 self._moduleName = os.path.basename(finfo) |
1164 else: |
1164 else: |
1165 pixName = "fileMisc.png" |
1165 pixName = "fileMisc" |
1166 |
1166 |
1167 if os.path.lexists(self._filename) and os.path.islink(self._filename): |
1167 if os.path.lexists(self._filename) and os.path.islink(self._filename): |
1168 self.symlink = True |
1168 self.symlink = True |
1169 self.icon = UI.PixmapCache.getSymlinkIcon(pixName) |
1169 self.icon = UI.PixmapCache.getSymlinkIcon(pixName) |
1170 else: |
1170 else: |
1422 self.isenum = isinstance( |
1422 self.isenum = isinstance( |
1423 self._classObject, |
1423 self._classObject, |
1424 Utilities.ClassBrowsers.ClbrBaseClasses.Enum) |
1424 Utilities.ClassBrowsers.ClbrBaseClasses.Enum) |
1425 if self.isfunction: |
1425 if self.isfunction: |
1426 if cl.isPrivate(): |
1426 if cl.isPrivate(): |
1427 self.icon = UI.PixmapCache.getIcon("method_private.png") |
1427 self.icon = UI.PixmapCache.getIcon("method_private") |
1428 elif cl.isProtected(): |
1428 elif cl.isProtected(): |
1429 self.icon = UI.PixmapCache.getIcon("method_protected.png") |
1429 self.icon = UI.PixmapCache.getIcon("method_protected") |
1430 else: |
1430 else: |
1431 self.icon = UI.PixmapCache.getIcon("method.png") |
1431 self.icon = UI.PixmapCache.getIcon("method") |
1432 self.itemData[0] = "{0}({1})".format( |
1432 self.itemData[0] = "{0}({1})".format( |
1433 name, ", ".join(self._classObject.parameters)) |
1433 name, ", ".join(self._classObject.parameters)) |
1434 if self._classObject.annotation: |
1434 if self._classObject.annotation: |
1435 self.itemData[0] = "{0} {1}".format( |
1435 self.itemData[0] = "{0} {1}".format( |
1436 self.itemData[0], self._classObject.annotation) |
1436 self.itemData[0], self._classObject.annotation) |
1437 ## if no defaults are wanted |
1437 ## if no defaults are wanted |
1438 ## ....format(name, |
1438 ## ....format(name, |
1439 ## ", ".join([e.split('=')[0].strip() \ |
1439 ## ", ".join([e.split('=')[0].strip() \ |
1440 ## for e in self._classObject.parameters])) |
1440 ## for e in self._classObject.parameters])) |
1441 elif self.ismodule: |
1441 elif self.ismodule: |
1442 self.icon = UI.PixmapCache.getIcon("module.png") |
1442 self.icon = UI.PixmapCache.getIcon("module") |
1443 elif self.isenum: |
1443 elif self.isenum: |
1444 self.icon = UI.PixmapCache.getIcon("attribute.png") |
1444 self.icon = UI.PixmapCache.getIcon("attribute") |
1445 else: |
1445 else: |
1446 if cl.isPrivate(): |
1446 if cl.isPrivate(): |
1447 self.icon = UI.PixmapCache.getIcon("class_private.png") |
1447 self.icon = UI.PixmapCache.getIcon("class_private") |
1448 elif cl.isProtected(): |
1448 elif cl.isProtected(): |
1449 self.icon = UI.PixmapCache.getIcon("class_protected.png") |
1449 self.icon = UI.PixmapCache.getIcon("class_protected") |
1450 else: |
1450 else: |
1451 self.icon = UI.PixmapCache.getIcon("class.png") |
1451 self.icon = UI.PixmapCache.getIcon("class") |
1452 if ( |
1452 if ( |
1453 self._classObject and |
1453 self._classObject and |
1454 (self._classObject.methods or |
1454 (self._classObject.methods or |
1455 self._classObject.classes or |
1455 self._classObject.classes or |
1456 self._classObject.attributes) |
1456 self._classObject.attributes) |
1555 self._filename = filename |
1555 self._filename = filename |
1556 if ( |
1556 if ( |
1557 self._functionObject.modifier == |
1557 self._functionObject.modifier == |
1558 Utilities.ClassBrowsers.ClbrBaseClasses.Function.Static |
1558 Utilities.ClassBrowsers.ClbrBaseClasses.Function.Static |
1559 ): |
1559 ): |
1560 self.icon = UI.PixmapCache.getIcon("method_static.png") |
1560 self.icon = UI.PixmapCache.getIcon("method_static") |
1561 elif ( |
1561 elif ( |
1562 self._functionObject.modifier == |
1562 self._functionObject.modifier == |
1563 Utilities.ClassBrowsers.ClbrBaseClasses.Function.Class |
1563 Utilities.ClassBrowsers.ClbrBaseClasses.Function.Class |
1564 ): |
1564 ): |
1565 self.icon = UI.PixmapCache.getIcon("method_class.png") |
1565 self.icon = UI.PixmapCache.getIcon("method_class") |
1566 elif self._functionObject.isPrivate(): |
1566 elif self._functionObject.isPrivate(): |
1567 self.icon = UI.PixmapCache.getIcon("method_private.png") |
1567 self.icon = UI.PixmapCache.getIcon("method_private") |
1568 elif self._functionObject.isProtected(): |
1568 elif self._functionObject.isProtected(): |
1569 self.icon = UI.PixmapCache.getIcon("method_protected.png") |
1569 self.icon = UI.PixmapCache.getIcon("method_protected") |
1570 else: |
1570 else: |
1571 self.icon = UI.PixmapCache.getIcon("method.png") |
1571 self.icon = UI.PixmapCache.getIcon("method") |
1572 self.itemData[0] = "{0}({1})".format( |
1572 self.itemData[0] = "{0}({1})".format( |
1573 name, ", ".join(self._functionObject.parameters)) |
1573 name, ", ".join(self._functionObject.parameters)) |
1574 if self._functionObject.annotation: |
1574 if self._functionObject.annotation: |
1575 self.itemData[0] = "{0} {1}".format( |
1575 self.itemData[0] = "{0} {1}".format( |
1576 self.itemData[0], self._functionObject.annotation) |
1576 self.itemData[0], self._functionObject.annotation) |
1747 |
1747 |
1748 self.type_ = BrowserItemAttribute |
1748 self.type_ = BrowserItemAttribute |
1749 self._attributeObject = attribute |
1749 self._attributeObject = attribute |
1750 self.__public = attribute.isPublic() |
1750 self.__public = attribute.isPublic() |
1751 if isClass: |
1751 if isClass: |
1752 self.icon = UI.PixmapCache.getIcon("attribute_class.png") |
1752 self.icon = UI.PixmapCache.getIcon("attribute_class") |
1753 elif attribute.isPrivate(): |
1753 elif attribute.isPrivate(): |
1754 self.icon = UI.PixmapCache.getIcon("attribute_private.png") |
1754 self.icon = UI.PixmapCache.getIcon("attribute_private") |
1755 elif attribute.isProtected(): |
1755 elif attribute.isProtected(): |
1756 self.icon = UI.PixmapCache.getIcon("attribute_protected.png") |
1756 self.icon = UI.PixmapCache.getIcon("attribute_protected") |
1757 else: |
1757 else: |
1758 self.icon = UI.PixmapCache.getIcon("attribute.png") |
1758 self.icon = UI.PixmapCache.getIcon("attribute") |
1759 |
1759 |
1760 def isPublic(self): |
1760 def isPublic(self): |
1761 """ |
1761 """ |
1762 Public method returning the public visibility status. |
1762 Public method returning the public visibility status. |
1763 |
1763 |