File: spkg-install

package info (click to toggle)
sagemath-database-conway-polynomials 0.4.p0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,096 kB
  • ctags: 6
  • sloc: python: 35,387; makefile: 8
file content (21 lines) | stat: -rwxr-xr-x 527 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python

import os
from sage.all import save
from sage.misc.misc import SAGE_SHARE

install_root = os.path.join(SAGE_SHARE, 'conway_polynomials')

def create_db():
    db = {}
    from src import conway_polynomials
    for p,n,v in conway_polynomials:
        if not db.has_key(p):
            db[p] = {}
        db[p][n] = v
    if not os.path.exists(install_root):
        os.makedirs(install_root)
    save(db, os.path.join(install_root, 'conway_polynomials.sobj'))

if __name__ == '__main__':
    create_db()