#NEWLINE# def add( self , scriptclass , key = None , autostart = True ) : #NEWLINE# #INDENT# '\n        Add a script to this object.\n\n        Args:\n            scriptclass (Scriptclass, Script or str): Either a class\n                object inheriting from DefaultScript, an instantiated\n                script object or a python path to such a class object.\n            key (str, optional): Identifier for the script (often set\n                in script definition and listings)\n            autostart (bool, optional): Start the script upon adding it.\n\n        ' #NEWLINE# if ( self . obj . __dbclass__ . __name__ == 'PlayerDB' ) : #NEWLINE# #INDENT# script = create . create_script ( scriptclass , key = key , player = self . obj , autostart = autostart ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# script = create . create_script ( scriptclass , key = key , obj = self . obj , autostart = autostart ) #NEWLINE# #UNINDENT# if ( not scriptclass ) : #NEWLINE# #INDENT# logger . log_err ( ( 'Script %s could not be created and/or started.' % scriptclass ) ) #NEWLINE# return False #NEWLINE# #UNINDENT# return True