I am trying to get the name of main function that is called. I mean the case when I run main function (updating.new_cycle
) and in some conditions other function (inserting.inserting_data_ts
) is running, via import from inserting.py file.
My code:
updating.new_cycle(new,
old,
db, '2018-09-13')
In function new_cycle
:
for i in list(new):
if i not in old:
import inserting
newdata = {u'type': u'FeatureCollection', u'features': new[i]}
inserting.inserting_data_ts(new, TimeBegin, None)
So, I want to catch this condition is proceeded: when inserting_data_ts
is called from updating.new_cycle (when main calling function is updating.new_cycle
, not inserting.inserting_data_ts
).
How can I achieve this?