def create_script( self, name: Optional[str] = None, yml: Optional[dict] = None, code: str = '', readme: str = '', description: str = '', changelog: str = '', image: bytes = b'' ) -> Script: if name is None: name = f'script{len(self.integrations)}' if yml is None: yml = {} script = Script(self._scripts_path, name, self._repo) script.build( code, yml, readme, description, changelog, image ) self.scripts.append(script) return script
def create_script( self, name: Optional[str] = None, yml: Optional[dict] = None, code: str = '', readme: str = '', description: str = '', changelog: str = '', image: bytes = b'', create_unified=False, ) -> Script: if name is None: name = f'script{len(self.scripts)}' if yml is None: yml = { 'commonfields': { 'id': name, 'version': -1 }, 'name': name, 'comment': f'this is script {name}', 'type': 'python', 'subtype': 'python3', 'script': '-', } script = Script(self._scripts_path, name, self._repo, create_unified=create_unified) script.build(code, yml, readme, description, changelog, image) self.scripts.append(script) return script
def create_script(self, name: Optional[str] = None, unified: Optional[bool] = True): if name is None: name = f'script{len(self.scripts)}' script = Script(self._scripts_path, name, self._repo, unified) script.create_default_script() self.scripts.append(script) return script