133 |
|
|
134 |
def __init__(self, filename): |
def __init__(self, filename): |
135 |
self.filename = filename |
self.filename = filename |
136 |
title = os.path.basename(self.filename) |
|
137 |
|
# Omit the extension in the title as it's not really needed and |
138 |
|
# it can be confusing because dbflib removes extensions and |
139 |
|
# appends some variations of '.dbf' before it tries to open the |
140 |
|
# file. So the title could be e.g. myshapefile.shp when the real |
141 |
|
# filename is myshapefile.dbf |
142 |
|
title = os.path.splitext(os.path.basename(self.filename))[0] |
143 |
TitledObject.__init__(self, title) |
TitledObject.__init__(self, title) |
144 |
|
|
145 |
self.dbf = dbflib.DBFFile(filename) |
self.dbf = dbflib.DBFFile(filename) |
146 |
|
|
147 |
# If true, self.dbf is open for writing. |
# If true, self.dbf is open for writing. |