summaryrefslogtreecommitdiff
path: root/python/edu/learn-python/resources
diff options
context:
space:
mode:
Diffstat (limited to 'python/edu/learn-python/resources')
-rw-r--r--python/edu/learn-python/resources/META-INF/plugin.xml73
-rw-r--r--python/edu/learn-python/resources/com/jetbrains/python/edu/user_tester.py58
-rw-r--r--python/edu/learn-python/resources/courses/introduction_course.zipbin0 -> 93360 bytes
-rw-r--r--python/edu/learn-python/resources/icons/com/jetbrains/python/edu/Run.pngbin0 -> 1260 bytes
-rw-r--r--python/edu/learn-python/resources/icons/com/jetbrains/python/edu/WatchInput.pngbin0 -> 1328 bytes
-rw-r--r--python/edu/learn-python/resources/icons/com/jetbrains/python/edu/add.pngbin0 -> 213 bytes
-rw-r--r--python/edu/learn-python/resources/icons/com/jetbrains/python/edu/checked.pngbin0 -> 606 bytes
-rw-r--r--python/edu/learn-python/resources/icons/com/jetbrains/python/edu/failed.pngbin0 -> 549 bytes
-rw-r--r--python/edu/learn-python/resources/icons/com/jetbrains/python/edu/icon.jpgbin0 -> 4389 bytes
-rw-r--r--python/edu/learn-python/resources/icons/com/jetbrains/python/edu/next.pngbin0 -> 1345 bytes
-rw-r--r--python/edu/learn-python/resources/icons/com/jetbrains/python/edu/playground.pngbin0 -> 855 bytes
-rw-r--r--python/edu/learn-python/resources/icons/com/jetbrains/python/edu/prev.pngbin0 -> 1354 bytes
-rw-r--r--python/edu/learn-python/resources/icons/com/jetbrains/python/edu/refresh.pngbin0 -> 657 bytes
-rw-r--r--python/edu/learn-python/resources/icons/com/jetbrains/python/edu/refresh24.pngbin0 -> 1569 bytes
-rw-r--r--python/edu/learn-python/resources/icons/com/jetbrains/python/edu/resolve.pngbin0 -> 342 bytes
-rw-r--r--python/edu/learn-python/resources/icons/com/jetbrains/python/edu/resolve_dark.pngbin0 -> 449 bytes
-rw-r--r--python/edu/learn-python/resources/icons/com/jetbrains/python/edu/showHint.pngbin0 -> 1218 bytes
-rw-r--r--python/edu/learn-python/resources/icons/com/jetbrains/python/edu/unchecked.pngbin0 -> 604 bytes
18 files changed, 131 insertions, 0 deletions
diff --git a/python/edu/learn-python/resources/META-INF/plugin.xml b/python/edu/learn-python/resources/META-INF/plugin.xml
new file mode 100644
index 000000000000..ec828eb44d59
--- /dev/null
+++ b/python/edu/learn-python/resources/META-INF/plugin.xml
@@ -0,0 +1,73 @@
+<!--suppress XmlUnboundNsPrefix -->
+<idea-plugin version="2">
+ <id>com.jetbrains.python.edu.learn-python</id>
+ <name>Educational plugin for PyCharm</name>
+ <version>1.0</version>
+ <vendor email="support@yourcompany.com" url="http://www.yourcompany.com">YourCompany</vendor>
+
+ <description><![CDATA[
+
+ ]]></description>
+
+ <change-notes><![CDATA[
+
+ ]]>
+ </change-notes>
+
+ <!--depends>com.intellij.modules.python</depends-->
+
+ <!-- please see http://confluence.jetbrains.net/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products
+ on how to target different products -->
+
+ <depends>com.intellij.modules.lang</depends>
+ <depends>com.intellij.modules.python</depends>
+ <application-components>
+ </application-components>
+
+ <project-components>
+ <component>
+ <implementation-class>com.jetbrains.python.edu.StudyTaskManager</implementation-class>
+ <interface-class>com.jetbrains.python.edu.StudyTaskManager</interface-class>
+ </component>
+ </project-components>
+
+ <application-components>
+ <component>
+ <implementation-class>com.jetbrains.python.edu.StudyInitialConfigurator</implementation-class>
+ <headless-implementation-class/>
+ </component>
+ </application-components>
+
+ <actions>
+ <action id="CheckAction" class="com.jetbrains.python.edu.actions.StudyCheckAction" text="check"
+ description="Runs tests for current tasks" icon="/icons/icon.jpg">
+ </action>
+ <action id="PrevWindowAction" class="com.jetbrains.python.edu.actions.StudyPrevWindowAction" text="PrevWindowAction" description="prev">
+ </action>
+
+ <action id="NextWindow" class="com.jetbrains.python.edu.actions.StudyNextWindowAction" text="NextWindowAction" description="next">
+ </action>
+ <action id="NextTaskAction" class="com.jetbrains.python.edu.actions.StudyNextStudyTaskAction" text="NextTaskAction" description="Next Task"/>
+ <action id="PreviousTaskAction" class="com.jetbrains.python.edu.actions.StudyPreviousStudyTaskAction" text="PreviousTaskAction"
+ description="Previous Task"/>
+ <action id="RefreshTaskAction" class="com.jetbrains.python.edu.actions.StudyRefreshTaskAction" text="RefreshTaskAction"
+ description="Refresh current task"/>
+ <action id="WatchInputAction" class="com.jetbrains.python.edu.actions.StudyEditInputAction" text="WatchInputAction"
+ description="watch input"/>
+ <action id="StudyRunAction" class="com.jetbrains.python.edu.actions.StudyRunAction" text="StudyRunAction" description="run your code"/>
+ <action id="ShowHintAction" class="com.jetbrains.python.edu.actions.StudyShowHintAction" text="Show hint"
+ description="show hint">
+ <add-to-group group-id="MainToolBar" anchor="last"/>
+ </action>
+ </actions>
+
+ <extensions defaultExtensionNs="com.intellij">
+ <toolWindow id="Course Description" anchor="right" factoryClass="com.jetbrains.python.edu.ui.StudyToolWindowFactory" conditionClass="com.jetbrains.python.edu.ui.StudyCondition"/>
+ <fileEditorProvider implementation="com.jetbrains.python.edu.editor.StudyFileEditorProvider"/>
+ <directoryProjectGenerator implementation="com.jetbrains.python.edu.StudyDirectoryProjectGenerator"/>
+ <treeStructureProvider implementation="com.jetbrains.python.edu.projectView.StudyTreeStructureProvider"/>
+ <highlightErrorFilter implementation="com.jetbrains.python.edu.StudyHighlightErrorFilter"/>
+ <applicationService serviceInterface="com.intellij.openapi.fileEditor.impl.EditorEmptyTextPainter"
+ serviceImplementation="com.jetbrains.python.edu.StudyInstructionPainter" overrides="true"/>
+ </extensions>
+</idea-plugin> \ No newline at end of file
diff --git a/python/edu/learn-python/resources/com/jetbrains/python/edu/user_tester.py b/python/edu/learn-python/resources/com/jetbrains/python/edu/user_tester.py
new file mode 100644
index 000000000000..c17e6cdd7479
--- /dev/null
+++ b/python/edu/learn-python/resources/com/jetbrains/python/edu/user_tester.py
@@ -0,0 +1,58 @@
+import sys
+import imp
+import os
+import subprocess
+
+USER_TESTS = "userTests"
+
+TEST_FAILED = "FAILED"
+
+TEST_PASSED = "PASSED"
+
+INPUT = "input"
+OUTPUT = "output"
+
+
+def get_index(logical_name, full_name):
+ logical_name_len = len(logical_name)
+ if full_name[:logical_name_len] == logical_name:
+ return int(full_name[logical_name_len])
+ return -1
+
+
+def process_user_tests(file_path):
+ user_tests = []
+ imp.load_source('user_file', file_path)
+ user_tests_dir_path = os.path.abspath(os.path.join(file_path, os.pardir, USER_TESTS))
+ user_test_files = os.listdir(user_tests_dir_path)
+ for user_file in user_test_files:
+ index = get_index(INPUT, user_file)
+ if index == -1:
+ continue
+ output = OUTPUT + str(index)
+ if output in user_test_files:
+ input_path = os.path.abspath(os.path.join(user_tests_dir_path, user_file))
+ output_path = os.path.abspath(os.path.join(user_tests_dir_path, output))
+ user_tests.append((input_path, output_path, index))
+ return sorted(user_tests, key=(lambda x: x[2]))
+
+
+def run_user_test(python, executable_path):
+ user_tests = process_user_tests(executable_path)
+ for test in user_tests:
+ input, output, index = test
+ test_output = subprocess.check_output([python, executable_path, input])
+ expected_output = open(output).read()
+ test_status = TEST_PASSED if test_output == expected_output else TEST_FAILED
+ print "TEST" + str(index) + " " + test_status
+ print "OUTPUT:"
+ print test_output + "\n"
+ if test_status == TEST_FAILED:
+ print "EXPECTED OUTPUT:"
+ print expected_output + "\n"
+
+
+if __name__ == "__main__":
+ python = sys.argv[1]
+ executable_path = sys.argv[2]
+ run_user_test(python , executable_path) \ No newline at end of file
diff --git a/python/edu/learn-python/resources/courses/introduction_course.zip b/python/edu/learn-python/resources/courses/introduction_course.zip
new file mode 100644
index 000000000000..f3b24f24b1e2
--- /dev/null
+++ b/python/edu/learn-python/resources/courses/introduction_course.zip
Binary files differ
diff --git a/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/Run.png b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/Run.png
new file mode 100644
index 000000000000..27a6e362cded
--- /dev/null
+++ b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/Run.png
Binary files differ
diff --git a/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/WatchInput.png b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/WatchInput.png
new file mode 100644
index 000000000000..4992191eb9e7
--- /dev/null
+++ b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/WatchInput.png
Binary files differ
diff --git a/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/add.png b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/add.png
new file mode 100644
index 000000000000..9494f2d0c72e
--- /dev/null
+++ b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/add.png
Binary files differ
diff --git a/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/checked.png b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/checked.png
new file mode 100644
index 000000000000..4105a01f1353
--- /dev/null
+++ b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/checked.png
Binary files differ
diff --git a/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/failed.png b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/failed.png
new file mode 100644
index 000000000000..e2aaa556056e
--- /dev/null
+++ b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/failed.png
Binary files differ
diff --git a/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/icon.jpg b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/icon.jpg
new file mode 100644
index 000000000000..3a9716e4e1fb
--- /dev/null
+++ b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/icon.jpg
Binary files differ
diff --git a/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/next.png b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/next.png
new file mode 100644
index 000000000000..dd1a5d9aebf3
--- /dev/null
+++ b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/next.png
Binary files differ
diff --git a/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/playground.png b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/playground.png
new file mode 100644
index 000000000000..d12a751c0c40
--- /dev/null
+++ b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/playground.png
Binary files differ
diff --git a/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/prev.png b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/prev.png
new file mode 100644
index 000000000000..0656f81eee83
--- /dev/null
+++ b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/prev.png
Binary files differ
diff --git a/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/refresh.png b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/refresh.png
new file mode 100644
index 000000000000..d595f6b42f56
--- /dev/null
+++ b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/refresh.png
Binary files differ
diff --git a/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/refresh24.png b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/refresh24.png
new file mode 100644
index 000000000000..218f075d0c18
--- /dev/null
+++ b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/refresh24.png
Binary files differ
diff --git a/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/resolve.png b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/resolve.png
new file mode 100644
index 000000000000..7ef960bcf244
--- /dev/null
+++ b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/resolve.png
Binary files differ
diff --git a/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/resolve_dark.png b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/resolve_dark.png
new file mode 100644
index 000000000000..99aaa1d20a32
--- /dev/null
+++ b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/resolve_dark.png
Binary files differ
diff --git a/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/showHint.png b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/showHint.png
new file mode 100644
index 000000000000..f10fd560464a
--- /dev/null
+++ b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/showHint.png
Binary files differ
diff --git a/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/unchecked.png b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/unchecked.png
new file mode 100644
index 000000000000..2145982cf2be
--- /dev/null
+++ b/python/edu/learn-python/resources/icons/com/jetbrains/python/edu/unchecked.png
Binary files differ