632 else: |
632 else: |
633 if self.__pdata[dataKey] != data and setDirty: |
633 if self.__pdata[dataKey] != data and setDirty: |
634 self.setDirty(True) |
634 self.setDirty(True) |
635 self.__pdata[dataKey] = data |
635 self.__pdata[dataKey] = data |
636 |
636 |
637 def getData(self, category, key): |
637 def getData(self, category, key, default=None): |
638 """ |
638 """ |
639 Public method to get data out of the project data store. |
639 Public method to get data out of the project data store. |
640 |
640 |
641 @param category category of the data to get (string, one of |
641 @param category category of the data to get (one of |
642 PROJECTTYPESPECIFICDATA, CHECKERSPARMS, PACKAGERSPARMS, |
642 PROJECTTYPESPECIFICDATA, CHECKERSPARMS, PACKAGERSPARMS, |
643 DOCUMENTATIONPARMS or OTHERTOOLSPARMS) |
643 DOCUMENTATIONPARMS or OTHERTOOLSPARMS) |
644 @param key key of the data entry to get (string). |
644 @type str |
|
645 @param key key of the data entry to get |
|
646 @type str |
|
647 @param default value to return in case the key is not found (defaults to None) |
|
648 @type Any (optional) |
645 @return a copy of the requested data or None |
649 @return a copy of the requested data or None |
646 """ |
650 """ |
647 # __IGNORE_WARNING_D202__ |
651 # __IGNORE_WARNING_D202__ |
648 if ( |
652 if ( |
649 category |
653 category |
656 ] |
660 ] |
657 and key in self.__pdata[category] |
661 and key in self.__pdata[category] |
658 ): |
662 ): |
659 return copy.deepcopy(self.__pdata[category][key]) |
663 return copy.deepcopy(self.__pdata[category][key]) |
660 else: |
664 else: |
661 return None |
665 return default |
662 |
666 |
663 def setData(self, category, key, data): |
667 def setData(self, category, key, data): |
664 """ |
668 """ |
665 Public method to store data in the project data store. |
669 Public method to store data in the project data store. |
666 |
670 |