diff --git a/nf_core/pipelines/create/__init__.py b/nf_core/pipelines/create/__init__.py index c118d8520d..56e25bf1d5 100644 --- a/nf_core/pipelines/create/__init__.py +++ b/nf_core/pipelines/create/__init__.py @@ -59,7 +59,7 @@ class PipelineCreateApp(App[utils.CreateConfig]): TEMPLATE_CONFIG = utils.CreateConfig() # Initialise pipeline type - PIPELINE_TYPE = None + NFCORE_PIPELINE = True # Log handler LOG_HANDLER = log_handler @@ -74,12 +74,12 @@ def on_button_pressed(self, event: Button.Pressed) -> None: if event.button.id == "start": self.push_screen("choose_type") elif event.button.id == "type_nfcore": - self.PIPELINE_TYPE = "nfcore" - utils.PIPELINE_TYPE_GLOBAL = "nfcore" + self.NFCORE_PIPELINE = True + utils.NFCORE_PIPELINE_GLOBAL = True self.push_screen("basic_details") elif event.button.id == "type_custom": - self.PIPELINE_TYPE = "custom" - utils.PIPELINE_TYPE_GLOBAL = "custom" + self.NFCORE_PIPELINE = False + utils.NFCORE_PIPELINE_GLOBAL = False self.push_screen("basic_details") elif event.button.id == "continue": self.push_screen("final_details") diff --git a/nf_core/pipelines/create/basicdetails.py b/nf_core/pipelines/create/basicdetails.py index b88ede10d0..09484fa2ea 100644 --- a/nf_core/pipelines/create/basicdetails.py +++ b/nf_core/pipelines/create/basicdetails.py @@ -39,7 +39,7 @@ def compose(self) -> ComposeResult: "GitHub organisation", "nf-core", classes="column", - disabled=self.parent.PIPELINE_TYPE == "nfcore", + disabled=self.parent.NFCORE_PIPELINE, ) yield TextInput( "name", @@ -85,7 +85,7 @@ def on_screen_resume(self): add_hide_class(self.parent, "exist_warn") for text_input in self.query("TextInput"): if text_input.field_id == "org": - text_input.disabled = self.parent.PIPELINE_TYPE == "nfcore" + text_input.disabled = self.parent.NFCORE_PIPELINE @on(Button.Pressed) def on_button_pressed(self, event: Button.Pressed) -> None: @@ -102,9 +102,9 @@ def on_button_pressed(self, event: Button.Pressed) -> None: try: self.parent.TEMPLATE_CONFIG = CreateConfig(**config) if event.button.id == "next": - if self.parent.PIPELINE_TYPE == "nfcore": + if self.parent.NFCORE_PIPELINE: self.parent.push_screen("type_nfcore") - elif self.parent.PIPELINE_TYPE == "custom": + else: self.parent.push_screen("type_custom") except ValueError: pass diff --git a/nf_core/pipelines/create/utils.py b/nf_core/pipelines/create/utils.py index d70fea1403..f1e0bae3ce 100644 --- a/nf_core/pipelines/create/utils.py +++ b/nf_core/pipelines/create/utils.py @@ -30,7 +30,7 @@ def init_context(value: Dict[str, Any]) -> Iterator[None]: # Define a global variable to store the pipeline type -PIPELINE_TYPE_GLOBAL: Union[str, None] = None +NFCORE_PIPELINE_GLOBAL: bool = True class CreateConfig(BaseModel): @@ -148,7 +148,7 @@ def validate(self, value: str) -> ValidationResult: If it fails, return the error messages.""" try: - with init_context({"is_nfcore": PIPELINE_TYPE_GLOBAL == "nfcore"}): + with init_context({"is_nfcore": NFCORE_PIPELINE_GLOBAL}): CreateConfig(**{f"{self.key}": value}) return self.success() except ValidationError as e: