Skip to content

Commit

Permalink
symbol DB updated to support groups,tags for colorramp
Browse files Browse the repository at this point in the history
  • Loading branch information
Arunmozhi committed Jul 26, 2012
1 parent 3943e8a commit ae03158
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Binary file modified resources/symbology-ng-style.db
Binary file not shown.
11 changes: 8 additions & 3 deletions scripts/symbol_xml2db.py
Expand Up @@ -37,7 +37,8 @@
_colorramp = "CREATE TABLE colorramp("\
"id INTEGER PRIMARY KEY,"\
"name TEXT,"\
"xml TEXT)"
"xml TEXT,"\
"groupid INTEGER)"

_tag = "CREATE TABLE tag("\
"id INTEGER PRIMARY KEY,"\
Expand All @@ -57,7 +58,11 @@
"name TEXT,"\
"xml TEXT)"

create_tables = [ _symbol, _colorramp, _tag, _tagmap, _symgroup, _smartgroup ]
_ctagmap = "CREATE TABLE ctagmap("\
"tag_id INTEGER NOT NULL,"\
"colorramp_id INTEGER)"

create_tables = [ _symbol, _colorramp, _tag, _tagmap, _ctagmap, _symgroup, _smartgroup ]

# Create the DB with required Schema
conn = sqlite3.connect( dbfile )
Expand Down Expand Up @@ -93,7 +98,7 @@
colorramps = dom.getElementsByTagName( "colorramp" )
for ramp in colorramps:
ramp_name = ramp.getAttribute( "name" )
c.execute( "INSERT INTO colorramp VALUES (?,?,?)", ( None, ramp_name, ramp.toxml() ) )
c.execute( "INSERT INTO colorramp VALUES (?,?,?,?)", ( None, ramp_name, ramp.toxml(), None ) )
conn.commit()

# Finally close the sqlite cursor
Expand Down

0 comments on commit ae03158

Please sign in to comment.