示例#1
0
 def add(self, calendar, show=True, color1=None, color2=None):
     if not color1 or not color2:
         used_colors = [(item.color1, item.color2) for item in self]
         color1, color2 = choose_color(DEFAULT_COLORS, used_colors)
     info = CalendarOverlayInfo(calendar, show, color1, color2)
     info.__parent__ = self.this
     BoundRelationshipProperty.add(self, calendar, info)
     return info
示例#2
0
 def __init__(self, this, rel_type, my_role, other_role,
              filter_meanings=(ACTIVE,), filter_date=_today,
              filter_codes=()):
     BoundRelationshipProperty.__init__(
         self, this, rel_type, my_role, other_role)
     if filter_date is _today:
         self.filter_date = self.today
     else:
         self.filter_date = filter_date
     self.filter_codes = set(filter_codes)
     self.filter_meanings = filter_meanings
     self.init_filter()
示例#3
0
 def __init__(self,
              this,
              rel_type,
              my_role,
              other_role,
              filter_meanings=(ACTIVE, ),
              filter_date=_today,
              filter_codes=()):
     BoundRelationshipProperty.__init__(self, this, rel_type, my_role,
                                        other_role)
     if filter_date is _today:
         self.filter_date = self.today
     else:
         self.filter_date = filter_date
     self.filter_codes = set(filter_codes)
     self.filter_meanings = filter_meanings
     self.init_filter()
示例#4
0
 def __init__(self, this):
     BoundRelationshipProperty.__init__(self, this, URICalendarSubscription,
                                        URICalendarSubscriber,
                                        URICalendarProvider)
     # for the local grants to work
     self.__parent__ = this
示例#5
0
 def bind(self, instance, my_role, rel_type, other_role):
     return BoundRelationshipProperty(
         instance, rel_type, my_role, other_role)