mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-19 00:04:52 -04:00
symbol DB updated to support groups,tags for colorramp
This commit is contained in:
parent
3943e8a40d
commit
ae031584c7
Binary file not shown.
@ -37,7 +37,8 @@ _symbol = "CREATE TABLE symbol("\
|
|||||||
_colorramp = "CREATE TABLE colorramp("\
|
_colorramp = "CREATE TABLE colorramp("\
|
||||||
"id INTEGER PRIMARY KEY,"\
|
"id INTEGER PRIMARY KEY,"\
|
||||||
"name TEXT,"\
|
"name TEXT,"\
|
||||||
"xml TEXT)"
|
"xml TEXT,"\
|
||||||
|
"groupid INTEGER)"
|
||||||
|
|
||||||
_tag = "CREATE TABLE tag("\
|
_tag = "CREATE TABLE tag("\
|
||||||
"id INTEGER PRIMARY KEY,"\
|
"id INTEGER PRIMARY KEY,"\
|
||||||
@ -57,7 +58,11 @@ _smartgroup = "CREATE TABLE smartgroup("\
|
|||||||
"name TEXT,"\
|
"name TEXT,"\
|
||||||
"xml 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
|
# Create the DB with required Schema
|
||||||
conn = sqlite3.connect( dbfile )
|
conn = sqlite3.connect( dbfile )
|
||||||
@ -93,7 +98,7 @@ conn.commit()
|
|||||||
colorramps = dom.getElementsByTagName( "colorramp" )
|
colorramps = dom.getElementsByTagName( "colorramp" )
|
||||||
for ramp in colorramps:
|
for ramp in colorramps:
|
||||||
ramp_name = ramp.getAttribute( "name" )
|
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()
|
conn.commit()
|
||||||
|
|
||||||
# Finally close the sqlite cursor
|
# Finally close the sqlite cursor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user