def get_script(self):
        """

        Returns: the script and the path to the script to which this item belongs

        """

        if isinstance(self.value, Script):
            script = self.value
            path_to_script = []
            script_item = self

        else:
            script = None
            parent = self.parent()
            path_to_script = [self.name]
            while parent is not None:
                if isinstance(parent.value, Script):
                    script = parent.value
                    script_item = parent
                    parent = None
                else:
                    path_to_script.append(parent.name)
                    parent = parent.parent()

        return script, path_to_script, script_item
def get_script ( self ) : if isinstance ( self . value , Script ) : script = self . value path_to_script = [ ] script_item = self else : script = None parent = self . parent ( ) path_to_script = [ self . name ] while parent is not None : if isinstance ( parent . value , Script ) : script = parent . value script_item = parent parent = None else : path_to_script . append ( parent . name ) parent = parent . parent ( ) return script , path_to_script , script_item
Returns: the script and the path to the script to which this item belongs