Graphics/ClassItem.py

changeset 2030
db11a2fe9bbc
parent 1509
c0b5e693b0eb
child 2032
704593d042fe
equal deleted inserted replaced
2028:30247d523fdb 2030:db11a2fe9bbc
213 Method returning the external state. 213 Method returning the external state.
214 214
215 @return external state (boolean) 215 @return external state (boolean)
216 """ 216 """
217 return self.external 217 return self.external
218
219 def buildItemDataString(self):
220 """
221 Public method to build a string to persist the specific item data.
222
223 This string must start with ", " and should be built like
224 "attribute=value" with pairs separated by ", ". value must not contain ", "
225 or newlines.
226
227 @return persistence data (string)
228 """
229 entries = [
230 "item_type=class",
231 "is_external={0}".format(self.external),
232 "no_attributes={0}".format(self.noAttrs),
233 "name={0}".format(self.model.getName()),
234 ]
235 attributes = self.model.getAttributes()
236 if attributes:
237 entries.append("attributes={0}".format("||".join(attributes)))
238 methods = self.model.getMethods()
239 if methods:
240 entries.append("methods={0}".format("||".join(methods)))
241
242 return ", " + ", ".join(entries)
243
244 def parseItemDataString(self, data):
245 """
246 Public method to parse the given persistence data.
247
248 @param data persisted data to be parsed (string)
249 """
250 # TODO: implement this

eric ide

mercurial