Sanii
- if len(antiFlagNames) <= 0
In programming, in all languages, a list/vector/map/array... never can have size lower than 0, just >= 0.
If you want just to check the list if isn't empty, is enough to do it just with if antiFlagName, like a normal boolean, there no need check length of it if you don't use it.
About your method of antiFlagNameLines isn't related with this structure what's here, and also is hard-core for non-sense in this case.
This is just an advice, i hope you got it.
@Bitte melden Sie sich an, um diesen Link zu sehen.
You guys.. make things so complicated for a little thing, here we don't need two lists for non-sense, three for-loop and bla bla.
I would do it like this:
Bitte melden Sie sich an, um diesen Link zu sehen.
Python
- def AppendAntiflagInformation(self):
- antiFlagDict = {
- localeInfo.TOOLTIP_ANTIFLAG_DROP: item.IsAntiFlag(item.ITEM_ANTIFLAG_DROP),
- localeInfo.TOOLTIP_ANTIFLAG_SELL: item.IsAntiFlag(item.ITEM_ANTIFLAG_SELL),
- localeInfo.TOOLTIP_ANTIFLAG_GIVE: item.IsAntiFlag(item.ITEM_ANTIFLAG_GIVE),
- localeInfo.TOOLTIP_ANTIFLAG_PKDROP: item.IsAntiFlag(item.ITEM_ANTIFLAG_PKDROP),
- localeInfo.TOOLTIP_ANTIFLAG_STACK: item.IsAntiFlag(item.ITEM_ANTIFLAG_STACK),
- localeInfo.TOOLTIP_ANTIFLAG_MYSHOP: item.IsAntiFlag(item.ITEM_ANTIFLAG_MYSHOP),
- localeInfo.TOOLTIP_ANTIFLAG_SAFEBOX: item.IsAntiFlag(item.ITEM_ANTIFLAG_SAFEBOX),
- }
- antiFlagNames = [name for name, flag in antiFlagDict.iteritems() if flag]
- if antiFlagNames:
- self.AppendSpace(5)
- textLine = self.AppendTextLine('{} {}'.format(', '.join(antiFlagNames), localeInfo.NOT_POSSIBLE), self.CONDITION_COLOR)
- textLine.SetFeather()