Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Barry
/
ffxi-db-converter
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
0c542402
authored
2016-09-29 14:35:31 +0000
by
Gravenet
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update convert.py
1 parent
eafd74f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
convert.py
convert.py
View file @
0c54240
...
...
@@ -38,8 +38,8 @@ parser.add_argument('-s', '--sourcexml', required=True, help="Source XML Directo
parser
.
add_argument
(
'-o'
,
'--outputdb'
,
required
=
True
,
help
=
"Destination SQLite Database"
)
args
=
parser
.
parse_args
()
print
"Source XML Directory:
%
s"
%
(
args
.
sourcexml
,
)
print
"Destination SQLite DB:
%
s"
%
(
args
.
outputdb
,)
print
(
"Source XML Directory:
%
s"
%
(
args
.
sourcexml
,)
)
print
(
"Destination SQLite DB:
%
s"
%
(
args
.
outputdb
,))
conn
=
sqlite3
.
connect
(
args
.
outputdb
)
c
=
conn
.
cursor
()
...
...
@@ -49,13 +49,13 @@ for filename in os.listdir(args.sourcexml):
try
:
fields
=
(
', '
.
join
(
'"'
+
item
+
'"'
for
item
in
field_list
[
filename
]))
query
=
"CREATE TABLE
\"
%
s
\"
(
%
s)"
%
(
filename
,
fields
)
print
query
print
(
query
)
c
.
execute
(
query
)
conn
.
commit
()
except
sqlite3
.
OperationalError
:
pass
source_file
=
os
.
path
.
join
(
args
.
sourcexml
,
filename
)
print
"Parsing File:
%
s"
%
(
source_file
,
)
print
(
"Parsing File:
%
s"
%
(
source_file
,)
)
doc
=
untangle
.
parse
(
source_file
)
for
item
in
doc
.
thing_list
.
thing
:
row
=
[]
...
...
Please
register
or
sign in
to post a comment