Exemplo n.º 1
0
 def m_strLongitude(self):
     return GCEarthData.GetTextLongitude(self.m_fLongitude)
Exemplo n.º 2
0
    def formatRtf(self, stream):
        p = self.GetCurrentDay()
        loc = self.calendar.m_Location
        vc = p.date

        sb = GCStringBuilder(stream)
        sb.Format = SBTF_RTF
        sb.fontSizeH1 = GCLayoutData.textSizeH1
        sb.fontSizeH2 = GCLayoutData.textSizeH2
        sb.fontSizeText = GCLayoutData.textSizeText
        sb.fontSizeNote = GCLayoutData.textSizeNote

        sb.AppendDocumentHeader()

        stream.write("\\f2\\fs{} {} ".format(GCLayoutData.textSizeH1, vc.GetDateTextWithTodayExt()))
        stream.write("\\par\\f2\\fs{} {{\\fs{} {} }}\\line {} ({}, {}, Timezone: {})\\par\r\n\\par\r\n  {}, {} {}\\par\r\n  {} {}, {} Gaurabda\\par\r\n\\par\r\n".format( GCLayoutData.textSizeText, GCLayoutData.textSizeText+4, GCStrings.getString(p.date.dayOfWeek), loc.m_strName, GCEarthData.GetTextLatitude(loc.m_fLatitude), GCEarthData.GetTextLongitude(loc.m_fLongitude), GCTimeZone.GetTimeZoneName(loc.m_nTimezoneId), GCStrings.GetTithiName(p.astrodata.nTithi), GCStrings.GetPaksaName(p.astrodata.nPaksa), GCStrings.getString(20), GCStrings.GetMasaName(p.astrodata.nMasa), GCStrings.getString(22), p.astrodata.nGaurabdaYear))

        self.WriteTodayInfo(sb,p)
Exemplo n.º 3
0
    def writeHtml(self, stream):
        d = self.details
        vc = GCGregorianDate(date=self.eventTime)
        m_earth = self.m_location.GetEarthData()

        stream.write("<html><head><title>Appearance day</title>")
        stream.write(
            "<style>\n<!--\nbody {\n  font-family:Verdana;\n  font-size:11pt;\n}\n\ntd.hed {\n  font-size:11pt;\n  font-weight:bold;\n"
        )
        stream.write(
            "  background:#aaaaaa;\n  color:white;\n  text-align:center;\n  vertical-align:center;\n  padding-left:15pt;\n  padding-right:15pt;\n"
        )
        stream.write(
            "  padding-top:5pt;\n  padding-bottom:5pt;\n}\n-->\n</style>\n")
        stream.write("</head>\n\n<body>\n")
        stream.write("<h2 align=center>Appearance day Calculation</h2>")
        stream.write("<table align=center><tr><td valign=top>\n\n")
        stream.write("<table align=center>")
        stream.write("<tr><td colspan=3 class=hed>Details</td></tr>\n")
        stream.write("<tr><td colspan=2>{}</td><td> {}</td></tr>\n".format(
            GCStrings.getString(7), vc))
        stream.write(
            "<tr><td colspan=2>{}</td><td> {}:{:02d}</td></tr>\n\n".format(
                GCStrings.getString(8), vc.GetHour(), vc.GetMinuteRound()))
        stream.write("<tr><td colspan=2>{}</td><td> {}</td></tr>\n".format(
            GCStrings.getString(9), self.m_location.m_strName))
        stream.write("<tr><td colspan=2>{}</td><td> {}</td></tr>\n".format(
            GCStrings.getString(10),
            GCEarthData.GetTextLatitude(self.m_location.m_fLatitude)))
        stream.write("<tr><td colspan=2>{}</td><td> {}</td></tr>\n".format(
            GCStrings.getString(11),
            GCEarthData.GetTextLongitude(self.m_location.m_fLongitude)))
        stream.write("<tr><td colspan=2>{}</td><td> ".format(
            GCStrings.getString(12)))
        stream.write(
            GCTimeZone.GetTimeZoneOffsetText(self.m_location.m_fTimezone))
        stream.write("</td></tr>\n")
        stream.write("<tr><td colspan=2>DST</td><td>N/A</td></tr>\n")
        stream.write("<tr><td colspan=2>{}</td><td> {}</td></tr>\n".format(
            GCStrings.getString(13), GCStrings.GetTithiName(d.nTithi)))
        stream.write(
            "<tr><td colspan=2>{}</td><td> {:.2f} %</td></tr>\n".format(
                GCStrings.getString(14), d.nTithiElapse))
        stream.write("<tr><td colspan=2>{}</td><td> {}</td></tr>\n".format(
            GCStrings.getString(15), GCStrings.GetNaksatraName(d.nNaksatra)))
        stream.write(
            "<tr><td colspan=2>{}</td><td> {:.2f} %</td></tr>\n".format(
                GCStrings.getString(16), d.nNaksatraElapse))
        stream.write("<tr><td colspan=2>{}</td><td> {}</td></tr>\n".format(
            GCStrings.getString(20), GCStrings.GetPaksaName(d.nPaksa)))
        if (self.b_adhika == True):
            stream.write(
                "<tr><td colspan=2>{}</td><td> {} {}</td></tr>\n".format(
                    GCStrings.getString(22), GCStrings.GetMasaName(d.nMasa),
                    GCStrings.getString(21)))
        else:
            stream.write("<tr><td colspan=2>{}</td><td> {}</td></tr>\n".format(
                GCStrings.getString(22), GCStrings.GetMasaName(d.nMasa)))
        stream.write("<tr><td colspan=2>{}</td><td> {}</td></tr>\n\n".format(
            GCStrings.getString(23), d.nGaurabdaYear))

        stream.write("</table></td><td valign=top><table>")
        stream.write("<tr><td colspan=3 class=hed>{}</td></tr>\n".format(
            GCStrings.getString(24)))

        for o in range(TRESULT_APP_CELEBS):
            stream.write(
                "<tr><td>Gaurabda {}</td><td>&nbsp;&nbsp;:&nbsp;&nbsp;</td><td><b>{}</b></td></tr>"
                .format(self.celeb_gy[o], self.celeb_date[o]))
        stream.write("</table>")
        stream.write("</td></tr></table>\n\n")
        stream.write(
            "<hr align=center width=\"50%\">\n<p style=\'text-align:center;font-size:8pt\'>Generated by {}</p>"
            .format(GCStrings.getString(130)))
        stream.write("</body></html>")
Exemplo n.º 4
0
    def formatPlain(self, stream):
        p = self.GetCurrentDay()
        loc = self.calendar.m_Location
        vc = p.date

        sb = GCStringBuilder(stream)
        sb.Format = SBTF_TEXT

        if (p == None): return

        stream.write("{} ({}, {}, Timezone: {})\r\n\r\n[{} - {}]\r\n  {}, {} {}\r\n  {} {}, {} Gaurabda\r\n\r\n".format(loc.m_strName, GCEarthData.GetTextLatitude(loc.m_fLatitude), GCEarthData.GetTextLongitude(loc.m_fLongitude), GCTimeZone.GetTimeZoneName(loc.m_nTimezoneId), vc, GCStrings.getString(vc.dayOfWeek), GCStrings.GetTithiName(p.astrodata.nTithi), GCStrings.GetPaksaName(p.astrodata.nPaksa), GCStrings.getString(20), GCStrings.GetMasaName(p.astrodata.nMasa), GCStrings.getString(22), p.astrodata.nGaurabdaYear))

        self.WriteTodayInfo(sb,p)