mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-10 14:04:37 +08:00
21 lines
500 B
Plaintext
21 lines
500 B
Plaintext
import os
|
|
from sage.structure.sage_object import save
|
|
|
|
|
|
install_root = os.path.join(os.environ['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()
|
|
|