File: builder.py

package info (click to toggle)
sagemath-database-conway-polynomials 0.4.p0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,100 kB
  • ctags: 6
  • sloc: python: 35,387; makefile: 8
file content (19 lines) | stat: -rw-r--r-- 435 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
import zlib; comp = zlib
import cPickle
import os
import sys
sys.path.append('.')
from src import conway_polynomials

db = {}
for p,n,v in conway_polynomials:
    if not db.has_key(p):
        db[p] = {}
    db[p][n] = v

dstdir = os.path.join('build')
dst = os.path.join(dstdir, 'conway_polynomials.sobj')
if not os.path.exists(dstdir):
        os.makedirs(dstdir)

open(dst, 'wb').write(comp.compress(cPickle.dumps(db, protocol=2)))