diff --git a/python/python-features-trainer/resources/messages/PythonLessonsBundle.properties b/python/python-features-trainer/resources/messages/PythonLessonsBundle.properties index 321c31641565..3d9b0728393e 100644 --- a/python/python-features-trainer/resources/messages/PythonLessonsBundle.properties +++ b/python/python-features-trainer/resources/messages/PythonLessonsBundle.properties @@ -53,7 +53,7 @@ python.onboarding.select.fix=Apply the first item: {0}. With this fix, your code python.onboarding.invoke.intention.for.code=Intentions also save your time and make coding easier. Let''s use an intention to quickly add a return type for {0}. Press {1}. python.onboarding.invoke.intention.for.code.balloon=Press {0} to show available intentions python.onboarding.apply.intention=Select {0} and press {1}. -python.onboarding.complete.template=Type {0} and then press {1}. +python.onboarding.complete.template=Press {0}. python.onboarding.invoke.search.everywhere.1=While working in , you might want to search for files in your project, symbols, classes, or even IDE actions. In this lesson, let''s search for the {0} action to make the {1} string low-case. python.onboarding.invoke.search.everywhere.2=Press {0} two times to open the {1} dialog. python.onboarding.search.everywhere.description=As you can see, the selected text, {0}, has been automatically copied into the input string. Let''s type {1} instead of {0}. diff --git a/python/python-features-trainer/src/com/intellij/python/featuresTrainer/ift/lesson/essensial/PythonOnboardingTourLesson.kt b/python/python-features-trainer/src/com/intellij/python/featuresTrainer/ift/lesson/essensial/PythonOnboardingTourLesson.kt index 6cf264e96ee0..da4776141d4d 100644 --- a/python/python-features-trainer/src/com/intellij/python/featuresTrainer/ift/lesson/essensial/PythonOnboardingTourLesson.kt +++ b/python/python-features-trainer/src/com/intellij/python/featuresTrainer/ift/lesson/essensial/PythonOnboardingTourLesson.kt @@ -43,7 +43,6 @@ import com.jetbrains.python.sdk.pythonSdk import training.dsl.* import training.dsl.LessonUtil.adjustSearchEverywherePosition import training.dsl.LessonUtil.checkEditorModification -import training.dsl.LessonUtil.checkExpectedStateOfEditor import training.dsl.LessonUtil.restoreIfModified import training.dsl.LessonUtil.restoreIfModifiedOrMoved import training.dsl.LessonUtil.restorePopupPosition @@ -89,9 +88,7 @@ class PythonOnboardingTourLesson : val sample: LessonSample = parseLessonSample(""" def find_average(values): - result = 0 - for v in values: - result += v + result = sum(values) return result @@ -493,31 +490,20 @@ class PythonOnboardingTourLesson : } task { - text(PythonLessonsBundle.message("python.onboarding.apply.intention", strong(returnTypeMessage(project)), LessonUtil.rawEnter())) + text(PythonLessonsBundle.message("python.onboarding.apply.intention", strong(returnTypeMessage(project)), LessonUtil.rawEnter(), LessonUtil.rawEnter())) stateCheck { val text = editor.document.text - previous.sample.text != text && text.contains("object") && !text.contains("values: object") + previous.sample.text != text && text.contains("float") && !text.contains("values: object") } restoreByUi(delayMillis = defaultRestoreDelay) } task { - lateinit var forRestore: LessonSample - before { - val text = previous.sample.text - val toReplace = "object" - forRestore = LessonSample(text.replace(toReplace, ""), text.indexOf(toReplace).takeIf { it != -1 } ?: 0) - } - text(PythonLessonsBundle.message("python.onboarding.complete.template", code("float"), LessonUtil.rawEnter())) + text(PythonLessonsBundle.message("python.onboarding.complete.template", LessonUtil.rawEnter())) stateCheck { // TODO: make normal check val activeTemplate = TemplateManagerImpl.getInstance(project).getActiveTemplate(editor) - editor.document.text.contains("float") && activeTemplate == null - } - proposeRestore { - checkExpectedStateOfEditor(forRestore) { - "object".contains(it) || "float".contains(it) - } + activeTemplate == null } } }