|
@@ -112,11 +112,11 @@ def get_xyz(pnt):
|
|
|
|
|
|
|
|
|
class Attrs(object):
|
|
|
- def __init__(self, v_id, table, write=False):
|
|
|
+ def __init__(self, v_id, table, writable=False):
|
|
|
self.id = v_id
|
|
|
self.table = table
|
|
|
self.cond = "%s=%d" % (self.table.key, self.id)
|
|
|
- self.write = write
|
|
|
+ self.writable = writable
|
|
|
|
|
|
def __getitem__(self, key):
|
|
|
"""Return the value stored in the attribute table. ::
|
|
@@ -139,7 +139,7 @@ class Attrs(object):
|
|
|
>>> attrs['LABEL'] = 'New Label'
|
|
|
|
|
|
.."""
|
|
|
- if self.write:
|
|
|
+ if self.writable:
|
|
|
#UPDATE {tname} SET {new_col} = {old_col} WHERE {condition}
|
|
|
self.table.execute(sql.UPDATE_WHERE.format(tname=self.table.name,
|
|
|
new_col=key,
|
|
@@ -183,7 +183,7 @@ class Geo(object):
|
|
|
>>> geo1 = Geo(c_points=points, c_cats=cats)
|
|
|
"""
|
|
|
def __init__(self, v_id=None, c_mapinfo=None, c_points=None, c_cats=None,
|
|
|
- table=None, write=False):
|
|
|
+ table=None, writable=False):
|
|
|
self.id = v_id # vector id
|
|
|
self.c_mapinfo = c_mapinfo
|
|
|
|
|
@@ -201,7 +201,7 @@ class Geo(object):
|
|
|
|
|
|
# set the attributes
|
|
|
if table:
|
|
|
- self.attrs = Attrs(self.id, table, write)
|
|
|
+ self.attrs = Attrs(self.id, table, writable)
|
|
|
|
|
|
def is_with_topology(self):
|
|
|
if self.c_mapinfo is not None:
|