# Path: operators/tools/get_base_strip.py
# def get_base_strip(strip, base_strips):
#     """Get the strip's base strip"""
#     for i in range(len(base_strips)):
#         if base_strips[i].frame_start <= strip.frame_start:
#             if base_strips[i].frame_final_end >= strip.frame_final_end:
#                 return base_strips[i]
# 
# Path: operators/tools/get_text_strips.py
# def get_text_strips(scene, channel=None):
#     """Get all the text strips in the edit channel"""
# 
#     if channel == None:
#         channel = scene.subtitle_edit_channel
# 
#     all_strips = list(sorted(scene.sequence_editor.sequences,
#             key=lambda x: x.frame_start))
# 
#     text_strips = []
#     for strip in all_strips:
#         if (strip.channel == channel and
#                 strip.type == 'TEXT'):
#             text_strips.append(strip)
# 
#     return text_strips


import bpy
from .tools.get_base_strip import get_base_strip
from .tools.get_text_strips import get_text_strips
        except AttributeError:
            return {"FINISHED"}

        for parent in parents:
            p_start = parent.frame_final_start
            p_end = parent.frame_final_end

            if current_frame >= p_start and current_frame <= p_end:
                current_parent = parent
                break

        p_start = current_parent.frame_final_start
        p_end = current_parent.frame_final_end

        maybe_children = get_text_strips(scene)

        children = []
        for maybe_child in maybe_children:
            m_start = maybe_child.frame_final_start
            m_end = maybe_child.frame_final_end

            if p_start <= m_start and p_end >= m_end:
                children.append(maybe_child)

        children = list(reversed(children))
        for i in range(len(children)):
            if children[i].frame_final_end > current_frame:
                children[i].frame_final_end = p_end - i
                children[i].frame_final_start = p_end - (i + 1)


# Path: operators/tools/get_base_strip.py
# def get_base_strip(strip, base_strips):
#     """Get the strip's base strip"""
#     for i in range(len(base_strips)):
#         if base_strips[i].frame_start <= strip.frame_start:
#             if base_strips[i].frame_final_end >= strip.frame_final_end:
#                 return base_strips[i]
# 
# Path: operators/tools/get_text_strips.py
# def get_text_strips(scene, channel=None):
#     """Get all the text strips in the edit channel"""
# 
#     if channel == None:
#         channel = scene.subtitle_edit_channel
# 
#     all_strips = list(sorted(scene.sequence_editor.sequences,
#             key=lambda x: x.frame_start))
# 
#     text_strips = []
#     for strip in all_strips:
#         if (strip.channel == channel and
#                 strip.type == 'TEXT'):
#             text_strips.append(strip)
# 
#     return text_strips


# Path: operators/shortcuts.py
import bpy
from .tools.get_base_strip import get_base_strip
from .tools.get_text_strips import get_text_strips

        except AttributeError:
            return {"FINISHED"}

        for parent in parents:
            p_start = parent.frame_final_start
            p_end = parent.frame_final_end

            if current_frame >= p_start and current_frame <= p_end:
                current_parent = parent
                break

        p_start = current_parent.frame_final_start
        p_end = current_parent.frame_final_end

        maybe_children = get_text_strips(scene)

        children = []
        for maybe_child in maybe_children:
            m_start = maybe_child.frame_final_start
            m_end = maybe_child.frame_final_end

            if p_start <= m_start and p_end >= m_end:
                children.append(maybe_child)

        children = list(reversed(children))
        for i in range(len(children)):
            if children[i].frame_final_end > current_frame:
                children[i].frame_final_end = p_end - i
                children[i].frame_final_start = p_end - (i + 1)


        return {"FINISHED"}