(self, fittingView, params)
| 26 | name = "prop" |
| 27 | |
| 28 | def __init__(self, fittingView, params): |
| 29 | ViewColumn.__init__(self, fittingView) |
| 30 | sAttr = Attribute.getInstance() |
| 31 | attributeSlave = params["attributeSlave"] or params["property"] |
| 32 | # This function can throw an exception if the database isn't sane |
| 33 | # We need to do a sanity check before this runs |
| 34 | info = sAttr.getAttributeInfo(attributeSlave) |
| 35 | |
| 36 | self.mask = 0 |
| 37 | self.propertyName = params["property"] |
| 38 | self.info = info |
| 39 | if params["showIcon"]: |
| 40 | if info.name == "power": |
| 41 | iconFile = "pg_small" |
| 42 | iconType = "gui" |
| 43 | else: |
| 44 | iconFile = info.iconID if info.icon else None |
| 45 | iconType = "icons" |
| 46 | if iconFile: |
| 47 | self.imageId = fittingView.imageList.GetImageIndex(iconFile, iconType) |
| 48 | else: |
| 49 | self.imageId = -1 |
| 50 | else: |
| 51 | self.imageId = -1 |
| 52 | |
| 53 | if params["displayName"] or self.imageId == -1: |
| 54 | self.columnText = info.displayName if info.displayName != "" else info.name |
| 55 | |
| 56 | def getText(self, stuff): |
| 57 | attr = getattr(stuff, self.propertyName, None) |
nothing calls this directly
no test coverage detected