コード例 #1
0
ファイル: audit_step1.py プロジェクト: kitbs/open-tran
    <th>English Phrases</th>
    <th>Total Phrases</th>
    <th>Languages</th>
    <th>License</th>
  </tr>
''' % date.fromtimestamp(stat(datadir + '/ten.db').st_ctime).strftime('%B %d, %Y')

projs = sorted(projects.values(), key = lambda p: p.total, reverse = True)
for project in projs:
    if not project.total:
        continue
    print '<tr>'
    print '\t<td><a href="%s"><img src="%s" alt=""/> %s</a></td>' \
        % (project.url, project.icon, project.name)
    print '\t<td>%s</td>' % project.branch
    print '\t<td align="right">%s</td>' % pretty_int(project.eng)
    print '\t<td align="right">%s</td>' % pretty_int(project.total)
    print '\t<td align="right">%d</td>' % project.langs
    print '\t<td>%s</td>' % project.lic
    print '</tr>'

print '''
</table>
<p>
  Notice that some of the logos might be copyrighted and their use
  might be restricted.  Open-Tran hosts them in order to make sure
  that they are always available from the same location and in order
  to avoid so-called hot-linking.
</p>
</div>
'''
コード例 #2
0
    <th>Total Phrases</th>
    <th>Languages</th>
    <th>License</th>
  </tr>
''' % date.fromtimestamp(
    stat(datadir + '/ten-en.db').st_ctime).strftime('%B %d, %Y'))

projs = sorted(projects.values(), key=lambda p: p.total, reverse=True)
for project in projs:
    if not project.total:
        continue
    fprojs.write('<tr>\n')
    fprojs.write('\t<td><a href="%s"><img src="%s" alt=""/> %s</a></td>\n' \
        % (project.url, project.icon, project.name))
    fprojs.write('\t<td>%s</td>\n' % project.branch)
    fprojs.write('\t<td align="right">%s</td>\n' % pretty_int(project.eng))
    fprojs.write('\t<td align="right">%s</td>\n' % pretty_int(project.total))
    fprojs.write('\t<td align="right">%d</td>\n' % project.langs)
    fprojs.write('\t<td>%s</td>\n' % project.lic)
    fprojs.write('</tr>\n')

fprojs.write('''
</table>
<p>
  Notice that some of the logos might be copyrighted and their use
  might be restricted.  Open-Tran hosts them in order to make sure
  that they are always available from the same location and in order
  to avoid so-called hot-linking.
</p>
</div>
''')
コード例 #3
0
ファイル: audit_step1.py プロジェクト: zen/open-tran
    <th>Total Phrases</th>
    <th>Languages</th>
    <th>License</th>
  </tr>
''' % date.fromtimestamp(
    stat(datadir + '/ten.db').st_ctime).strftime('%B %d, %Y')

projs = sorted(projects.values(), key=lambda p: p.total, reverse=True)
for project in projs:
    if not project.total:
        continue
    print '<tr>'
    print '\t<td><a href="%s"><img src="%s" alt=""/> %s</a></td>' \
        % (project.url, project.icon, project.name)
    print '\t<td>%s</td>' % project.branch
    print '\t<td align="right">%s</td>' % pretty_int(project.eng)
    print '\t<td align="right">%s</td>' % pretty_int(project.total)
    print '\t<td align="right">%d</td>' % project.langs
    print '\t<td>%s</td>' % project.lic
    print '</tr>'

print '''
</table>
<p>
  Notice that some of the logos might be copyrighted and their use
  might be restricted.  Open-Tran hosts them in order to make sure
  that they are always available from the same location and in order
  to avoid so-called hot-linking.
</p>
</div>
'''
コード例 #4
0
conn = sqlite.connect(datadir + '/ten.db')
cur = conn.cursor()

print '''
<div class="ltr">
<h1>Languages</h1>

<table>
<tr><th>Code</th><th>Language</th><th class="right">Count</th></tr>
'''

cur.execute("""
SELECT lang, count(*)
FROM phrases
GROUP BY lang
ORDER BY lang""")
for (lang, cnt) in cur.fetchall():
    if not lang in LANGUAGES:
        continue
    print(
        u'<tr><td>%s</td><td><a href="http://%s.open-tran.eu">%s</a></td><td align="right">%s</td></tr>'
        % (lang, lang, LANGUAGES[lang], pretty_int(cnt))).encode('utf-8')

cur.close()
conn.close()

print '''
</table>
</div>
'''
コード例 #5
0
ファイル: audit_step2.py プロジェクト: kitbs/open-tran

conn = sqlite.connect(datadir + '/ten.db')
cur = conn.cursor()

print '''
<div class="ltr">
<h1>Languages</h1>

<table>
<tr><th>Code</th><th>Language</th><th class="right">Count</th></tr>
'''

cur.execute("""
SELECT lang, count(*)
FROM phrases
GROUP BY lang
ORDER BY lang""")
for (lang, cnt) in cur.fetchall():
    if not lang in LANGUAGES:
        continue
    print (u'<tr><td>%s</td><td><a href="http://%s.open-tran.eu">%s</a></td><td align="right">%s</td></tr>' % (lang, lang, LANGUAGES[lang], pretty_int(cnt))).encode('utf-8')

cur.close()
conn.close()

print '''
</table>
</div>
'''
コード例 #6
0
ファイル: audit_compact.py プロジェクト: kitbs/open-tran
    <th>English Phrases</th>
    <th>Total Phrases</th>
    <th>Languages</th>
    <th>License</th>
  </tr>
''' % date.fromtimestamp(stat(datadir + '/ten-en.db').st_ctime).strftime('%B %d, %Y'))

projs = sorted(projects.values(), key = lambda p: p.total, reverse = True)
for project in projs:
    if not project.total:
        continue
    fprojs.write('<tr>\n')
    fprojs.write('\t<td><a href="%s"><img src="%s" alt=""/> %s</a></td>\n' \
        % (project.url, project.icon, project.name))
    fprojs.write('\t<td>%s</td>\n' % project.branch)
    fprojs.write('\t<td align="right">%s</td>\n' % pretty_int(project.eng))
    fprojs.write('\t<td align="right">%s</td>\n' % pretty_int(project.total))
    fprojs.write('\t<td align="right">%d</td>\n' % project.langs)
    fprojs.write('\t<td>%s</td>\n' % project.lic)
    fprojs.write('</tr>\n')

fprojs.write('''
</table>
<p>
  Notice that some of the logos might be copyrighted and their use
  might be restricted.  Open-Tran hosts them in order to make sure
  that they are always available from the same location and in order
  to avoid so-called hot-linking.
</p>
</div>
''')