MCPcopy
hub / github.com/diffgram/diffgram / new_external_export

Function new_external_export

shared/export/export_generation.py:32–137  ·  view source on GitHub ↗

Create a new export data file This is run on first load session, session object project, project object Designed for external consumptions returns {"success" : True} if successfully Security model this is an internal function export web DOES the validati

(
    session,
    project,
    export_id,
    member,
    version = None,
    working_dir = None)

Source from the content-addressed store, hash-verified

30
31
32def new_external_export(
33 session,
34 project,
35 export_id,
36 member,
37 version = None,
38 working_dir = None):
39 """
40 Create a new export data file
41
42 This is run on first load
43
44 session, session object
45 project, project object
46
47
48 Designed for external consumptions
49
50 returns {"success" : True} if successfully
51
52 Security model
53 this is an internal function
54
55 export web DOES the validation
56 Job_permissions.check_job_after_project_already_valid()
57
58 """
59
60 logger.info("[Export processor] Started")
61 result = False
62 start_time = time.time()
63
64 export = session.query(Export).filter(
65 Export.id == export_id).first()
66
67 session.add(export)
68
69 if export.source == "task":
70
71 if export.task and export.task.file:
72 # Caution export.task not task
73
74 file_list = [export.task.file]
75
76 if export.source == "job":
77
78 status = None
79 if export.ann_is_complete is True:
80 status = "complete"
81
82 task_list = Task.list(
83 session = session,
84 job_id = export.job_id,
85 status = status,
86 project_id = export.project_id,
87 limit_count = None
88 )
89

Callers 1

export_web_coreFunction · 0.90

Calls 7

annotation_export_coreFunction · 0.85
file_listMethod · 0.80
addMethod · 0.45
listMethod · 0.45
upload_from_stringMethod · 0.45
newMethod · 0.45

Tested by

no test coverage detected