MCPcopy Index your code
hub / github.com/diffgram/diffgram / copy_file

Function copy_file

shared/utils/task/task_new.py:138–165  ·  view source on GitHub ↗

CAUTION Assumes completion_directory_id is orginal_directory_id Create copy of file for task

(session,
              directory,
              completion_directory_id,
              file,
              copy_instance_list = False
              )

Source from the content-addressed store, hash-verified

136
137
138def copy_file(session,
139 directory,
140 completion_directory_id,
141 file,
142 copy_instance_list = False
143 ):
144 """
145 CAUTION Assumes completion_directory_id is orginal_directory_id
146
147 Create copy of file for task
148 """
149 # TODO handle file "parent / child linking stuff
150
151 new_file = File.copy_file_from_existing(
152 session = session,
153 working_dir = directory,
154 existing_file = file,
155 copy_instance_list = copy_instance_list,
156 add_link = False,
157 remove_link = False,
158 orginal_directory_id = completion_directory_id,
159 deep_copy = True,
160 ann_is_complete_reset = True
161 )
162
163 assert new_file != file
164
165 return new_file

Callers 1

root_task_newFunction · 0.85

Calls 1

Tested by

no test coverage detected