mirror of
https://gitlab.com/jrmiller82/pathfinder-2-sqlite.git
synced 2026-10-12 22:29:44 -04:00
got spells.py fixing the nethys sources_pages field
This commit is contained in:
1 parent
d9ffb127e4
commit
5f50cd2231
2 files changed
+37
-11
No files matched your search
@@ -36,8 +36,34 @@ def main():
|
||||
# insert basics of a spell
|
||||
do_basic_sql(i, id, conn)
|
||||
do_range_numbers(i,id,conn)
|
||||
do_sources_pages(i,id,conn)
|
||||
# TODO do all the traits, FK stuff etc...
|
||||
|
||||
def do_sources_pages(i, id, conn):
|
||||
if 'source' not in i:
|
||||
return
|
||||
print(i)
|
||||
|
||||
res = ''
|
||||
source_id = 0
|
||||
# Do Core Rulebook branch
|
||||
if "Core Rulebook" in i['source']:
|
||||
res = i['source'].replace('Core Rulebook pg.','').strip()
|
||||
source_id = 1
|
||||
|
||||
stmt = "UPDATE spells SET sources_id=?, sources_pages=? WHERE spells_id=?"
|
||||
inp = (source_id, res, id)
|
||||
|
||||
try:
|
||||
conn.execute(stmt, inp)
|
||||
except:
|
||||
print("Error updating sources")
|
||||
else:
|
||||
conn.commit()
|
||||
|
||||
|
||||
|
||||
|
||||
def do_range_numbers(i, id, conn):
|
||||
# no need to do range
|
||||
if 'range' not in i:
|
||||
|
||||
Reference in new issue
Block a user