lozdog - 2016-12-17

I am working with http://markreidvfx.github.io/pyaaf and having some probelms.
I realise the posts here are generallly based on C++. I have posted this question at http://markreidvfx.github.io/pyaaf but i have not had any responces so i am trying it here.

I have previously had success in using append and insert in another script but I am a bit stumped as to what I am doing wrong here.
In the script I have working I am removing a component in a sequesnce and then using insert and putting in some filler that I created.

below is both my terminal output and then my script.
path is an aaf built by avid containing a bunch of quicktimes in a sequence.
path3 is another sequence with totally different media.
Ultimately I will search thru the path aaf and select out souceclip's to insert into path3

when I run the code at the bottom of this post I get this as an output

source
<aaf.component.Sequence at 0x10ddcc848>
<aaf.component.SourceClip at 0x10dde80e0>
insert
<aaf.component.Sequence at 0x10ddcc958>
Traceback (most recent call last):
File "/Users/laurie/BitTorrent_Sync/hughes_wimborne_coding/aaf/vfx_submissions_cut_in/versions_wips/vfx_submissions_v1.5.test.02.py", line 53, in
segment_path3.append(test_insert)
File "aaf/component/Sequence.pyx", line 127, in aaf.component.Sequence.append (aaf/component.cpp:8531)
File "aaf/util.pyx", line 23, in aaf.util.error_check (aaf/util.cpp:1795)
RuntimeError: failed with [-2146303694]: object already attached - object already attached

here is the script

`f = aaf.open(path, "rw")
header_base_aaf = f.header
storage_base_aaf = header_base_aaf.storage()
main_mob_base_aaf = (storage_base_aaf.toplevel_mobs())[0]

f_path3 = aaf.open(path3, "rw")
header_base_aaf_path3 = f_path3.header
storage_base_aaf_path3 = header_base_aaf_path3.storage()
main_mob_base_aaf_path3 = (storage_base_aaf_path3.toplevel_mobs())[0]
print 'source'
for slot in main_mob_base_aaf.slots():
segment = slot.segment
if segment.media_kind == "Picture":
if isinstance(segment, aaf.component.Sequence):
test_insert = segment.get_value('Components')[0]
print segment
print test_insert
print 'insert'
for slot_path3 in main_mob_base_aaf_path3.slots():
segment_path3 = slot_path3.segment
if segment_path3.media_kind == "Picture":
if isinstance(segment_path3, aaf.component.Sequence):
print segment_path3
segment_path3.append(test_insert)

f.close()
f_path3.close()`

any help would be appriciated

Thanks in advance