def zeichne_kalender(self, im, x0, y0):
     d = self.von
     difference1 = datetime.timedelta(days=1)
     x = x0
     y = y0
     th = self.TextFontSize + 2
     w = 0
     for c in range(7):
         w = w + 1
         im.rect(x, y, self.TagBreite, th)
         s = wnf_tools.cWochentageL[c]
         if (c == self.wochentag_i) and (self.FarbeHeute <> self.FarbeTransparent):
             im.text_box_c(x + 1, y + 1, self.TagBreite-2, th, s, self.FarbeHeute)
         elif (w == 7) and (self.FarbeSA <> self.FarbeTransparent):
             im.text_box_c(x + 1, y + 1, self.TagBreite-2, th, s, self.FarbeSO)
         elif (w == 6) and (self.FarbeSA <> self.FarbeTransparent):
             im.text_box_c(x + 1, y + 1, self.TagBreite-2, th, s, self.FarbeSA)
         elif (self.FarbeNormal <> self.FarbeTransparent):
             im.text_box_c(x + 1, y + 1, self.TagBreite-2, th, s, self.FarbeNormal)
         else:
             im.text_nc(x + 2, y + 2, self.TagBreite-2, s)
         x = x + self.TagBreite + self.TagRand
     y = y0 + th + self.TagRand
     for z in range(4):
         x = x0
         w = 0
         for c in range(7):
             w = w + 1
             cl = self.FarbeTransparent
             if (d == self.heute):
                 cl = self.FarbeHeute
             elif (wnf_tools.sFeiertag(d, self.Bundesland) <> ""):
                 cl = self.FarbeFT
             elif (w == 7):
                 cl = self.FarbeSO
             elif (w == 6):
                 cl = self.FarbeSA
             else:
                 cl = self.FarbeNormal
             if (cl <> self.FarbeTransparent):
                 im.rectclrand(x, y, self.TagBreite, self.TagHoehe, cl)
             else:
                 im.rect(x, y, self.TagBreite, self.TagHoehe)
             s = wnf_tools.dateToStr(d)
             if (cl<>self.FarbeTransparent):
                 im.text_box_c(x + 1, y + 2, self.TagBreite-2, th, s, cl)
             else:
                 im.text_nc(x + 1, y + 2, self.TagBreite-2, s)
             for i in range(4):
                 s, cl = self.get_termin(d, i)
                 if s <> "":
                     print d, s.encode("utf-8"), cl
                     im.text_box_c(x + 1, y + 2 + (th * (i + 1)), self.TagBreite-2, th, s, cl)
             if (self.CountDown >= self.heute) and (self.CountDown >= d) and(d >= self.heute):
                 cd = self.CountDown -d
                 s = str(cd.days)
                 im.text_countdown(x, y, self.TagBreite, self.TagHoehe, s, self.CountDownFont, self.CountDownFontSize, self.FarbeCountDown)
             d = d + difference1
             x = x + self.TagBreite + self.TagRand
         y = y + self.TagHoehe + self.TagRand
 def ausgabe_html(self, aMitKopf):
     d = self.von
     difference1 = datetime.timedelta(days=1)
     t = ""
     if aMitKopf:
         t = "<html><body>\n"
     html = '%s <table border=1 width="100%%">\n' % (t)
     t = ""
     for c in range(7):
         s = wnf_tools.cWochentageL[c]
         t = '%s <th width="14%%"> %s </th>\n' % (t, s)
     html = "%s <tr>%s</tr>\n" % (html, t)
     for z in range(4):
         t = ""
         w = 0
         for c in range(7):
             w = w + 1
             if (d == self.heute) and (self.FarbeHeute <> self.FarbeTransparent):
                 cl = self.FarbeHeute
             elif (wnf_tools.sFeiertag(d, self.Bundesland) <> "") and (self.FarbeFT <> self.FarbeTransparent):
                 cl = self.FarbeFT
             elif (w == 7) and (self.FarbeSO <> self.FarbeTransparent):
                 cl = self.FarbeSO
             elif (w == 6) and (self.FarbeSA <> self.FarbeTransparent):
                 cl = self.FarbeSA
             elif (self.FarbeNormal <> self.FarbeTransparent):
                 cl = self.FarbeNormal
             else:
                 cl = self.FarbeTransparent
             if cl == self.FarbeTransparent:
                 farbe = ''
             else:
                 farbe = ' bgcolor="%s"' % wnf_tools.rgbToHTML(cl)
             s = wnf_tools.dateToStr(d)
             t = '%s<td align=center %s><b> %s </b><br />\n' % (t, farbe, s)
             for i in range(4):
                 s = self.get_termin(d, i)
                 t = "%s%s<br />\n" % (t, s[0])
             d = d + difference1
             t = "%s</td>\n" % (t)
         html = "%s <tr>%s</tr>\n" % (html, t)
     html = "%s </table>" % (html)
     if aMitKopf:
         html = "%s </body></html>" % (html)
     return html
 def ausgabe_28(self):
     b = 16
     d = self.von
     difference1 = datetime.timedelta(days=1)
     print "=" * (7 * b + 1)
     print self.caption
     print "=" * (7 * b + 1)
     s = "|%15s|%15s|%15s|%15s|%15s|%15s|%15s|" % wnf_tools.cWochentageL
     print s
     for w in range(4):
         sd = "|"
         s0 = "|"
         s1 = "|"
         s2 = "|"
         s3 = "|"
         s4 = "|"
         for t in range(7):
             sd = "%s%15s|" % (sd, wnf_tools.dateToStr(d))
             s, cl = self.get_termin(d, 0)
             s0 = "%s%15s|" % (s0, s[:14])
             s, cl = self.get_termin(d, 1)
             s1 = "%s%15s|" % (s1, s[:14])
             s, cl = self.get_termin(d, 2)
             s2 = "%s%15s|" % (s2, s[:14])
             s, cl = self.get_termin(d, 3)
             s3 = "%s%15s|" % (s3, s[:14])
             s, cl = self.get_termin(d, 4)
             s4 = "%s%15s|" % (s4, s[:14])
             d = d + difference1
         print "=" * (7 * b + 1)
         print sd
         print "-" * (7 * b + 1)
         print s0
         print s1
         print s2
         print s3
         print s4
     print "=" * (7 * b + 1)
 def ausgabe(self):
     print len(self.termine)
     for d, t in self.termine.items():
         for n, c in t.items():
             print "Datum :", wnf_tools.dateToStr(d), n