Beispiel #1
0
 def satisfies(self,abstract):
     astv = tracks.AbstractStatusTrackViewFactory().getStatus( self._track, abstract )
     if astv.__class__ in [tracks._ASTrackViewAccepted,\
                         tracks._ASTrackViewPA]:
         if astv.getContribType() is None or astv.getContribType()=="":
             return self._showNoValue
         return astv.getContribType() in self._values
     else:
         return self._showNoValue
Beispiel #2
0
 def _checkParams(self, params):
     RHTrackAbstractsBase._checkParams(self, params)
     self._filterUsed = params.has_key(
         "OK")  #this variable is true when the
     #   filter has been used
     filter = {}
     ltypes = []
     if not self._filterUsed:
         for type in self._conf.getContribTypeList():
             ltypes.append(type)
     else:
         for id in self._normaliseListParam(params.get("selTypes", [])):
             ltypes.append(self._conf.getContribTypeById(id))
     filter["type"] = ltypes
     lstatus = []
     if not self._filterUsed:
         sl = tracks.AbstractStatusTrackViewFactory().getStatusList()
         for statusKlass in sl:
             lstatus.append(statusKlass.getId())
         pass
     filter["status"] = self._normaliseListParam(
         params.get("selStatus", lstatus))
     ltypes = []
     if not self._filterUsed:
         for type in self._conf.getContribTypeList():
             ltypes.append(type)
     else:
         for id in self._normaliseListParam(params.get("selAccTypes", [])):
             ltypes.append(self._conf.getContribTypeById(id))
     filter["acc_type"] = ltypes
     if params.has_key("selMultipleTracks"):
         filter["multiple_tracks"] = ""
     if params.has_key("selOnlyComment"):
         filter["comment"] = ""
     self._criteria = TrackAbstractsFilterCrit(self._track, filter)
     typeShowNoValue, accTypeShowNoValue = True, True
     if self._filterUsed:
         typeShowNoValue = params.has_key("typeShowNoValue")
         accTypeShowNoValue = params.has_key("accTypeShowNoValue")
     self._criteria.getField("type").setShowNoValue(typeShowNoValue)
     self._criteria.getField("acc_type").setShowNoValue(accTypeShowNoValue)
     self._sortingCrit = TrackAbstractsSortingCrit(
         self._track, [params.get("sortBy", "number").strip()])
     self._selectAll = params.get("selectAll", None)
     self._msg = params.get("directAbstractMsg", "")
     self._order = params.get("order", "down")
Beispiel #3
0
 def compare( self, a1, a2 ):
     statusA1 = tracks.AbstractStatusTrackViewFactory().getStatus( self._track, a1 )
     statusA2 = tracks.AbstractStatusTrackViewFactory().getStatus( self._track, a2 )
     return cmp( statusA1.getLabel(), statusA2.getLabel() )
Beispiel #4
0
 def satisfies( self, abstract ):
     """
     """
     s = tracks.AbstractStatusTrackViewFactory().getStatus( self._track, abstract )
     return s.getId() in self.getValues()