Ejemplo n.º 1
0
def generate_domain_page(domain):
    if domain == "index":
        file = "%s/index.html" % config.domain_path
        return produce_domain_index(file)
    sys.stderr.write("Generating domain page for %s...\n" % domain)
    file = "%s/%s.html" % (config.domain_path, domain)
    produce_domain_page(data.load_postats(), domain, file)
Ejemplo n.º 2
0
def generate_team_page(team):
    if team == "index":
        file = "%s/index.html" % config.team_path
        return produce_team_index(file)
    sys.stderr.write("Generating team page for %s...\n" % team)
    file = "%s/%s.html" % (config.team_path, team)
    produce_team_page(data.load_postats(), team, file)
Ejemplo n.º 3
0
 def __init__(self, output):
     htmlpage.Htmlpage.__init__(self, None, output)
     write = self.writer
     if not write:
         return
     postats = data.load_postats()
     self.prologue("Textual domains", 'utf-8')
     write("<p>When looking for something to translate and wishing "
           "to reach the largest amount of users, one of the basic "
           "system tools is a good choice: grep, sed, tar, findutils, "
           "coreutils, and bash.  After those: "
           "xdg-user-dirs, parts of libc and parts of util-linux-ng.  "
           "And then maybe aspell, dialog, diffutils, e2fsprogs, gawk, "
           "kbd, make, psmisc, texinfo, wget, and xkeyboard-config. </p><br>\n")
     write('  <table id="domaintable">\n'
           '   <thead>\n'
           '   <tr class="left">\n'
           '    <th>Domain</th>\n'
           '    <th>Current version</th>\n'
           '    <th>Disclaimer required</th>\n'
           '    <th>Reference</th>\n'
           '   </tr>\n'
           '   </thead>\n'
           '   <tbody>\n')
     for domain in registry.domain_list():
         if domain.disclaim:
             myclass = "disclaim"
             word = "Yes"
         else:
             myclass = "nodisclaim"
             word = ""
         write('   <tr class="{}">\n'.format(myclass)+
               '    <td><a href="{0}.html">{0}</a></td>\n'.format(domain.name))
         if len(postats) and postats.potstats.has_key(domain.name):
             hints = registry.hints(postats.potstats[domain.name][0])
             write('    <td><a href="%s">%s</a></td>\n'
                   % (hints.template_url(), hints.version))
         else:
             write('    <td>-</td>\n')
             sys.stderr.write("  * No stats for '%s'\n" % domain.name)
         write('    <td>%s</td>\n' % (word))
         if domain.ref:
             write('    <td><a href="%s">%s</a></td>\n'
                   % (domain.ref[0][1], domain.ref[0][1]))
         else:
             write('    <td>--</td>\n')
         write('   </tr>\n')
     write('  </tbody>\n  </table>\n')
     self.epilogue()