IFT-518 Make Python onboarding lesson and promoter available only in PyCharm Community/Professional

GitOrigin-RevId: 12a710a6e519873c36d750d1967daf9dfe78e84f
This commit is contained in:
Konstantin Hudyakov
2023-11-08 17:06:30 +02:00
committed by intellij-monorepo-bot
parent eee95f36ec
commit 1073190fc7
2 changed files with 6 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.jetbrains.python.ift
import com.intellij.openapi.application.ApplicationNamesInfo
import com.intellij.util.PlatformUtils
import com.jetbrains.python.PythonLanguage
import com.jetbrains.python.ift.lesson.assistance.PythonEditorCodingAssistanceLesson
import com.jetbrains.python.ift.lesson.basic.PythonContextActionsLesson
@@ -37,9 +37,10 @@ import training.learn.lesson.general.refactorings.ExtractVariableFromBubbleLesso
class PythonLearningCourse : LearningCourseBase(PythonLanguage.INSTANCE.id) {
override fun modules() = onboardingTour() + stableModules() + CourseManager.instance.findCommonModules("Git")
private val disableOnboardingLesson get() = ApplicationNamesInfo.getInstance().fullProductNameWithEdition.equals("PyCharm Edu")
private val isOnboardingLessonEnabled: Boolean
get() = PlatformUtils.isPyCharmCommunity() || PlatformUtils.isPyCharmPro()
private fun onboardingTour() = if (!disableOnboardingLesson) listOf(
private fun onboardingTour() = if (isOnboardingLessonEnabled) listOf(
LearningModule(id = "Python.Onboarding",
name = PythonLessonsBundle.message("python.onboarding.module.name"),
description = PythonLessonsBundle.message("python.onboarding.module.description", LessonUtil.productName),