> ... But the ticket attritbutes weren't copied, only the references to them. > I tried but deepcopy() but that gives: > > File "build/bdist.linux-x86_64/egg/tracjsgantt/tracjsgantt.py", line > 558, in _add_tasks > self.pm.computeSchedule(options, self.tickets) > File "build/bdist.linux-x86_64/egg/tracjsgantt/tracpm.py", line 566, > in computeSchedule > ticketsByID[t['id']] = copy.deepcopy(t) > File "/usr/lib/python2.6/copy.py", line 162, in deepcopy > y = copier(x, memo) > File "/usr/lib/python2.6/copy.py", line 255, in _deepcopy_dict > y[deepcopy(key, memo)] = deepcopy(value, memo) > File "/usr/lib/python2.6/copy.py", line 189, in deepcopy > y = _reconstruct(x, rv, 1, memo) > File "/usr/lib/python2.6/copy.py", line 322, in _reconstruct > args = deepcopy(args, memo) > File "/usr/lib/python2.6/copy.py", line 162, in deepcopy > y = copier(x, memo) > File "/usr/lib/python2.6/copy.py", line 235, in _deepcopy_tuple > y.append(deepcopy(a, memo)) > File "/usr/lib/python2.6/copy.py", line 189, in deepcopy > y = _reconstruct(x, rv, 1, memo) > File "/usr/lib/python2.6/copy.py", line 323, in _reconstruct > y = callable(*args) > TypeError: __init__() takes exactly 3 arguments (1 given) > ...
http://grokbase.com/p/python.org/python-list/2009/01/how-to-deepcopy-a-list-of-user-defined-lists/08o7x4coflamidhtsvod2ewoluna notes: A subclass of list should populate the list in __init__, not __new__, usually by calling list.__init__, as lists are mutable and subclasses thereof should be too. I don't believe TracPM has any subclass of list and I think Ticket maybe which suggests to me there's something wrong in Trac core. With a little support, I'll work on the patch but core is unfamiliar to me. -- You received this message because you are subscribed to the Google Groups "Trac Development" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.
