Compare commits

..
17 Commits
Author SHA1 Message Date
winklejo65774 366c09914f Versuch, das Praktikum abzuschließen 2018-12-17 16:42:09 +01:00
winklejo65774 2e11b651a1 Zwischenstand des Praktikums: index-Fkt muss noch angepasst werden! 2018-12-17 16:37:03 +01:00
winklejo65774 9a720248a4 Zwischenstand des Praktikums: index-Fkt muss noch angepasst werden! 2018-11-12 17:15:20 +01:00
winklejo65774 debf9376fc Zwischenstand des vierten Praktikums:
Auslagerung des HTML-Inhalts als eigene HMTL-Datei -> funktioniert!
Vererbte HMTL-Datei "index.html" von "base.html" -> funktioniert!
2018-11-05 16:34:20 +01:00
winklejo65774 99e8c4c710 Fertige erste Django-Webapplikation: selbst generierter Text wird bei Aufruf von
http://127.0.0.1:8000/posts/

angezeigt!
2018-10-29 16:50:31 +01:00
winklejo65774 a4c7ce4b71 First Commit for Django project 2018-10-29 16:20:09 +01:00
winklejo65774 5d1f77852f First Commit for Django project 2018-10-29 16:18:55 +01:00
winklejo65774 ef2c061674 Endstand zweiter Praktikumstag: Erstellung des Moduls + Modulverzeichnis; Unittests funktionieren :-) 2018-10-22 16:36:21 +02:00
winklejo65774 acee1de090 Zwischenstand zweiter Praktikumstag: Erstellung des Moduls + Modulverzeichnis 2018-10-22 15:45:36 +02:00
winklejo65774 f226586b89 Zwischenstand erster Praktikumstag: Aufgaben 1-3 funktionieren, Aufgabe 4 ist noch zu implementieren 2018-10-18 13:28:24 +02:00
winklejo65774 a2b00b7801 Merge branch 'master' of https://git.efi.th-nuernberg.de/gitea/winklejo65774/Repo_fuer_mEIM_Semester7
* 'master' of https://git.efi.th-nuernberg.de/gitea/winklejo65774/Repo_fuer_mEIM_Semester7:
  Endstand Aufgabe 1 und Aufgabe 2
  Zwischenstand Server- und Clientinitialisierung (Verbindung funktioniert noch nicht)
2018-10-16 10:34:34 +02:00
winklejo65774 d705fd863e Dienstag_2 2018-10-16 10:33:50 +02:00
winklejo65774 adc5542da0 Dienstag 2018-10-16 10:32:51 +02:00
winklejo65774 d121650cbf Fertiges PONG-Spiel (Beta-Version zu finden unter "Tag2_EigenesSpiel.py") 2018-10-16 10:11:35 +02:00
winklejo65774 5722b22818 Fertiges PONG-Spiel (Beta-Version zu finden unter "Tag2_EigenesSpiel.py") 2018-10-16 10:11:04 +02:00
winklejo65774 b3d7b7212b Endstand Aufgabe 1 und Aufgabe 2 2018-10-15 17:24:47 +02:00
winklejo65774 7c4ae69817 Zwischenstand Server- und Clientinitialisierung (Verbindung funktioniert noch nicht) 2018-10-15 16:15:38 +02:00
399 changed files with 101277 additions and 1 deletions

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.7" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Django" />
<option name="TEMPLATE_FOLDERS">
<list>
<option value="$MODULE_DIR$/Django_Project/templates" />
</list>
</option>
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>
+3
View File
@@ -0,0 +1,3 @@
<component name="ProjectDictionaryState">
<dictionary name="Lenovo" />
</component>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/Aufg2_Starthash.py" charset="ISO-8859-1" />
</component>
</project>
+21
View File
@@ -0,0 +1,21 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ourVersions">
<value>
<list size="1">
<item index="0" class="java.lang.String" itemvalue="3.7" />
</list>
</value>
</option>
</inspection_tool>
<inspection_tool class="PyPep8Inspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="PyPep8NamingInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />
<option name="processComments" value="true" />
</inspection_tool>
</profile>
</component>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
<component name="PythonCompatibilityInspectionAdvertiser">
<option name="version" value="3" />
</component>
</project>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Web- und Skriptsprachen (Python-Blockkurs).iml" filepath="$PROJECT_DIR$/.idea/Web- und Skriptsprachen (Python-Blockkurs).iml" />
</modules>
</component>
</project>
Generated
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
+731
View File
@@ -0,0 +1,731 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="39276d0a-00e3-48d0-9c0e-a0d08278b21f" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/Django_Project/templates/posts/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/Web- und Skriptsprachen (Python-Blockkurs).iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/Web- und Skriptsprachen (Python-Blockkurs).iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Django_Project/.idea/Django_Project.iml" beforeDir="false" afterPath="$PROJECT_DIR$/Django_Project/.idea/Django_Project.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Django_Project/posts/views.py" beforeDir="false" afterPath="$PROJECT_DIR$/Django_Project/posts/views.py" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CoverageDataManager">
<SUITE FILE_PATH="coverage/Web__und_Skriptsprachen__Python_Blockkurs_$Unittests_for_test_hashMod_TestHashMod.coverage" NAME="Unittests for test_hashMod.TestHashMod Coverage Results" MODIFIED="1540218541704" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018" />
<SUITE FILE_PATH="coverage/Web__und_Skriptsprachen__Python_Blockkurs_$AB1_Aufg3.coverage" NAME="AB1_Aufg3 Coverage Results" MODIFIED="1538810960299" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Web__und_Skriptsprachen__Python_Blockkurs_$Aufg2_Starthash.coverage" NAME="Aufg2_Starthash Coverage Results" MODIFIED="1540218936010" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018" />
<SUITE FILE_PATH="coverage/Web__und_Skriptsprachen__Python_Blockkurs_$AB1_Aufg5.coverage" NAME="AB1_Aufg5 Coverage Results" MODIFIED="1538811804618" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Web__und_Skriptsprachen__Python_Blockkurs_$Aufg4_Quadratzahlen_Server.coverage" NAME="Aufg4_Quadratzahlen_Server Coverage Results" MODIFIED="1539864686187" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag1_15.10.2018" />
<SUITE FILE_PATH="coverage/Web__und_Skriptsprachen__Python_Blockkurs_$Pong.coverage" NAME="Pong Coverage Results" MODIFIED="1539414307376" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Web__und_Skriptsprachen__Python_Blockkurs_$hashes.coverage" NAME="hashes Coverage Results" MODIFIED="1540218926822" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/krypto" />
<SUITE FILE_PATH="coverage/Web__und_Skriptsprachen__Python_Blockkurs_$Tag2_MittelwertAusVariablerAnzahlParameter.coverage" NAME="Tag2_MittelwertAusVariablerAnzahlParameter Coverage Results" MODIFIED="1538815118408" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Web__und_Skriptsprachen__Python_Blockkurs_$Tag2_EigenesSpiel.coverage" NAME="Tag2_EigenesSpiel Coverage Results" MODIFIED="1538827299769" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Web__und_Skriptsprachen__Python_Blockkurs_$Starthash.coverage" NAME="Starthash Coverage Results" MODIFIED="1540200159750" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/krypto" />
<SUITE FILE_PATH="coverage/Web__und_Skriptsprachen__Python_Blockkurs_$Unittests_in_test_hashMod_py.coverage" NAME="Unittests in test_hashMod.py Coverage Results" MODIFIED="1540218229095" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018" />
<SUITE FILE_PATH="coverage/Web__und_Skriptsprachen__Python_Blockkurs_$Aufg4_VerwendungVonUnittest.coverage" NAME="Aufg4_VerwendungVonUnittest Coverage Results" MODIFIED="1540217916026" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018" />
<SUITE FILE_PATH="coverage/Web__und_Skriptsprachen__Python_Blockkurs_$FirstProgram.coverage" NAME="FirstProgram Coverage Results" MODIFIED="1538766705533" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/Web__und_Skriptsprachen__Python_Blockkurs_$Aufg3_YingUndYang_Server.coverage" NAME="Aufg3_YingUndYang_Server Coverage Results" MODIFIED="1539861830668" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung" />
<SUITE FILE_PATH="coverage/Web__und_Skriptsprachen__Python_Blockkurs_$Unittests_for_test_hashMod_TestHashMod_test_hashMod.coverage" NAME="Unittests for test_hashMod.TestHashMod.test_hashMod Coverage Results" MODIFIED="1540218943701" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018" />
</component>
<component name="DatabaseView">
<option name="SHOW_INTERMEDIATE" value="true" />
<option name="GROUP_DATA_SOURCES" value="true" />
<option name="GROUP_SCHEMA" value="true" />
<option name="GROUP_CONTENTS" value="false" />
<option name="SORT_POSITIONED" value="false" />
<option name="SHOW_EMPTY_GROUPS" value="false" />
<option name="AUTO_SCROLL_FROM_SOURCE" value="false" />
<option name="HIDDEN_KINDS">
<set />
</option>
<expand />
<select />
</component>
<component name="FUSProjectUsageTrigger">
<session id="2005159020">
<usages-collector id="statistics.lifecycle.project">
<counts>
<entry key="project.closed" value="22" />
<entry key="project.open.time.1" value="1" />
<entry key="project.open.time.10" value="3" />
<entry key="project.open.time.11" value="4" />
<entry key="project.open.time.12" value="3" />
<entry key="project.open.time.13" value="2" />
<entry key="project.open.time.14" value="3" />
<entry key="project.open.time.15" value="2" />
<entry key="project.open.time.16" value="1" />
<entry key="project.open.time.59" value="1" />
<entry key="project.open.time.8" value="2" />
<entry key="project.open.time.9" value="1" />
<entry key="project.opened" value="23" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="css" value="2" />
<entry key="htm" value="2" />
<entry key="html" value="12" />
<entry key="js" value="2" />
<entry key="py" value="23" />
<entry key="txt" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="CSS" value="2" />
<entry key="HTML" value="14" />
<entry key="JavaScript" value="2" />
<entry key="PLAIN_TEXT" value="1" />
<entry key="Python" value="23" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="css" value="197" />
<entry key="html" value="925" />
<entry key="js" value="1018" />
<entry key="py" value="10949" />
<entry key="txt" value="274" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="CSS" value="197" />
<entry key="HTML" value="925" />
<entry key="JavaScript" value="1018" />
<entry key="PLAIN_TEXT" value="274" />
<entry key="Python" value="10949" />
</counts>
</usages-collector>
</session>
<session id="314269149">
<usages-collector id="statistics.lifecycle.project">
<counts>
<entry key="project.closed" value="4" />
<entry key="project.open.time.0" value="1" />
<entry key="project.open.time.11" value="1" />
<entry key="project.open.time.3" value="1" />
<entry key="project.opened" value="4" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="html" value="1" />
<entry key="py" value="6" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="HTML" value="1" />
<entry key="Python" value="6" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="html" value="48" />
<entry key="py" value="38" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="HTML" value="48" />
<entry key="Python" value="38" />
</counts>
</usages-collector>
</session>
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Django_Project/templates/posts/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="119">
<caret line="7" column="39" selection-start-line="7" selection-start-column="39" selection-end-line="7" selection-end-column="39" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Django_Project/posts/urls.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Django_Project/Django_Project/urls.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/Django_Project/posts/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="102">
<caret line="7" selection-start-line="7" selection-end-line="7" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="CSS File" />
<option value="JavaScript File" />
<option value="Python Script" />
<option value="HTML File" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="UPDATE_TYPE" value="REBASE" />
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/AB1_Aufg2.py" />
<option value="$PROJECT_DIR$/AB1_Aufg3.py" />
<option value="$PROJECT_DIR$/AB1_Aufg5.py" />
<option value="$PROJECT_DIR$/Tag2_MittelwertAusVariablerAnzahlParameter.py" />
<option value="$PROJECT_DIR$/Tag2_EigenesSpiel.py" />
<option value="$PROJECT_DIR$/Pong.py" />
<option value="$PROJECT_DIR$/AB4_Aufg2.html" />
<option value="$PROJECT_DIR$/formatiert.css" />
<option value="$PROJECT_DIR$/HTML_Test_Doc.html" />
<option value="$PROJECT_DIR$/Format_zu_AB5.css" />
<option value="$PROJECT_DIR$/AB4_Aufg1.html" />
<option value="$PROJECT_DIR$/Popups_zu_AB6.js" />
<option value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Ying_File.html" />
<option value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Yang_File.html" />
<option value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Aufg3_YingUndYang_Server.py" />
<option value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag1_15.10.2018/Aufg4_Quadratzahlen_Server.py" />
<option value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/krypto/__init__.py" />
<option value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/krypto/Starthash.py" />
<option value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/Aufg2_Starthash.py" />
<option value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/Aufg4_VerwendungVonUnittest.py" />
<option value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/test_hashMod.py" />
<option value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/krypto/hashes.py" />
<option value="$PROJECT_DIR$/Django_Project/posts/views.py" />
<option value="$PROJECT_DIR$/Django_Project/templates/posts/index.html" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="56" />
<option name="y" value="54" />
<option name="width" value="1400" />
<option name="height" value="820" />
</component>
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
<profile-state>
<expanded-state>
<State>
<id />
</State>
<State>
<id>Code style issuesJavaScript</id>
</State>
<State>
<id>DOM issuesJavaScript</id>
</State>
<State>
<id>ECMAScript 6 migration aidsJavaScript</id>
</State>
<State>
<id>GeneralJavaScript</id>
</State>
<State>
<id>JavaScript</id>
</State>
<State>
<id>TypeScript</id>
</State>
</expanded-state>
</profile-state>
</entry>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<ConfirmationsSetting value="2" id="Add" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="Repo_fuer_mEIM_Semester7" type="b2602c69:ProjectViewProjectNode" />
<item name="Repo_fuer_mEIM_Semester7" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Repo_fuer_mEIM_Semester7" type="b2602c69:ProjectViewProjectNode" />
<item name="Repo_fuer_mEIM_Semester7" type="462c0819:PsiDirectoryNode" />
<item name="Django_Project" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Repo_fuer_mEIM_Semester7" type="b2602c69:ProjectViewProjectNode" />
<item name="Repo_fuer_mEIM_Semester7" type="462c0819:PsiDirectoryNode" />
<item name="Django_Project" type="462c0819:PsiDirectoryNode" />
<item name="Django_Project" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Repo_fuer_mEIM_Semester7" type="b2602c69:ProjectViewProjectNode" />
<item name="Repo_fuer_mEIM_Semester7" type="462c0819:PsiDirectoryNode" />
<item name="Django_Project" type="462c0819:PsiDirectoryNode" />
<item name="posts" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="Repo_fuer_mEIM_Semester7" type="b2602c69:ProjectViewProjectNode" />
<item name="Repo_fuer_mEIM_Semester7" type="462c0819:PsiDirectoryNode" />
<item name="Django_Project" type="462c0819:PsiDirectoryNode" />
<item name="templates" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="DefaultHtmlFileTemplate" value="HTML File" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/Django_Project" />
<property name="list.type.of.created.stylesheet" value="CSS" />
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.templateLanguages.PyTemplateLanguageModulesConfigurable" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="C:\JONKA\Uni\7. Semester (Medizintechnik OHM Nürnberg)\Vorlesung Informationssysteme in der medizintechnik (MEIM)\Web- und Skriptsprachen (Python-Blockkurs)\Python-Blockkurs" />
<recent name="C:\JONKA\Uni\7. Semester (Medizintechnik OHM Nürnberg)\Vorlesung Informationssysteme in der medizintechnik (MEIM)\Web- und Skriptsprachen (Python-Blockkurs)\mEIM-Praktikum_Webentwicklung\Tag1_15.10.2018" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager" selected="Python.Aufg2_Starthash">
<configuration name="Aufg2_Starthash" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="Web- und Skriptsprachen (Python-Blockkurs)" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/Aufg2_Starthash.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="hashes" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="Web- und Skriptsprachen (Python-Blockkurs)" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/krypto" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/krypto/hashes.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="Unittests for test_hashMod.TestHashMod" type="tests" factoryName="Unittests" temporary="true" nameIsGenerated="true">
<module name="Web- und Skriptsprachen (Python-Blockkurs)" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;test_hashMod.TestHashMod&quot;" />
<option name="_new_targetType" value="&quot;PYTHON&quot;" />
<method v="2" />
</configuration>
<configuration name="Unittests for test_hashMod.TestHashMod.test_hashMod" type="tests" factoryName="Unittests" temporary="true" nameIsGenerated="true">
<module name="Web- und Skriptsprachen (Python-Blockkurs)" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;test_hashMod.TestHashMod.test_hashMod&quot;" />
<option name="_new_targetType" value="&quot;PYTHON&quot;" />
<method v="2" />
</configuration>
<configuration name="Unittests in test_hashMod.py" type="tests" factoryName="Unittests" temporary="true" nameIsGenerated="true">
<module name="Web- und Skriptsprachen (Python-Blockkurs)" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/test_hashMod.py&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method v="2" />
</configuration>
<list>
<item itemvalue="Python.Aufg2_Starthash" />
<item itemvalue="Python tests.Unittests for test_hashMod.TestHashMod" />
<item itemvalue="Python tests.Unittests for test_hashMod.TestHashMod.test_hashMod" />
<item itemvalue="Python tests.Unittests in test_hashMod.py" />
<item itemvalue="Python.hashes" />
</list>
<recent_temporary>
<list>
<item itemvalue="Python.hashes" />
<item itemvalue="Python tests.Unittests in test_hashMod.py" />
<item itemvalue="Python tests.Unittests for test_hashMod.TestHashMod.test_hashMod" />
<item itemvalue="Python tests.Unittests for test_hashMod.TestHashMod" />
<item itemvalue="Python.Aufg2_Starthash" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="39276d0a-00e3-48d0-9c0e-a0d08278b21f" name="Default Changelist" comment="" />
<created>1538765946920</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1538765946920</updated>
</task>
<task id="LOCAL-00001" summary="Initialization">
<created>1538813521977</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1538813521977</updated>
</task>
<task id="LOCAL-00002" summary="Das ist ein Commit-Test für Janko">
<created>1538815642691</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1538815642692</updated>
</task>
<task id="LOCAL-00003" summary="Fertiges PONG-Spiel (Beta-Version zu finden unter &quot;Tag2_EigenesSpiel.py&quot;)">
<created>1539416867064</created>
<option name="number" value="00003" />
<option name="presentableId" value="LOCAL-00003" />
<option name="project" value="LOCAL" />
<updated>1539416867064</updated>
</task>
<task id="LOCAL-00004" summary="Fertiges PONG-Spiel (Beta-Version zu finden unter &quot;Tag2_EigenesSpiel.py&quot;)">
<created>1539677464477</created>
<option name="number" value="00004" />
<option name="presentableId" value="LOCAL-00004" />
<option name="project" value="LOCAL" />
<updated>1539677464477</updated>
</task>
<task id="LOCAL-00005" summary="Fertiges PONG-Spiel (Beta-Version zu finden unter &quot;Tag2_EigenesSpiel.py&quot;)">
<created>1539677495365</created>
<option name="number" value="00005" />
<option name="presentableId" value="LOCAL-00005" />
<option name="project" value="LOCAL" />
<updated>1539677495365</updated>
</task>
<task id="LOCAL-00006" summary="Zwischenstand erster Praktikumstag: Aufgaben 1-3 funktionieren, Aufgabe 4 ist noch zu implementieren">
<created>1539862104249</created>
<option name="number" value="00006" />
<option name="presentableId" value="LOCAL-00006" />
<option name="project" value="LOCAL" />
<updated>1539862104249</updated>
</task>
<task id="LOCAL-00007" summary="Zwischenstand zweiter Praktikumstag: Erstellung des Moduls + Modulverzeichnis">
<created>1540215936875</created>
<option name="number" value="00007" />
<option name="presentableId" value="LOCAL-00007" />
<option name="project" value="LOCAL" />
<updated>1540215936875</updated>
</task>
<option name="localTasksCounter" value="8" />
<servers />
</component>
<component name="TestHistory">
<history-entry file="Unittests_for_test_hashMod_TestHashMod - 2018.10.22 at 16h 29m 02s.xml">
<configuration name="Unittests for test_hashMod.TestHashMod" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_for_test_hashMod_TestHashMod_test_hashMod - 2018.10.22 at 16h 33m 11s.xml">
<configuration name="Unittests for test_hashMod.TestHashMod.test_hashMod" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_for_test_hashMod_TestHashMod_test_hashMod - 2018.10.22 at 16h 33m 30s.xml">
<configuration name="Unittests for test_hashMod.TestHashMod.test_hashMod" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_for_test_hashMod_TestHashMod_test_hashMod - 2018.10.22 at 16h 34m 00s.xml">
<configuration name="Unittests for test_hashMod.TestHashMod.test_hashMod" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_for_test_hashMod_TestHashMod_test_hashMod - 2018.10.22 at 16h 35m 44s.xml">
<configuration name="Unittests for test_hashMod.TestHashMod.test_hashMod" configurationId="tests" />
</history-entry>
<history-entry file="Unittests_in_test_hashMod_py - 2018.10.22 at 16h 23m 50s.xml">
<configuration name="Unittests in test_hashMod.py" configurationId="tests" />
</history-entry>
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1616" height="876" extended-state="6" />
<editor active="true" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.29241645" />
<window_info id="Structure" order="1" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
<window_info anchor="bottom" id="Version Control" order="8" visible="true" weight="0.32974428" />
<window_info anchor="bottom" id="Terminal" order="9" />
<window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
<window_info anchor="bottom" id="Python Console" order="11" />
<window_info anchor="bottom" id="Database Changes" order="12" show_stripe_button="false" />
<window_info anchor="right" id="Commander" order="0" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
<window_info anchor="right" id="SciView" order="3" />
<window_info anchor="right" id="Database" order="4" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Initialization" />
<MESSAGE value="Das ist ein Commit-Test für Janko" />
<MESSAGE value="Fertiges PONG-Spiel (Beta-Version zu finden unter &quot;Tag2_EigenesSpiel.py&quot;)" />
<MESSAGE value="Zwischenstand erster Praktikumstag: Aufgaben 1-3 funktionieren, Aufgabe 4 ist noch zu implementieren" />
<MESSAGE value="Zwischenstand zweiter Praktikumstag: Erstellung des Moduls + Modulverzeichnis" />
<option name="LAST_COMMIT_MESSAGE" value="Zwischenstand zweiter Praktikumstag: Erstellung des Moduls + Modulverzeichnis" />
</component>
<component name="XDebuggerManager">
<watches-manager>
<configuration name="PythonConfigurationType">
<watch expression="size_image[0]/2 &lt;= image_rect.centerx &lt;= width-(size_image[0]/2) and size_image[1]/2 &lt;= image_rect.centery &lt;= height-(size_image[1]/2)" language="Python" />
<watch expression="image_rect.centerx" language="Python" />
<watch expression="image_rect.centery" language="Python" />
<watch expression="move_vector" language="Python" />
<watch expression="image.get_rect().size" language="Python" />
</configuration>
</watches-manager>
</component>
<component name="debuggerHistoryManager">
<expressions id="watch">
<expression>
<expression-string>width-(size_image[0]/2)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>image.get_rect().size</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>move_vector</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>image_rect.centery</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>image_rect.centerx</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>size_image[0]/2 &lt;= image_rect.centerx &lt;= width-(size_image[0]/2) and size_image[1]/2 &lt;= image_rect.centery &lt;= height-(size_image[1]/2)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
</expressions>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/FirstProgramm.py.txt" />
<entry file="file://$PROJECT_DIR$/AB1_Aufg2.py" />
<entry file="file://$PROJECT_DIR$/AB1_Aufg3.py" />
<entry file="file://$PROJECT_DIR$/AB1_Aufg4.py" />
<entry file="file://$PROJECT_DIR$/AB1_Aufg5.py" />
<entry file="file://$PROJECT_DIR$/FirstProgram.py" />
<entry file="file://$PROJECT_DIR$/Tag2_MittelwertAusVariablerAnzahlParameter.py" />
<entry file="file://$APPLICATION_HOME_DIR$/helpers/pydev/_pydev_imps/_pydev_execfile.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="289">
<caret line="17" selection-start-line="17" selection-end-line="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Python-Blockkurs/formatiert.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="17">
<caret line="1" column="15" selection-start-line="1" selection-start-column="15" selection-end-line="1" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Python-Blockkurs/Format_zu_AB5.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="561">
<caret line="33" column="22" selection-start-line="33" selection-start-column="22" selection-end-line="33" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Tag2_EigenesSpiel.py" />
<entry file="file://$PROJECT_DIR$/Pong.py" />
<entry file="file://$PROJECT_DIR$/Python-Blockkurs/Popups_zu_AB6.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="136">
<caret line="8" column="33" selection-start-line="8" selection-start-column="33" selection-end-line="8" selection-end-column="33" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Python-Blockkurs/HTML_Test_Doc.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="85">
<caret line="5" column="49" selection-start-line="5" selection-start-column="49" selection-end-line="5" selection-end-column="49" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Python-Blockkurs/LangesDoc.htm">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="68">
<caret line="4" column="32" lean-forward="true" selection-start-line="4" selection-start-column="32" selection-end-line="4" selection-end-column="107" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag1_15.10.2018/Ying_File.html" />
<entry file="file://$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag1_15.10.2018/Yang_File.html" />
<entry file="file://$PROJECT_DIR$/Python-Blockkurs/AB4_Aufg2.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="15" column="8" selection-start-line="15" selection-start-column="8" selection-end-line="15" selection-end-column="8" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag1_15.10.2018/Aufg3_YingUndYang_Server.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="661">
<caret line="51" selection-start-line="51" selection-end-line="56" selection-end-column="24" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Python-Blockkurs/AB4_Aufg1.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="561">
<caret line="33" column="7" selection-start-line="33" selection-start-column="7" selection-end-line="33" selection-end-column="7" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/AppData/Local/Temp/Temp1_Uebungs-Dateien.zip/Dateien/Uebung/temperature.py" />
<entry file="file://$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/krypto/Starthash.py" />
<entry file="file://$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag1_15.10.2018/Aufg4_Quadratzahlen_Server.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="391">
<caret line="24" column="26" selection-start-line="24" selection-start-column="26" selection-end-line="24" selection-end-column="26" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/Aufg4_VerwendungVonUnittest.py" />
<entry file="file://$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/Aufg2_Starthash.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
<caret line="3" column="11" selection-start-line="3" selection-start-column="11" selection-end-line="3" selection-end-column="11" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/test_hashMod.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="13" column="18" selection-start-line="13" selection-start-column="18" selection-end-line="13" selection-end-column="18" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/mEIM-Praktikum_Webentwicklung/Tag2_22.10.2018/krypto/hashes.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="170">
<caret line="10" column="14" selection-start-line="10" selection-start-column="14" selection-end-line="10" selection-end-column="14" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Django_Project/templates/posts/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="119">
<caret line="7" column="39" selection-start-line="7" selection-start-column="39" selection-end-line="7" selection-end-column="39" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Django_Project/posts/urls.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/Django_Project/Django_Project/urls.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/Django_Project/posts/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="102">
<caret line="7" selection-start-line="7" selection-end-line="7" />
</state>
</provider>
</entry>
</component>
</project>
+32
View File
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="FacetManager">
<facet type="django" name="Django">
<configuration>
<option name="rootFolder" value="$MODULE_DIR$" />
<option name="settingsModule" value="Django_Project/settings.py" />
<option name="manageScript" value="$MODULE_DIR$/manage.py" />
<option name="environment" value="&lt;map/&gt;" />
<option name="doNotUseTestRunner" value="false" />
<option name="trackFilePattern" value="migrations" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.7" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Django" />
<option name="TEMPLATE_FOLDERS">
<list>
<option value="$MODULE_DIR$/../Django_Project\templates" />
</list>
</option>
</component>
<component name="TestRunnerService">
<option name="projectConfiguration" value="pytest" />
<option name="PROJECT_TEST_RUNNER" value="py.test" />
</component>
</module>
+22
View File
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="db" uuid="94a4927f-b35a-45fd-a978-43c8801f2dcf">
<driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:C:\JONKA\Uni\7. Semester (Medizintechnik OHM Nürnberg)\Repo_fuer_mEIM_Semester7\Django_Project\db.sqlite3</jdbc-url>
<driver-properties>
<property name="enable_load_extension" value="true" />
</driver-properties>
<libraries>
<library>
<url>file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.25.1/license.txt</url>
</library>
<library>
<url>file://$APPLICATION_CONFIG_DIR$/jdbc-drivers/Xerial SQLiteJDBC/3.25.1/sqlite-jdbc-3.25.1.jar</url>
</library>
</libraries>
</data-source>
</component>
</project>
@@ -0,0 +1,514 @@
<?xml version="1.0" encoding="UTF-8"?>
<dataSource name="db">
<database-model serializer="dbm" rdbms="SQLITE" format-version="4.11">
<root id="1">
<ServerVersion>3.25.1</ServerVersion>
</root>
<schema id="2" parent="1" name="main">
<Current>1</Current>
<Visible>1</Visible>
</schema>
<collation id="3" parent="1" name="BINARY"/>
<collation id="4" parent="1" name="NOCASE"/>
<collation id="5" parent="1" name="RTRIM"/>
<table id="6" parent="2" name="auth_group"/>
<table id="7" parent="2" name="auth_group_permissions"/>
<table id="8" parent="2" name="auth_permission"/>
<table id="9" parent="2" name="auth_user"/>
<table id="10" parent="2" name="auth_user_groups"/>
<table id="11" parent="2" name="auth_user_user_permissions"/>
<table id="12" parent="2" name="django_admin_log"/>
<table id="13" parent="2" name="django_content_type"/>
<table id="14" parent="2" name="django_migrations"/>
<table id="15" parent="2" name="django_session"/>
<table id="16" parent="2" name="posts_notice"/>
<table id="17" parent="2" name="sqlite_master">
<System>1</System>
</table>
<table id="18" parent="2" name="sqlite_sequence">
<System>1</System>
</table>
<column id="19" parent="6" name="id">
<Position>1</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
<SequenceIdentity>1</SequenceIdentity>
</column>
<column id="20" parent="6" name="name">
<Position>2</Position>
<DataType>varchar(80)|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="21" parent="6" name="sqlite_autoindex_auth_group_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>name</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="22" parent="6">
<ColNames>id</ColNames>
<Primary>1</Primary>
</key>
<key id="23" parent="6">
<ColNames>name</ColNames>
<UnderlyingIndexName>sqlite_autoindex_auth_group_1</UnderlyingIndexName>
</key>
<column id="24" parent="7" name="id">
<Position>1</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
<SequenceIdentity>1</SequenceIdentity>
</column>
<column id="25" parent="7" name="group_id">
<Position>2</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="26" parent="7" name="permission_id">
<Position>3</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="27" parent="7" name="auth_group_permissions_group_id_permission_id_0cd325b0_uniq">
<ColNames>group_id
permission_id</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<index id="28" parent="7" name="auth_group_permissions_group_id_b120cbf9">
<ColNames>group_id</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="29" parent="7" name="auth_group_permissions_permission_id_84c5c92e">
<ColNames>permission_id</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="30" parent="7">
<ColNames>id</ColNames>
<Primary>1</Primary>
</key>
<foreign-key id="31" parent="7">
<ColNames>group_id</ColNames>
<RefTableName>auth_group</RefTableName>
<RefColNames>id</RefColNames>
<Deferrable>1</Deferrable>
<InitiallyDeferred>1</InitiallyDeferred>
</foreign-key>
<foreign-key id="32" parent="7">
<ColNames>permission_id</ColNames>
<RefTableName>auth_permission</RefTableName>
<RefColNames>id</RefColNames>
<Deferrable>1</Deferrable>
<InitiallyDeferred>1</InitiallyDeferred>
</foreign-key>
<column id="33" parent="8" name="id">
<Position>1</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
<SequenceIdentity>1</SequenceIdentity>
</column>
<column id="34" parent="8" name="content_type_id">
<Position>2</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="35" parent="8" name="codename">
<Position>3</Position>
<DataType>varchar(100)|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="36" parent="8" name="name">
<Position>4</Position>
<DataType>varchar(255)|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="37" parent="8" name="auth_permission_content_type_id_codename_01ab375a_uniq">
<ColNames>content_type_id
codename</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<index id="38" parent="8" name="auth_permission_content_type_id_2f476e4b">
<ColNames>content_type_id</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="39" parent="8">
<ColNames>id</ColNames>
<Primary>1</Primary>
</key>
<foreign-key id="40" parent="8">
<ColNames>content_type_id</ColNames>
<RefTableName>django_content_type</RefTableName>
<RefColNames>id</RefColNames>
<Deferrable>1</Deferrable>
<InitiallyDeferred>1</InitiallyDeferred>
</foreign-key>
<column id="41" parent="9" name="id">
<Position>1</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
<SequenceIdentity>1</SequenceIdentity>
</column>
<column id="42" parent="9" name="password">
<Position>2</Position>
<DataType>varchar(128)|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="43" parent="9" name="last_login">
<Position>3</Position>
<DataType>datetime|0s</DataType>
</column>
<column id="44" parent="9" name="is_superuser">
<Position>4</Position>
<DataType>bool|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="45" parent="9" name="username">
<Position>5</Position>
<DataType>varchar(150)|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="46" parent="9" name="first_name">
<Position>6</Position>
<DataType>varchar(30)|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="47" parent="9" name="email">
<Position>7</Position>
<DataType>varchar(254)|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="48" parent="9" name="is_staff">
<Position>8</Position>
<DataType>bool|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="49" parent="9" name="is_active">
<Position>9</Position>
<DataType>bool|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="50" parent="9" name="date_joined">
<Position>10</Position>
<DataType>datetime|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="51" parent="9" name="last_name">
<Position>11</Position>
<DataType>varchar(150)|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="52" parent="9" name="sqlite_autoindex_auth_user_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>username</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="53" parent="9">
<ColNames>id</ColNames>
<Primary>1</Primary>
</key>
<key id="54" parent="9">
<ColNames>username</ColNames>
<UnderlyingIndexName>sqlite_autoindex_auth_user_1</UnderlyingIndexName>
</key>
<column id="55" parent="10" name="id">
<Position>1</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
<SequenceIdentity>1</SequenceIdentity>
</column>
<column id="56" parent="10" name="user_id">
<Position>2</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="57" parent="10" name="group_id">
<Position>3</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="58" parent="10" name="auth_user_groups_user_id_group_id_94350c0c_uniq">
<ColNames>user_id
group_id</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<index id="59" parent="10" name="auth_user_groups_user_id_6a12ed8b">
<ColNames>user_id</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="60" parent="10" name="auth_user_groups_group_id_97559544">
<ColNames>group_id</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="61" parent="10">
<ColNames>id</ColNames>
<Primary>1</Primary>
</key>
<foreign-key id="62" parent="10">
<ColNames>user_id</ColNames>
<RefTableName>auth_user</RefTableName>
<RefColNames>id</RefColNames>
<Deferrable>1</Deferrable>
<InitiallyDeferred>1</InitiallyDeferred>
</foreign-key>
<foreign-key id="63" parent="10">
<ColNames>group_id</ColNames>
<RefTableName>auth_group</RefTableName>
<RefColNames>id</RefColNames>
<Deferrable>1</Deferrable>
<InitiallyDeferred>1</InitiallyDeferred>
</foreign-key>
<column id="64" parent="11" name="id">
<Position>1</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
<SequenceIdentity>1</SequenceIdentity>
</column>
<column id="65" parent="11" name="user_id">
<Position>2</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="66" parent="11" name="permission_id">
<Position>3</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="67" parent="11" name="auth_user_user_permissions_user_id_permission_id_14a6b632_uniq">
<ColNames>user_id
permission_id</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<index id="68" parent="11" name="auth_user_user_permissions_user_id_a95ead1b">
<ColNames>user_id</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="69" parent="11" name="auth_user_user_permissions_permission_id_1fbb5f2c">
<ColNames>permission_id</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="70" parent="11">
<ColNames>id</ColNames>
<Primary>1</Primary>
</key>
<foreign-key id="71" parent="11">
<ColNames>user_id</ColNames>
<RefTableName>auth_user</RefTableName>
<RefColNames>id</RefColNames>
<Deferrable>1</Deferrable>
<InitiallyDeferred>1</InitiallyDeferred>
</foreign-key>
<foreign-key id="72" parent="11">
<ColNames>permission_id</ColNames>
<RefTableName>auth_permission</RefTableName>
<RefColNames>id</RefColNames>
<Deferrable>1</Deferrable>
<InitiallyDeferred>1</InitiallyDeferred>
</foreign-key>
<column id="73" parent="12" name="id">
<Position>1</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
<SequenceIdentity>1</SequenceIdentity>
</column>
<column id="74" parent="12" name="action_time">
<Position>2</Position>
<DataType>datetime|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="75" parent="12" name="object_id">
<Position>3</Position>
<DataType>text|0s</DataType>
</column>
<column id="76" parent="12" name="object_repr">
<Position>4</Position>
<DataType>varchar(200)|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="77" parent="12" name="change_message">
<Position>5</Position>
<DataType>text|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="78" parent="12" name="content_type_id">
<Position>6</Position>
<DataType>integer|0s</DataType>
</column>
<column id="79" parent="12" name="user_id">
<Position>7</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="80" parent="12" name="action_flag">
<Position>8</Position>
<DataType>smallint unsigned|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="81" parent="12" name="django_admin_log_content_type_id_c4bce8eb">
<ColNames>content_type_id</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<index id="82" parent="12" name="django_admin_log_user_id_c564eba6">
<ColNames>user_id</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="83" parent="12">
<ColNames>id</ColNames>
<Primary>1</Primary>
</key>
<foreign-key id="84" parent="12">
<ColNames>content_type_id</ColNames>
<RefTableName>django_content_type</RefTableName>
<RefColNames>id</RefColNames>
<Deferrable>1</Deferrable>
<InitiallyDeferred>1</InitiallyDeferred>
</foreign-key>
<foreign-key id="85" parent="12">
<ColNames>user_id</ColNames>
<RefTableName>auth_user</RefTableName>
<RefColNames>id</RefColNames>
<Deferrable>1</Deferrable>
<InitiallyDeferred>1</InitiallyDeferred>
</foreign-key>
<column id="86" parent="13" name="id">
<Position>1</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
<SequenceIdentity>1</SequenceIdentity>
</column>
<column id="87" parent="13" name="app_label">
<Position>2</Position>
<DataType>varchar(100)|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="88" parent="13" name="model">
<Position>3</Position>
<DataType>varchar(100)|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="89" parent="13" name="django_content_type_app_label_model_76bd3d3b_uniq">
<ColNames>app_label
model</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<key id="90" parent="13">
<ColNames>id</ColNames>
<Primary>1</Primary>
</key>
<column id="91" parent="14" name="id">
<Position>1</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
<SequenceIdentity>1</SequenceIdentity>
</column>
<column id="92" parent="14" name="app">
<Position>2</Position>
<DataType>varchar(255)|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="93" parent="14" name="name">
<Position>3</Position>
<DataType>varchar(255)|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="94" parent="14" name="applied">
<Position>4</Position>
<DataType>datetime|0s</DataType>
<NotNull>1</NotNull>
</column>
<key id="95" parent="14">
<ColNames>id</ColNames>
<Primary>1</Primary>
</key>
<column id="96" parent="15" name="session_key">
<Position>1</Position>
<DataType>varchar(40)|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="97" parent="15" name="session_data">
<Position>2</Position>
<DataType>text|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="98" parent="15" name="expire_date">
<Position>3</Position>
<DataType>datetime|0s</DataType>
<NotNull>1</NotNull>
</column>
<index id="99" parent="15" name="sqlite_autoindex_django_session_1">
<NameSurrogate>1</NameSurrogate>
<ColNames>session_key</ColNames>
<ColumnCollations></ColumnCollations>
<Unique>1</Unique>
</index>
<index id="100" parent="15" name="django_session_expire_date_a5c62663">
<ColNames>expire_date</ColNames>
<ColumnCollations></ColumnCollations>
</index>
<key id="101" parent="15">
<ColNames>session_key</ColNames>
<Primary>1</Primary>
<UnderlyingIndexName>sqlite_autoindex_django_session_1</UnderlyingIndexName>
</key>
<column id="102" parent="16" name="id">
<Position>1</Position>
<DataType>integer|0s</DataType>
<NotNull>1</NotNull>
<SequenceIdentity>1</SequenceIdentity>
</column>
<column id="103" parent="16" name="notice_title">
<Position>2</Position>
<DataType>varchar(80)|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="104" parent="16" name="notice_text">
<Position>3</Position>
<DataType>varchar(400)|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="105" parent="16" name="pub_start">
<Position>4</Position>
<DataType>datetime|0s</DataType>
<NotNull>1</NotNull>
</column>
<column id="106" parent="16" name="pub_end">
<Position>5</Position>
<DataType>datetime|0s</DataType>
<NotNull>1</NotNull>
</column>
<key id="107" parent="16">
<ColNames>id</ColNames>
<Primary>1</Primary>
</key>
<column id="108" parent="17" name="type">
<Position>1</Position>
<DataType>text|0s</DataType>
</column>
<column id="109" parent="17" name="name">
<Position>2</Position>
<DataType>text|0s</DataType>
</column>
<column id="110" parent="17" name="tbl_name">
<Position>3</Position>
<DataType>text|0s</DataType>
</column>
<column id="111" parent="17" name="rootpage">
<Position>4</Position>
<DataType>int|0s</DataType>
</column>
<column id="112" parent="17" name="sql">
<Position>5</Position>
<DataType>text|0s</DataType>
</column>
<column id="113" parent="18" name="name">
<Position>1</Position>
</column>
<column id="114" parent="18" name="seq">
<Position>2</Position>
</column>
</database-model>
</dataSource>
@@ -0,0 +1,2 @@
#n:main
!<md> [0, 0, null, null, -2147483648, -2147483648]
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
</project>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Django_Project.iml" filepath="$PROJECT_DIR$/.idea/Django_Project.iml" />
</modules>
</component>
</project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
Whitespace-only changes.
+125
View File
@@ -0,0 +1,125 @@
"""
Django settings for Django_Project project.
Generated by 'django-admin startproject' using Django 2.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '09h#1oq19v30#7-!iwg-5g5xi5va6)v7v*f668#att@z5n#d#2'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'posts.apps.PostsConfig',
'rest_framework',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'Django_Project.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')]
,
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'Django_Project.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Password validation
# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/2.1/topics/i18n/
LANGUAGE_CODE = 'de-de'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/
STATIC_URL = '/static/'
+25
View File
@@ -0,0 +1,25 @@
"""Django_Project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.urls import path
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^posts/', include('posts.urls')),
]
+16
View File
@@ -0,0 +1,16 @@
"""
WSGI config for Django_Project project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Django_Project.settings')
application = get_wsgi_application()
Binary file not shown.
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Django_Project.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
View File
Whitespace-only changes.
+3
View File
@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.
+5
View File
@@ -0,0 +1,5 @@
from django.apps import AppConfig
class PostsConfig(AppConfig):
name = 'posts'
+13
View File
@@ -0,0 +1,13 @@
from django import forms
import datetime
class NoticeForm(forms.Form):
date_formats = ['%d.%m.%Y', '%d.%m.%y']
title = forms.CharField(label='Titel', max_length=80)
text = forms.CharField(label='Text', max_length=400)
start = forms.DateField(label='Von',
input_formats=date_formats,
initial=datetime.date.today)
end = forms.DateField(label='Bis',
input_formats=date_formats,
initial=datetime.date.today)
@@ -0,0 +1,24 @@
# Generated by Django 2.1.3 on 2018-11-12 14:59
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Notice',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('notice_title', models.CharField(max_length=80)),
('notice_text', models.CharField(max_length=400)),
('pub_start', models.DateTimeField()),
('pub_end', models.DateTimeField()),
],
),
]
Whitespace-only changes.
+11
View File
@@ -0,0 +1,11 @@
from django.db import models
class Notice(models.Model):
#def __init__(self):
#self.id = super().id
notice_title = models.CharField(max_length = 80)
notice_text = models.CharField(max_length = 400)
pub_start = models.DateTimeField()
pub_end = models.DateTimeField()
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

+7
View File
@@ -0,0 +1,7 @@
from rest_framework import serializers
from .models import Notice
class NoticeSerializer(serializers.ModelSerializer):
class Meta:
model = Notice
fields = ('id', 'notice_title', 'notice_text', 'pub_start', 'pub_end')
+3
View File
@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.
+13
View File
@@ -0,0 +1,13 @@
from django.conf.urls import include, url
from . import views
from django.urls import path, include, re_path
urlpatterns = [
url(r'^$', views.index, name="index"),
path("new", views.new, name="new"),
path("delete/<int:deleteid>", views.delete, name="delete"),
path('notices/', views.notice_list),
path('notices/<int:id>', views.notice_detail),
]
+109
View File
@@ -0,0 +1,109 @@
from posts.models import Notice
from django.utils import timezone
from django.shortcuts import render
from django.http import HttpResponse
def index(request):
#return render(request, 'posts/index.html')
#-------------------- eigener Versuch ---------------------
# relevant_notices = Notice.objects.filter(pub_start__lt = timezone.datetime.now())
# relevant_notices = Notice.objects.filter(pub_end__gt = timezone.datetime.now())
# for curr_msg in relevant_notices:
# context['now'] += "TITEL DER NACHRICHT: " + curr_msg.notice_title + "TEXT DER NACHRICHT: " + curr_msg.notice_text
# # unschöne Lösung, da hier ein Fließtext ohne Layout-Möglichkeiten (z.B. backspace zwischen jeder neuen Zeile) entsteht
# # bessere Variante: for-Schleife in das Template (allMessages.html) auslagern
#------------------ ab hier: schöne Variante --------------------
relevant_notices = Notice.objects.all()
relevant_notices = Notice.objects.filter(pub_start__lt=timezone.datetime.now())
relevant_notices = Notice.objects.filter(pub_end__gt=timezone.datetime.now())
# all diese Befehle importieren noch NHCTS aus der Datenbank! Sie bauen nur einen SQL-Zugriffs-Befehl auf (mit entsprevchender Filterung) und erst beim Auslesen wird auf Datenbank zugegriffen
context = { "notices" : relevant_notices }
return render(request, 'posts/allMessages.html', context)
from posts.forms import NoticeForm
from django.shortcuts import redirect
def new(request):
#return HttpResponse("Eingabe einer neuen Nachricht!")
if request.method == "POST":
eingabeFenster = NoticeForm(request.POST)
if eingabeFenster.is_valid():
newNotice = Notice(notice_title = eingabeFenster.cleaned_data['title'],
notice_text = eingabeFenster.cleaned_data['text'],
pub_start = eingabeFenster.cleaned_data['start'],
pub_end = eingabeFenster.cleaned_data['end'])
newNotice.save()
return redirect('index')
context = {'form' : NoticeForm() }
return render(request, 'posts/edit.html', context)
def delete(request, id):
msg_to_delete = Notice.objects.get(id = id)
msg_to_delete.clean()
return redirect('index')
from posts.models import Notice
from posts.serializers import NoticeSerializer
from django.http import JsonResponse
from rest_framework.parsers import JSONParser
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def notice_list(request):
if request.method == 'GET':
notices = Notice.objects.all()
serializer = NoticeSerializer(notices, many=True)
return JsonResponse(serializer.data, safe=False)
elif request.method == 'POST':
data = JSONParser().parse(request)
serializer = NoticeSerializer(data = data)
if serializer.is_valid():
serializer.save()
return JsonResponse(serializer.data, status=201)
else:
return JsonResponse(serializer.errors, status=400)
else:
return HttpResponse(status=405)
@csrf_exempt
def notice_detail(request, id):
try:
notice = Notice.objects.get(id=id)
except:
return HttpResponse(status=404)
if request.method == 'GET':
serializer = NoticeSerializer(notice)
return JsonResponse(serializer.data)
elif request.method== 'PUT':
data = JSONParser().parse(request)
serializer = NoticeSerializer(notice, data=data)
if serializer.is_valid():
serializer.save()
return JsonResponse(serializer.data)
else:
return JsonResponse(serializer.errors, status=400)
elif request.method == 'DELETE':
notice.delete()
return HttpResponse(status=204)
else:
return HttpResponse(status=405)
Binary file not shown.
+34
View File
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{% block title %} Pla {% endblock %}</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</head>
<body>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<nav class="navbar navbar-expand-md navbar-fixed-top navbar-dark bg-primary">
<a class="navbar-brand">Navigationsleiste</a>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="https://www.google.com">Hier geht's zu Google</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://www.th-nuernberg.de/fakultaeten/efi">Hier geht's zur Efi-Homepage</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Random link to click</a> <!-- href="#" means that link is clickable -->
</li>
</ul>
</nav>
{% block content %} zzz {% endblock %}
</body>
</html>
@@ -0,0 +1,25 @@
{% extends 'base.html' %}
{% block title %}
News
{% endblock %}
{% block content %}
<div class="container">
{% for curr_notice in notices %}
<h3>{{ curr_notice.notice_title }}</h3>
<p>{{ curr_notice.notice_text }}</p>
<p><a href ="{% url 'delete' id=curr_notice.id %}" class="btn btn-info" role="button"> Löschen </a> </p>
{% endfor %}
<!--p><a href ="#" class="btn btn-info" role="button"> Neue Nachricht </a> </p-->
<!-- alter Button -> kein Verweis auf die neue view-Funktion namens "new()" -->
<p><a href ="{% url 'new' %}" class="btn btn-info" role="button"> Neue Nachricht </a> </p
</div>
{% endblock %}
+18
View File
@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% block title %}
Eingabefenster für neuen instance von "Notice"
{% endblock %}
{% block content %}
<h1>Neue Nachricht</h1>
<form method="POST">
{% csrf_token %}
{{ form.as_p }}
<button type="submit" class="save btn btn-default">Speichern</button>
</form>
{% endblock %}
+16
View File
@@ -0,0 +1,16 @@
{% extends 'base.html' %}
{% block title %}
My_Index
{% endblock %}
{% block content %}
<div class="jumbotron">
<h1 class="display-4">Text als Jumbotron :-)</h1>
<p class="lead">Hier kommt noch zusätzlicher text, der den/das Jombotron näher erklärt</p>
</div>
<img src="https://www.th-nuernberg.de/fileadmin/global/Bilderpool_KOM/Standorte/Standortbild/171958_8_3_W.jpg">
{% endblock %}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+34
View File
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Aufgabe_4_Tabelle_Fernsehsender</title>
<link rel="stylesheet" href="Format_zu_AB5.css">
<script src="Popups_zu_AB6.js"></script>
</head>
<body>
<table>
<tr>
<th id="P1" class="Ueberschrift" >ARD</th>
<th id="P2" class="Ueberschrift">ZDF</th>
<th id="P3" class="Ueberschrift">RTL</th>
</tr>
<tr>
<td colspan="2">Öffentlich-Rechtlich</td>
<td id="priv">Privat</td>
</tr>
<tr>
<td>Tagesschau</td>
<td>Heute</td>
<td>RTL aktuell</td>
</tr>
<tr>
<td>Babylon Berlin</td>
<td>Neo Magazin</td>
<td>IBES</td>
</tr>
</table>
</body>
</html>
+18
View File
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SprungImHTML</title>
</head>
<body>
<p id="my_top">
Hier geht es los.<a href="#my_bottom"> Zum Ende scrollen </a>
</p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc,Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. MaeceLine truncated
<p id="my_bottom">
Hier ist es zu Ende. <a href=""#my_top"> Gehe zum Anfang </a>
</p>
</body>
</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
+35
View File
@@ -0,0 +1,35 @@
*{
color: blue;
align-content: center;
}
.Ueberschrift {
font-style: italic;
}
#priv {
font-weight: bold;
}
table {
border: 1px solid;
border-color: black;
}
th {
border: 1px solid;
border-color: black;
background: gray;
}
tr {
border: 1px solid;
border-color: black;
}
td {
border: 1px solid;
border-color: black;
background: gray;
text-align: center;
}
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HelloWorldHTML</title>
<link rel="stylesheet" href="formatiert.css">
</head>
<body>
Hallo Welt!
</body>
</html>
+554
View File
@@ -0,0 +1,554 @@
<!DOCTYPE html>
<html dir="ltr" lang="de" xml:lang="de">
<head>
<title>MEIM: jump.html</title>
<link rel="shortcut icon" href="https://elearning.ohmportal.de/theme/image.php/efi/theme/1537347941/favicon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="moodle, MEIM: jump.html" />
<link rel="stylesheet" type="text/css" href="https://elearning.ohmportal.de/theme/yui_combo.php?rollup/3.17.2/yui-moodlesimple-min.css" /><script id="firstthemesheet" type="text/css">/** Required in order to fix style inclusion problems in IE with YUI **/</script><link rel="stylesheet" type="text/css" href="https://elearning.ohmportal.de/theme/styles.php/efi/1537347941_1/all" />
<script type="text/javascript">
//<![CDATA[
var M = {}; M.yui = {};
M.pageloadstarttime = new Date();
M.cfg = {"wwwroot":"https:\/\/elearning.ohmportal.de","sesskey":"NqQN6f33ZV","themerev":"1537347941","slasharguments":1,"theme":"efi","iconsystemmodule":"core\/icon_system_standard","jsrev":"1537347941","admin":"admin","svgicons":true,"usertimezone":"Europa\/Berlin","contextid":322193};var yui1ConfigFn = function(me) {if(/-skin|reset|fonts|grids|base/.test(me.name)){me.type='css';me.path=me.path.replace(/\.js/,'.css');me.path=me.path.replace(/\/yui2-skin/,'/assets/skins/sam/yui2-skin')}};
var yui2ConfigFn = function(me) {var parts=me.name.replace(/^moodle-/,'').split('-'),component=parts.shift(),module=parts[0],min='-min';if(/-(skin|core)$/.test(me.name)){parts.pop();me.type='css';min=''}
if(module){var filename=parts.join('-');me.path=component+'/'+module+'/'+filename+min+'.'+me.type}else{me.path=component+'/'+component+'.'+me.type}};
YUI_config = {"debug":false,"base":"https:\/\/elearning.ohmportal.de\/lib\/yuilib\/3.17.2\/","comboBase":"https:\/\/elearning.ohmportal.de\/theme\/yui_combo.php?","combine":true,"filter":null,"insertBefore":"firstthemesheet","groups":{"yui2":{"base":"https:\/\/elearning.ohmportal.de\/lib\/yuilib\/2in3\/2.9.0\/build\/","comboBase":"https:\/\/elearning.ohmportal.de\/theme\/yui_combo.php?","combine":true,"ext":false,"root":"2in3\/2.9.0\/build\/","patterns":{"yui2-":{"group":"yui2","configFn":yui1ConfigFn}}},"moodle":{"name":"moodle","base":"https:\/\/elearning.ohmportal.de\/theme\/yui_combo.php?m\/1537347941\/","combine":true,"comboBase":"https:\/\/elearning.ohmportal.de\/theme\/yui_combo.php?","ext":false,"root":"m\/1537347941\/","patterns":{"moodle-":{"group":"moodle","configFn":yui2ConfigFn}},"filter":null,"modules":{"moodle-core-tooltip":{"requires":["base","node","io-base","moodle-core-notification-dialogue","json-parse","widget-position","widget-position-align","event-outside","cache-base"]},"moodle-core-dragdrop":{"requires":["base","node","io","dom","dd","event-key","event-focus","moodle-core-notification"]},"moodle-core-languninstallconfirm":{"requires":["base","node","moodle-core-notification-confirm","moodle-core-notification-alert"]},"moodle-core-event":{"requires":["event-custom"]},"moodle-core-handlebars":{"condition":{"trigger":"handlebars","when":"after"}},"moodle-core-dock":{"requires":["base","node","event-custom","event-mouseenter","event-resize","escape","moodle-core-dock-loader","moodle-core-event"]},"moodle-core-dock-loader":{"requires":["escape"]},"moodle-core-lockscroll":{"requires":["plugin","base-build"]},"moodle-core-checknet":{"requires":["base-base","moodle-core-notification-alert","io-base"]},"moodle-core-chooserdialogue":{"requires":["base","panel","moodle-core-notification"]},"moodle-core-actionmenu":{"requires":["base","event","node-event-simulate"]},"moodle-core-blocks":{"requires":["base","node","io","dom","dd","dd-scroll","moodle-core-dragdrop","moodle-core-notification"]},"moodle-core-popuphelp":{"requires":["moodle-core-tooltip"]},"moodle-core-notification":{"requires":["moodle-core-notification-dialogue","moodle-core-notification-alert","moodle-core-notification-confirm","moodle-core-notification-exception","moodle-core-notification-ajaxexception"]},"moodle-core-notification-dialogue":{"requires":["base","node","panel","escape","event-key","dd-plugin","moodle-core-widget-focusafterclose","moodle-core-lockscroll"]},"moodle-core-notification-alert":{"requires":["moodle-core-notification-dialogue"]},"moodle-core-notification-confirm":{"requires":["moodle-core-notification-dialogue"]},"moodle-core-notification-exception":{"requires":["moodle-core-notification-dialogue"]},"moodle-core-notification-ajaxexception":{"requires":["moodle-core-notification-dialogue"]},"moodle-core-maintenancemodetimer":{"requires":["base","node"]},"moodle-core-formchangechecker":{"requires":["base","event-focus","moodle-core-event"]},"moodle-core_availability-form":{"requires":["base","node","event","event-delegate","panel","moodle-core-notification-dialogue","json"]},"moodle-backup-confirmcancel":{"requires":["node","node-event-simulate","moodle-core-notification-confirm"]},"moodle-backup-backupselectall":{"requires":["node","event","node-event-simulate","anim"]},"moodle-course-categoryexpander":{"requires":["node","event-key"]},"moodle-course-formatchooser":{"requires":["base","node","node-event-simulate"]},"moodle-course-dragdrop":{"requires":["base","node","io","dom","dd","dd-scroll","moodle-core-dragdrop","moodle-core-notification","moodle-course-coursebase","moodle-course-util"]},"moodle-course-util":{"requires":["node"],"use":["moodle-course-util-base"],"submodules":{"moodle-course-util-base":{},"moodle-course-util-section":{"requires":["node","moodle-course-util-base"]},"moodle-course-util-cm":{"requires":["node","moodle-course-util-base"]}}},"moodle-course-management":{"requires":["base","node","io-base","moodle-core-notification-exception","json-parse","dd-constrain","dd-proxy","dd-drop","dd-delegate","node-event-delegate"]},"moodle-course-modchooser":{"requires":["moodle-core-chooserdialogue","moodle-course-coursebase"]},"moodle-form-dateselector":{"requires":["base","node","overlay","calendar"]},"moodle-form-passwordunmask":{"requires":[]},"moodle-form-shortforms":{"requires":["node","base","selector-css3","moodle-core-event"]},"moodle-form-showadvanced":{"requires":["node","base","selector-css3"]},"moodle-question-searchform":{"requires":["base","node"]},"moodle-question-chooser":{"requires":["moodle-core-chooserdialogue"]},"moodle-question-preview":{"requires":["base","dom","event-delegate","event-key","core_question_engine"]},"moodle-question-qbankmanager":{"requires":["node","selector-css3"]},"moodle-availability_completion-form":{"requires":["base","node","event","moodle-core_availability-form"]},"moodle-availability_date-form":{"requires":["base","node","event","io","moodle-core_aLine truncated
M.yui.loader = {modules: {}};
//]]>
</script>
<meta name="viewport"
content="width=device-width, initial-scale=1.0">
</head>
<body id="page-mod-resource-view" class="format-topics path-mod path-mod-resource safari dir-ltr lang-de yui-skin-sam yui3-skin-sam elearning-ohmportal-de pagelayout-incourse course-2028 context-322193 cmid-161628 category-383 category-8 category-1 has-region-side-pre used-region-side-pre has-region-side-post empty-region-side-post side-pre-only">
<div class="skiplinks">
<a href="#maincontent" class="skip">Zum Hauptinhalt</a>
</div><script type="text/javascript" src="https://elearning.ohmportal.de/theme/yui_combo.php?rollup/3.17.2/yui-moodlesimple-min.js"></script><script type="text/javascript" src="https://elearning.ohmportal.de/lib/javascript.php/1537347941/lib/javascript-static.js"></script>
<script type="text/javascript">
//<![CDATA[
document.body.className += ' jsenabled';
//]]>
</script>
<div class="wrapper-ohm">
<div class="header-ohm hidden-print">
<div class="headertext-ohm"><h4>Ohm E-Learning Portal </h4>
<div class="usermenu"><div class="moodle-actionmenu nowrap-items" id="action-menu-0" data-enhance="moodle-core-actionmenu">
<ul class="menubar" id="action-menu-0-menubar" role="menubar">
<!--
--><!--
--><li role="presentation"><a href="#" class=" toggle-display textmenu" id="action-menu-toggle-0" title="" role="menuitem"><span class="userbutton"><span class="usertext mr-1">Jonka Winkle</span><span class="avatars"><span class="avatar current"><img src="https://elearning.ohmportal.de/theme/image.php/efi/core/1537347941/u/f2" alt="Nutzerbild Jonka Winkle" title="Nutzerbild Jonka Winkle" class="userpicture defaultuserpic" width="35" height="35" role="presentation" /></span></span></span><b class="caret"></b></a>
</li>
</ul>
<ul class="menu align-tr-br" id="action-menu-0-menu" data-rel="menu-content" aria-labelledby="action-menu-toggle-0" role="menu" data-align="tr-br">
<li role="presentation"> <a href="https://elearning.ohmportal.de/my/" class="icon menu-action" role="menuitem" data-title="mymoodle,admin" aria-labelledby="actionmenuaction-1"><img class="icon " alt="Dashboard" title="Dashboard" src="https://elearning.ohmportal.de/theme/image.php/efi/core/1537347941/i/dashboard" /><span class="menu-action-text" id="actionmenuaction-1">Dashboard</span></a>
</li><li role="presentation">
<span class="filler">&nbsp;</span>
</li><li role="presentation"> <a href="https://elearning.ohmportal.de/user/profile.php?id=44982" class="icon menu-action" role="menuitem" data-title="profile,moodle" aria-labelledby="actionmenuaction-2"><img class="icon " alt="Profil" title="Profil" src="https://elearning.ohmportal.de/theme/image.php/efi/core/1537347941/i/user" /><span class="menu-action-text" id="actionmenuaction-2">Profil</span></a>
</li><li role="presentation"> <a href="https://elearning.ohmportal.de/grade/report/overview/index.php" class="icon menu-action" role="menuitem" data-title="grades,grades" aria-labelledby="actionmenuaction-3"><img class="icon " alt="Bewertungen" title="Bewertungen" src="https://elearning.ohmportal.de/theme/image.php/efi/core/1537347941/t/grades" /><span class="menu-action-text" id="actionmenuaction-3">Bewertungen</span></a>
</li><li role="presentation"> <a href="https://elearning.ohmportal.de/message/index.php" class="icon menu-action" role="menuitem" data-title="messages,message" aria-labelledby="actionmenuaction-4"><img class="icon " alt="Mitteilungen" title="Mitteilungen" src="https://elearning.ohmportal.de/theme/image.php/efi/core/1537347941/t/message" /><span class="menu-action-text" id="actionmenuaction-4">Mitteilungen</span></a>
</li><li role="presentation"> <a href="https://elearning.ohmportal.de/user/preferences.php" class="icon menu-action" role="menuitem" data-title="preferences,moodle" aria-labelledby="actionmenuaction-5"><img class="icon " alt="Einstellungen" title="Einstellungen" src="https://elearning.ohmportal.de/theme/image.php/efi/core/1537347941/t/preferences" /><span class="menu-action-text" id="actionmenuaction-5">Einstellungen</span></a>
</li><li role="presentation">
<span class="filler">&nbsp;</span>
</li><li role="presentation"> <a href="https://elearning.ohmportal.de/login/logout.php?sesskey=NqQN6f33ZV" class="icon menu-action" role="menuitem" data-title="logout,moodle" aria-labelledby="actionmenuaction-6"><img class="icon " alt="Logout" title="Logout" src="https://elearning.ohmportal.de/theme/image.php/efi/core/1537347941/a/logout" /><span class="menu-action-text" id="actionmenuaction-6">Logout</span></a>
</li>
</ul>
</div></div>
</div>
</div>
<nav class="navbar navbar-default navbar-ohm hidden-print"
role="navigation">
<div class="navbar-header">
<button class="navbar-toggle" data-target="#virtuohm-navbar" data-toggle="collapse" type="button">
<span class="glyphicon glyphicon-align-justify"></span>
</button>
<p class="navbar-text col-xs-9 col-sm-5">Fakultät Elektrotechnik Feinwerktechnik Informationstechnik </div>
<div id="virtuohm-navbar" class="navbar-collapse collapse">
</div>
</nav>
<div id="page" class="container-fluid content-ohm">
<header id="page-header" class="clearfix">
<div id="page-navbar" class="clearfix">
<nav class="breadcrumb-ohm breadcrumb-nav"><span class="accesshide" id="navbar-label">Seitenpfad</span><nav aria-labelledby="navbar-label"><ul class="breadcrumb"><li><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" href="https://elearning.ohmportal.de/"><span itemprop="title">Startseite</span></a></span> <span class="divider"> <span class="accesshide " ><span class="arrow_text">/</span>&nbsp;</span><span class="arrow sep">&#x25BA;</span> </span></li><li><span tabindex="0">Meine Kurse</span> <span class="divider"> <span class="accesshide " ><span class="arrow_text">/</span>&nbsp;</span><span class="arrow sep">&#x25BA;</span> </span></li><li><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" href="https://elearning.ohmportal.de/course/index.php?categoryid=1"><span itemprop="title">Fakultäten</span></a></span> <span class="divider"> <span class="accesshide " ><span class="arrow_text">/</span>&nbsp;</span><span class="arrow sep">&#x25BA;</span> </span></li><li><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" href="https://elearning.ohmportal.de/course/index.php?categoryid=8"><span itemprop="title">Fakultät Elektrotechnik Feinwerktechnik Informatio...</span></a></span> <span class="divider"> <span class="accesshide " ><span class="arrow_text">/</span>&nbsp;</span><span class="arrow sep">&#x25BA;</span> </span></li><li><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" href="https://elearning.ohmportal.de/course/index.php?categoryid=383"><span itemprop="title">Hofmann, Oliver</span></a></span> <span class="divider"> <span class="accesshide " ><span class="arrow_text">/</span>&nbsp;</span><span class="arrow sep">&#x25BA;</span> </span></li><li><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a itemprop="url" title="Informationssysteme für die Medizintechnik" href="https://elearning.ohmportal.de/course/view.php?id=2028"><span itemprop="title">MEIM</span></a></span> <span class="divider"> <span class="accesshide " ><span class="arrow_text">/</span>&nbsp;</span><span class="arrow sep">&#x25BA;</span> </span></li><li><span tabindex="0">Web- und Skriptsprachen</span> <span class="divider"> <span class="accesshide " ><span class="arrow_text">/</span>&nbsp;</span><span class="arrow sep">&#x25BA;</span> </span></li><li><a href="https://elearning.ohmportal.de/mod/resource/view.php?id=161628" id="label_8_70" class="" tabindex="-1" title="Datei" >jump.html</a></li></ul></nav></nav>
<div class="breadcrumb-button"></div>
</div>
<div id="course-header">
</div>
</header>
<div id="page-content" class="row-fluid">
<div id="region-main-box" class="span9">
<div class="row-fluid">
<section id="region-main" class="span8 pull-right">
<span class="notifications" id="user-notifications"></span><div role="main"><span id="maincontent"></span><h2>jump.html</h2><div class="resourceworkaround">Klicken Sie auf den Link '<a href="https://elearning.ohmportal.de/pluginfile.php/322193/mod_resource/content/1/jump.html" onclick="window.open('https://elearning.ohmportal.de/pluginfile.php/322193/mod_resource/content/1/jump.html', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false;">jump.html</a>', um die Datei anzuzeigen</div></div> </section>
<aside id="block-region-side-pre" class="span4 desktop-first-column block-region" data-blockregion="side-pre" data-droptarget="1"><a class="skip skip-block" id="fsb-1" href="#sb-1">Navigation überspringen</a><div id="inst4" class="block_navigation block" role="navigation" data-block="navigation" data-instanceid="4" aria-labelledby="instance-4-header"><div class="header"><div class="title"><div class="block_action"></div><h2 id="instance-4-header">Navigation</h2></div></div><div class="content"><ul class="block_tree list" role="tree" data-ajax-loader="block_navigation/nav_loader"><li class="type_unknown depth_1 contains_branch" aria-labelledby="label_1_1"><p class="tree_item branch navigation_node" role="treeitem" aria-expanded="true" aria-owns="random5bc1ad639f9951_group" data-collapsible="false"><a tabindex="-1" id="label_1_1" href="https://elearning.ohmportal.de/">Startseite</a></p><ul id="random5bc1ad639f9951_group" role="group"><li class="type_setting depth_2 item_with_icon" aria-labelledby="label_2_2"><p class="tree_item hasicon" role="treeitem"><a tabindex="-1" id="label_2_2" href="https://elearning.ohmportal.de/my/"><img class="icon navicon" alt="" src="https://elearning.ohmportal.de/theme/image.php/efi/core/1537347941/i/dashboard" /><span class="item-content-wrap">Dashboard</span></a></p></li><li class="type_course depth_2 contains_branch" aria-labelledby="label_2_3"><p class="tree_item branch" role="treeitem" aria-expanded="false" aria-owns="random5bc1ad639f9953_group"><span tabindex="-1" id="label_2_3" title="Ohm E-Learning Portal">Website</span></p><ul id="random5bc1ad639f9953_group" role="group" aria-hidden="true"><li class="type_unknown depth_3 item_with_icon" aria-labelledby="label_3_5"><p class="tree_item hasicon" role="treeitem"><a tabindex="-1" id="label_3_5" href="https://elearning.ohmportal.de/blog/index.php"><img class="icon navicon" alt="" src="https://elearning.ohmportal.de/theme/image.php/efi/core/1537347941/i/navigationitem" /><span class="item-content-wrap">Blogs der Website</span></a></p></li><li class="type_custom depth_3 item_with_icon" aria-labelledby="label_3_6"><p class="tree_item hasicon" role="treeitem"><a tabindex="-1" id="label_3_6" href="https://elearning.ohmportal.de/badges/view.php?type=1"><img class="icon navicon" alt="" src="https://elearning.ohmportal.de/theme/image.php/efi/core/1537347941/i/navigationitem" /><span class="item-content-wrap">Globale Auszeichnungen</span></a></p></li><li class="type_setting depth_3 item_with_icon" aria-labelledby="label_3_7"><p class="tree_item hasicon" role="treeitem"><a tabindex="-1" id="label_3_7" href="https://elearning.ohmportal.de/tag/search.php"><img class="icon navicon" alt="" src="https://elearning.ohmportal.de/theme/image.php/efi/core/1537347941/i/navigationitem" /><span class="item-content-wrap">Schlagwörter</span></a></p></li><li class="type_custom depth_3 item_with_icon" aria-labelledby="label_3_8"><p class="tree_item hasicon" role="treeitem"><a tabindex="-1" id="label_3_8" href="https://elearning.ohmportal.de/calendar/view.php?view=month&amp;course=2028"><img class="icon navicon" alt="" src="https://elearning.ohmportal.de/theme/image.php/efi/core/1537347941/i/calendar" /><span class="item-content-wrap">Kalender</span></a></p></li><li class="type_activity depth_3 item_with_icon" aria-labelledby="label_3_10"><p class="tree_item hasicon" role="treeitem"><a tabindex="-1" id="label_3_10" title="Forum" href="https://elearning.ohmportal.de/mod/forum/view.php?id=1803"><img class="icon navicon" alt="Forum" title="Forum" src="https://elearning.ohmportal.de/theme/image.php/efi/forum/1537347941/icon" /><span class="item-content-wrap">Moodle FAQ-FORUM</span></a></p></li><li class="type_activity depth_3 item_with_icon" aria-labelledby="label_3_11"><p class="tree_item hasicon" role="treeitem"><a tabindex="-1" id="label_3_11" title="Link/URL" href="https://elearning.ohmportal.de/mod/url/view.php?id=5507"><img class="icon navicon" alt="Link/URL" title="Link/URL" src="https://elearning.ohmportal.de/theme/image.php/efi/url/1537347941/icon" /><span class="item-content-wrap">Blended Learning COMMUNITY</span></a></p></li><li class="type_activity depth_3 item_with_icon" aria-labelledby="label_3_12"><p class="tree_item hasicon" role="treeitem"><a tabindex="-1" id="label_3_12" title="Link/URL" href="https://elearning.ohmportal.de/mod/url/view.php?id=5344"><img class="icon navicon" alt="Link/URL" title="Link/URL" src="https://elearning.ohmportal.de/theme/image.php/efi/url/1537347941/icon" /><span class="item-content-wrap">Blended Learning am OHM</span></a></p></li><li class="type_activity depth_3 item_with_icon" aria-labelledby="label_3_13"><p class="tree_item hasicon" role="treeitem"><a tabindex="-1" id="label_3_13" title="Textseite" href="https://elearning.ohmportal.de/mod/page/view.php?id=5983"><img class="icon navicon" alt="Textseite" title="Textseite" src="https://elearning.ohmportal.de/theme/image.php/efi/page/1537347941/Line truncated
<tbody>
<tr>
<td>
<h2><a href="mailto:blendedlearning@th-nuernberg.de" target="_blank"><img src="https://elearning.ohmportal.de/pluginfile.php/45358/block_html/content/support.png" alt="Blended Learning Support" height="65" width="65"></a></h2>
</td>
<td>
<p><span style="font-size: large;" data-mce-mark="1"><a href="mailto:blendedlearning@th-nuernberg.de" target="_blank">Support&nbsp;zu Moodle<br>&amp; Blended Learning</a></span></p>
</td>
</tr>
<tr>
<td>
<h2><a href="http://blendedlearning.th-nuernberg.de/commons" title="Blended Learning Community" target="_blank"><img src="https://elearning.ohmportal.de/pluginfile.php/45358/block_html/content/ronoaldo-New-Document-300px.png" alt="Blended Learning Community" height="65" width="65"></a></h2>
</td>
<td>
<p><span style="font-size: large;"><span><a href="https://blendedlearning.th-nuernberg.de/wiki/blendedlearning/doku.php?id=moodle" target="_blank">Wiki zu<br>Moodle</a></span></span></p>
</td>
</tr>
<tr>
<td>
<h2><a href="http://blendedlearning.th-nuernberg.de/commons" title="Blended Learning Community" target="_blank"><img src="https://elearning.ohmportal.de/pluginfile.php/45358/block_html/content/worldwide_community.png" alt="Blended Learning Community" height="65" width="65"></a></h2>
</td>
<td>
<p><a href="http://blendedlearning.th-nuernberg.de/blog" target="_blank"><span style="font-size: large;" data-mce-mark="1">Blended<br></span><span style="font-size: large; background-color: transparent;">Learning<br>Blog</span></a><br></p>
</td>
</tr>
</tbody>
</table>
<p></p>
<p style="text-align: justify;"><span class="multilang" data-mce-mark="1" lang="de"><strong>Weiteres Material zu Moodle:</strong></span></p>
<p style="text-align: justify;"><a target="_blank" href="https://elearning.ohmportal.de/mod/glossary/view.php?id=26931" style="line-height: 1.231;">-</a> <span style="line-height: 1.231;"><a href="https://docs.moodle.org/35/de/Hauptseite" target="_blank"><span class="multilang" data-mce-mark="1" lang="de">Moodle Dokumentation</span></a><span class="multilang" data-mce-mark="1" lang="en"></span><br></span><a target="_blank" href="https://www.youtube.com/user/moodlehq">- Moodle YouTube Channel&nbsp;&nbsp; </a><br>- <a target="_blank" href="https://www.video2brain.com/de/search.htm?search_entry=Moodle">Moodle in video2brain</a><br></p>
<p><a target="_blank" href="http://www.th-nuernberg.de/bl"><span class="multilang" data-mce-mark="1" lang="en">Blended Learning auf der TH-Website</span></a></p><p><span class="multilang" data-mce-mark="1" lang="en">Wir verwenden die Moodle Version 3.5<br></span></p>
<p></p></div></div></div><span class="skip-block-to" id="sb-3"></span></aside> </div>
</div>
<aside id="block-region-side-post" class="span3 block-region" data-blockregion="side-post" data-droptarget="1"></aside> </div>
</div>
<div class="footer-ohm hidden-print" role="contentinfo">
<div class="container-fluid ">
<ul class="nav nav-justified">
<li><a target="_blank"
href="https://www.th-nuernberg.de/blendedlearning">Blended
Learning</a></li>
<li><a target="_blank"
href="https://www.th-nuernberg.de/rechenzentrum">Rechenzentrum</a>
</li>
</ul>
</div>
<div class="container-fluid ">
Rechenzentrum, Technische Hochschule Nürnberg <br> Bei technischen Problemen und Fragen erreichen Sie uns unter <a href="mailto:rz-service@th-nuernberg.de">RZ-Service</a>.<br>
Bitte beachten Sie die <a target="_blank" href="https://www.th-nuernberg.de/datenschutz">Datenschutzerklärung</a> der Technischen Hochschule Nürnberg.
<br><small>Moodle Version 3.5</small>
</div>
</div>
<script type="text/javascript">
//<![CDATA[
var require = {
baseUrl : 'https://elearning.ohmportal.de/lib/requirejs.php/1537347941/',
// We only support AMD modules with an explicit define() statement.
enforceDefine: true,
skipDataMain: true,
waitSeconds : 0,
paths: {
jquery: 'https://elearning.ohmportal.de/lib/javascript.php/1537347941/lib/jquery/jquery-3.2.1.min',
jqueryui: 'https://elearning.ohmportal.de/lib/javascript.php/1537347941/lib/jquery/ui-1.12.1/jquery-ui.min',
jqueryprivate: 'https://elearning.ohmportal.de/lib/javascript.php/1537347941/lib/requirejs/jquery-private'
},
// Custom jquery config map.
map: {
// '*' means all modules will get 'jqueryprivate'
// for their 'jquery' dependency.
'*': { jquery: 'jqueryprivate' },
// Stub module for 'process'. This is a workaround for a bug in MathJax (see MDL-60458).
'*': { process: 'core/first' },
// 'jquery-private' wants the real jQuery module
// though. If this line was not here, there would
// be an unresolvable cyclic dependency.
jqueryprivate: { jquery: 'jquery' }
}
};
//]]>
</script>
<script type="text/javascript" src="https://elearning.ohmportal.de/lib/javascript.php/1537347941/lib/requirejs/require.min.js"></script>
<script type="text/javascript">
//<![CDATA[
require(['core/first'], function() {
;
require(["media_videojs/loader"], function(loader) {
loader.setUp(function(videojs) {
videojs.options.flash.swf = "https://elearning.ohmportal.de/media/player/videojs/videojs/video-js.swf";
videojs.addLanguage("de",{
"Play": "Wiedergabe",
"Pause": "Pause",
"Replay": "Erneut abspielen",
"Current Time": "Aktueller Zeitpunkt",
"Duration Time": "Dauer",
"Remaining Time": "Verbleibende Zeit",
"Stream Type": "Streamtyp",
"LIVE": "LIVE",
"Loaded": "Geladen",
"Progress": "Status",
"Fullscreen": "Vollbild",
"Non-Fullscreen": "Kein Vollbild",
"Mute": "Ton aus",
"Unmute": "Ton ein",
"Playback Rate": "Wiedergabegeschwindigkeit",
"Subtitles": "Untertitel",
"subtitles off": "Untertitel aus",
"Captions": "Untertitel",
"captions off": "Untertitel aus",
"Chapters": "Kapitel",
"You aborted the media playback": "Sie haben die Videowiedergabe abgebrochen.",
"A network error caused the media download to fail part-way.": "Der Videodownload ist aufgrund eines Netzwerkfehlers fehlgeschlagen.",
"The media could not be loaded, either because the server or network failed or because the format is not supported.": "Das Video konnte nicht geladen werden, da entweder ein Server- oder Netzwerkfehler auftrat oder das Format nicht unterstützt wird.",
"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Die Videowiedergabe wurde entweder wegen eines Problems mit einem beschädigten Video oder wegen verwendeten Funktionen, die vom Browser nicht unterstützt werden, abgebrochen.",
"No compatible source was found for this media.": "Für dieses Video wurde keine kompatible Quelle gefunden.",
"Play Video": "Video abspielen",
"Close": "Schließen",
"Modal Window": "Modales Fenster",
"This is a modal window": "Dies ist ein modales Fenster",
"This modal can be closed by pressing the Escape key or activating the close button.": "Durch Drücken der Esc-Taste bzw. Betätigung der Schaltfläche \"Schließen\" wird dieses modale Fenster geschlossen.",
", opens captions settings dialog": ", öffnet Einstellungen für Untertitel",
", opens subtitles settings dialog": ", öffnet Einstellungen für Untertitel",
", selected": ", ausgewählt",
"captions settings": "Untertiteleinstellungen",
"subtitles settings": "Untertiteleinstellungen",
"descriptions settings": "Einstellungen für Beschreibungen",
"Close Modal Dialog": "Modales Fenster schließen",
"Descriptions": "Beschreibungen",
"descriptions off": "Beschreibungen aus",
"The media is encrypted and we do not have the keys to decrypt it.": "Die Entschlüsselungsschlüssel für den verschlüsselten Medieninhalt sind nicht verfügbar.",
", opens descriptions settings dialog": ", öffnet Einstellungen für Beschreibungen",
"Audio Track": "Tonspur",
"Text": "Schrift",
"White": "Weiß",
"Black": "Schwarz",
"Red": "Rot",
"Green": "Grün",
"Blue": "Blau",
"Yellow": "Gelb",
"Magenta": "Magenta",
"Cyan": "Türkis",
"Background": "Hintergrund",
"Window": "Fenster",
"Transparent": "Durchsichtig",
"Semi-Transparent": "Halbdurchsichtig",
"Opaque": "Undurchsictig",
"Font Size": "Schriftgröße",
"Text Edge Style": "Textkantenstil",
"None": "Kein",
"Raised": "Erhoben",
"Depressed": "Gedrückt",
"Uniform": "Uniform",
"Dropshadow": "Schlagschatten",
"Font Family": "Schristfamilie",
"Proportional Sans-Serif": "Proportionale Sans-Serif",
"Monospace Sans-Serif": "Monospace Sans-Serif",
"Proportional Serif": "Proportionale Serif",
"Monospace Serif": "Monospace Serif",
"Casual": "Zwanglos",
"Script": "Schreibeschrift",
"Small Caps": "Small-Caps",
"Reset": "Zurücksetzen",
"restore all settings to the default values": "Alle Einstellungen auf die Standardwerte zurücksetzen",
"Done": "Fertig",
"Caption Settings Dialog": "Einstellungsdialog für Untertitel",
"Beginning of dialog window. Escape will cancel and close the window.": "Anfang des Dialogfensters. Esc bricht ab und schließt das Fenster.",
"End of dialog window.": "Ende des Dialogfensters.",
"Audio Player": "Audio-Player",
"Video Player": "Video-Player",
"Progress Bar": "Forschrittsbalken",
"progress bar timing: currentTime={1} duration={2}": "{1} von {2}",
"Volume Level": "Lautstärkestufe"
});
});
});;
function legacy_activity_onclick_handler_1(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=119626&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_2(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/url/view.php?id=119696&redirect=1'); return false; };
function legacy_activity_onclick_handler_3(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/url/view.php?id=119697&redirect=1'); return false; };
function legacy_activity_onclick_handler_4(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/url/view.php?id=119698&redirect=1'); return false; };
function legacy_activity_onclick_handler_5(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/url/view.php?id=119703&redirect=1'); return false; };
function legacy_activity_onclick_handler_6(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=119695&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_7(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=119744&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_8(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/url/view.php?id=119745&redirect=1'); return false; };
function legacy_activity_onclick_handler_9(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=119750&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_10(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=119751&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_11(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=119752&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_12(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=119951&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_13(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=89836&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_14(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/url/view.php?id=89827&redirect=1'); return false; };
function legacy_activity_onclick_handler_15(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/url/view.php?id=89830&redirect=1'); return false; };
function legacy_activity_onclick_handler_16(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/url/view.php?id=89837&redirect=1'); return false; };
function legacy_activity_onclick_handler_17(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/url/view.php?id=89838&redirect=1'); return false; };
function legacy_activity_onclick_handler_18(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=89857&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_19(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=159487&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_20(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=89856&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_21(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=120207&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_22(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/url/view.php?id=90038&redirect=1'); return false; };
function legacy_activity_onclick_handler_23(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=90136&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_24(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/url/view.php?id=90140&redirect=1'); return false; };
function legacy_activity_onclick_handler_25(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=90142&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_26(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=161626&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_27(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=161627&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_28(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=161628&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_29(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=161664&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_30(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=161667&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_31(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=161688&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
function legacy_activity_onclick_handler_32(e) { e.halt(); window.open('https://elearning.ohmportal.de/mod/resource/view.php?id=161689&redirect=1', '', 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes'); return false; };
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_1, '#label_8_40', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_2, '#label_8_41', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_3, '#label_8_42', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_4, '#label_8_43', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_5, '#label_8_44', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_6, '#label_8_45', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_7, '#label_8_46', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_8, '#label_8_47', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_9, '#label_8_48', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_10, '#label_8_49', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_11, '#label_8_50', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_12, '#label_8_51', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_13, '#label_8_52', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_14, '#label_8_53', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_15, '#label_8_54', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_16, '#label_8_55', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_17, '#label_8_56', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_18, '#label_8_57', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_19, '#label_8_59', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_20, '#label_8_60', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_21, '#label_8_61', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_22, '#label_8_62', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_23, '#label_8_63', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_24, '#label_8_64', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_25, '#label_8_65', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_26, '#label_8_68', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_27, '#label_8_69', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_28, '#label_8_70', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_29, '#label_8_71', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_30, '#label_8_72', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_31, '#label_8_73', null);
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_32, '#label_8_74', null);
});
;
require(["block_navigation/navblock"], function(amd) { amd.init("4"); });;
require(["block_settings/settingsblock"], function(amd) { amd.init("5", null); });;
require(['core/yui'], function(Y) {
M.util.init_skiplink(Y);
});
;
require(['core/yui'], function(Y) {
Y.use('moodle-core-actionmenu', function() {
M.core.actionmenu.init();
});
});
;
require(['core/yui'], function(Y) {
Y.on('click', legacy_activity_onclick_handler_28, '#label_8_70', null);
});
;
require(["core/notification"], function(amd) { amd.init(322193, []); });;
require(["core/log"], function(amd) { amd.setConfig({"level":"warn"}); });
});
//]]>
</script>
<script type="text/javascript" src="https://elearning.ohmportal.de/theme/javascript.php/efi/1537347941/footer"></script>
<script type="text/javascript">
//<![CDATA[
M.str = {"moodle":{"lastmodified":"Zuletzt ge\u00e4ndert","name":"Name","error":"Fehler","info":"Informationen","yes":"Ja","no":"Nein","viewallcourses":"Alle Kurse zeigen","cancel":"Abbrechen","morehelp":"Weitere Hilfe","loadinghelp":"Wird geladen...","confirm":"Best\u00e4tigen","areyousure":"Sind Sie sicher?","closebuttontitle":"Schlie\u00dfen","unknownerror":"Unbekannter Fehler"},"repository":{"type":"Typ","size":"Gr\u00f6\u00dfe","invalidjson":"Ung\u00fcltiger JSON-Text","nofilesattached":"Keine Datei","filepicker":"Dateiauswahl","logout":"Abmelden","nofilesavailable":"Keine Dateien vorhanden","norepositoriesavailable":"Keine Ihrer aktuellen Repositories kann Dateien im n\u00f6tigen Format liefern","fileexistsdialogheader":"Datei bereits vorhanden","fileexistsdialog_editor":"Eine Datei mit diesem Namen wurde bereits an den Text angeh\u00e4ngt, den Sie gerade bearbeiten","fileexistsdialog_filemanager":"Eine Datei mit diesem Namen wurde bereits an den Text angeh\u00e4ngt","renameto":"Nach '{$a}' umbenennen","referencesexist":"{$a} Aliase\/Verkn\u00fcpfungen zu dieser Datei","select":"W\u00e4hlen Sie"},"admin":{"confirmdeletecomments":"M\u00f6chten Sie die Kommentare wirklich l\u00f6schen?","confirmation":"Best\u00e4tigung"}};
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
(function() {Y.use("moodle-filter_mathjaxloader-loader",function() {M.filter_mathjaxloader.configure({"mathjaxconfig":"\nMathJax.Hub.Config({\n config: [\"Accessible.js\", \"Safe.js\"],\n errorSettings: { message: [\"!\"] },\n skipStartupTypeset: true,\n messageStyle: \"none\"\n});\n","lang":"de"});
});
M.util.help_popups.setup(Y);
Y.use("moodle-core-popuphelp",function() {M.core.init_popuphelp();
});
M.util.init_block_hider(Y, {"id":"inst4","title":"Navigation","preference":"block4hidden","tooltipVisible":"Block Navigation verbergen","tooltipHidden":"Block Navigation anzeigen"});
M.util.init_block_hider(Y, {"id":"inst5","title":"Einstellungen","preference":"block5hidden","tooltipVisible":"Block Einstellungen verbergen","tooltipHidden":"Block Einstellungen anzeigen"});
M.util.init_block_hider(Y, {"id":"inst3479","title":"Moodle Support &amp; Blended Learning","preference":"block3479hidden","tooltipVisible":"Block Moodle Support &amp; Blended Learning verbergen","tooltipHidden":"Block Moodle Support &amp; Blended Learning anzeigen"});
M.util.js_pending('random5bc1ad639f99579'); Y.on('domready', function() { M.util.js_complete("init"); M.util.js_complete('random5bc1ad639f99579'); });
})();
//]]>
</script>
</div>
</div>
</body>
</html>
-1
View File
@@ -60,7 +60,6 @@ def doMovement():
image_rect.centery += move_vector[1]
if size_image[0]/2 <= image_rect.centerx <= width-(size_image[0]/2) and size_image[1]/2 <= image_rect.centery <= height-(size_image[1]/2):
pass
else:
if image_rect.centerx >= width-size_image[0]/2 or image_rect.centerx <= size_image[0]/2:
+18
View File
@@ -0,0 +1,18 @@
function afterLoaded() {
// alert("GELADEN!")
// var bla = document.getElementsByName()
var ard = document.getElementById("P1")
var zdf = document.getElementById("P2")
var rtl = document.getElementById("P3")
// ard.onclick = function() {alert("Erstes Programm");}
ard.addEventListener("click", function() {alert("Erstes Programm");} )
zdf.addEventListener("click", function() {alert("Zweites Programm");} )
rtl.addEventListener("click", function() {alert("Drittes Programm");} )
}
window.addEventListener('load', afterLoaded);
File renamed without changes.
File renamed without changes.
+3
View File
@@ -0,0 +1,3 @@
*{
color: red;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

@@ -0,0 +1,16 @@
import socket
myclient = socket.socket()
hostname = socket.gethostname()
port = 22445
myclient.connect((hostname, port))
msg_to_server = input("Aufgabe 1: Bitte geben Sie eine Nachricht ein: ")
myclient.send(msg_to_server.encode('utf-8'))
converted_msg = myclient.recv(1024)
print("Erhaltener string: ", converted_msg.decode('utf-8'))
myclient.close()
@@ -0,0 +1,13 @@
import socket
myserver = socket.socket()
hostname = socket.gethostname()
port = 22445
myserver.bind((hostname, port))
myserver.listen()
(connection, addr) = myserver.accept()
msg_from_client = connection.recv(1024).decode('utf-8')
in_capital_letters = msg_from_client.upper()
connection.send(in_capital_letters.encode('utf-8'))
@@ -0,0 +1,18 @@
import socket
myclient = socket.socket()
hostname = socket.gethostname()
port = 33221
myclient.connect((hostname, port))
while True:
msg_to_server = input("Aufgabe 2: Bitte geben Sie eine Nachricht ein: ")
if msg_to_server != "STOP":
myclient.send(msg_to_server.encode('utf-8'))
converted_msg = myclient.recv(1024).decode('utf-8')
print("Erhaltener string: ", converted_msg)
else:
myclient.close()
break
@@ -0,0 +1,14 @@
import socket
myserver = socket.socket()
hostname = socket.gethostname()
port = 33221
myserver.bind((hostname, port))
myserver.listen()
(connection, addr) = myserver.accept()
while True:
msg_from_client = connection.recv(1024).decode('utf-8')
in_capital_letters = msg_from_client.upper()
connection.send(in_capital_letters.encode('utf-8'))
@@ -0,0 +1,57 @@
import http.server
import urllib.parse
class MyOwnHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.end_headers()
parsed = urllib.parse.urlparse(self.path)
print("Geparsed wurde: ", parsed)
myOwnPath = parsed.path
print("Variable myOwnath ist :", myOwnPath)
nameOfMyOwnPath = myOwnPath[1:4].upper() #schneidet "/" am Anfang ab und verwandelt "yang" zu "YANG" bzw "ying" zu "YING, damit Titel des HTML-Files später "YANG_File" bzw "YING_File" ist
MyOwnQuery = parsed.query
msg_to_return = f"<html><head><title>{nameOfMyOwnPath}_File</title></head>"
if myOwnPath == "/Ying":
msg_to_return += "<body><p>This is the Ying-page.</p>"
msg_to_return += f"<p>You accessed path: {myOwnPath}</p>"
msg_to_return += '<a href="Yang">Go to Yang-Page</a>'
msg_to_return += "</body></html>"
if myOwnPath == "/Yang":
msg_to_return += "<body><p>This is the Yang-page.</p>"
msg_to_return += f"<p>You accessed path: {myOwnPath}</p>"
msg_to_return += '<a href="Ying">Go to Ying-Page</a>'
msg_to_return += "</body></html>"
self.wfile.write(msg_to_return.encode("utf-8"))
# self.wfile.write(f"<html><head><title>{nameOfMyOwnPath}_File</title></head>".encode('utf-8'))
#
# if myOwnPath == "/Ying":
# self.wfile.write("<body><p>This is the Ying-page.</p>".encode('utf-8'))
# self.wfile.write(f"<p>You accessed path: {myOwnPath}</p>".encode('utf-8'))
# self.wfile.write('<a href="YANG_File">Go to Yang-Page</a>'.encode('utf-8'))
# self.wfile.write("</body></html>".encode('utf-8'))
# self.wfile.close()
#
# if myOwnPath == "/Yang":
# self.wfile.write("<body><p>Sie sind auf der Yang-Seite.</p>".encode('utf-8'))
# self.wfile.write(f"<p>Eigener Pfad: {myOwnPath}</p>".encode('utf-8'))
# self.wfile.write('<a href="YING_File">Gehe zur Ying-Seite</a>'.encode('utf-8'))
# self.wfile.write("</body></html>".encode('utf-8'))
# self.wfile.close()
port = 22233
handler = MyOwnHandler
address = ('', port)
myserver = http.server.HTTPServer(address, handler)
myserver.serve_forever()
@@ -0,0 +1,47 @@
import http.server
import urllib.parse
class MyOwnHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.end_headers()
parsed = urllib.parse.urlparse(self.path)
path = parsed.path
query = parsed.query
query_components = urllib.parse.parse_qsl(query)
# query_components has form: [ ('von_param','???') , ('bis_param','???') ]
print("Die Query lautet: ", query_components)
if query_components != "[]":
von_param = int(query_components[0][1])
bis_param = int(query_components[1][1])
values = []
for curr_number in range(von_param, bis_param +1):
values.append((curr_number, curr_number**2),)
msg_to_return = "<html><head><title>Wertetabelle_mit_Quadratzahlen</title></head>"
msg_to_return += "<body><table>Quadrat_Tabelle"
msg_to_return += "<tr><th>QUADRATZAHLEN</th></tr>"
for all_tuples in values:
msg_to_return += f"<tr><td>{all_tuples[0]}</td><td>{all_tuples[1]}</td></tr>"
msg_to_return += "</table></body>"
self.wfile.write(msg_to_return.encode("utf-8"))
else:
pass
port = 33444
handler = MyOwnHandler
address = ('', port)
myserver = http.server.HTTPServer(address, handler)
myserver.serve_forever()
@@ -0,0 +1,11 @@
import sys
from krypto import hashes
myString = bytearray("Hello", encoding='utf-8')
hashwert = hashes.hashMod(myString)
print("Der Hashwert lautet: ", hashwert)
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,14 @@
import sys
""" Modul zur Erzeugung eines Hashwerts für Strings, die als Bytefolgen interpretiert werden """
def hashMod(bytes):
result = 0
for byte in bytes:
result += byte
return result % sys.maxsize
if __name__ == "__main__":
myByteArray = bytearray("Schokopraline", encoding='utf-8')
hashvalue = hashMod(myByteArray)
print("Ohne importierten Aufruf lautet der Hashwert zu 'Schokopraline': ", hashvalue)
@@ -0,0 +1,16 @@
from unittest import TestCase
from krypto import hashes
class TestHashMod(TestCase):
def test_hashMod(self):
firstCall = hashes.hashMod("Sahnetorte".encode('utf-8'))
secondCall = hashes.hashMod("Sahnetorte".encode('utf-8'))
straingeCall = hashes.hashMod("Kirschkuchen".encode('utf-8'))
self.assertEqual(firstCall, secondCall, "Die Werte sind gleich! -> Test geglückt") # firstCall and secondCall are Equal so test should finish with OK
self.assertNotEqual(firstCall, straingeCall, "Die Werte sind ungleich, Test ebenfalls geglückt!") # firstCall and straingeCall are not equal so test should finish with OK
#self.assertEqual(firstCall, straingeCall, "Die Werte sind gleich! -> Test geglückt") # firstCall and Strainge call are not equal but equality is tested. Test should finish with FAILED
Whitespace-only changes.
+1
View File
@@ -0,0 +1 @@
./setuptools-39.1.0-py3.7.egg
@@ -0,0 +1,69 @@
Metadata-Version: 2.1
Name: pip
Version: 10.0.1
Summary: The PyPA recommended tool for installing Python packages.
Home-page: https://pip.pypa.io/
Author: The pip developers
Author-email: python-virtualenv@groups.google.com
License: MIT
Description: pip
===
The `PyPA recommended`_ tool for installing Python packages.
.. image:: https://img.shields.io/pypi/v/pip.svg
:target: https://pypi.org/project/pip/
.. image:: https://img.shields.io/travis/pypa/pip/master.svg
:target: http://travis-ci.org/pypa/pip
.. image:: https://img.shields.io/appveyor/ci/pypa/pip.svg
:target: https://ci.appveyor.com/project/pypa/pip/history
.. image:: https://readthedocs.org/projects/pip/badge/?version=latest
:target: https://pip.pypa.io/en/latest
* `Installation`_
* `Documentation`_
* `Changelog`_
* `GitHub Page`_
* `Issue Tracking`_
* `User mailing list`_
* `Dev mailing list`_
* User IRC: #pypa on Freenode.
* Dev IRC: #pypa-dev on Freenode.
Code of Conduct
---------------
Everyone interacting in the pip project's codebases, issue trackers, chat
rooms and mailing lists is expected to follow the `PyPA Code of Conduct`_.
.. _PyPA recommended: https://packaging.python.org/en/latest/current/
.. _Installation: https://pip.pypa.io/en/stable/installing.html
.. _Documentation: https://pip.pypa.io/en/stable/
.. _Changelog: https://pip.pypa.io/en/stable/news.html
.. _GitHub Page: https://github.com/pypa/pip
.. _Issue Tracking: https://github.com/pypa/pip/issues
.. _User mailing list: http://groups.google.com/group/python-virtualenv
.. _Dev mailing list: http://groups.google.com/group/pypa-dev
.. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/
Keywords: easy_install distutils setuptools egg virtualenv
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Build Tools
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*
Provides-Extra: testing
@@ -0,0 +1,347 @@
AUTHORS.txt
LICENSE.txt
MANIFEST.in
NEWS.rst
README.rst
pyproject.toml
setup.cfg
setup.py
docs/Makefile
docs/__init__.py
docs/conf.py
docs/configuration.rst
docs/cookbook.rst
docs/development.rst
docs/docutils.conf
docs/index.rst
docs/installing.rst
docs/logic.rst
docs/make.bat
docs/news.rst
docs/pipext.py
docs/quickstart.rst
docs/usage.rst
docs/user_guide.rst
docs/man/pip.rst
docs/man/commands/check.rst
docs/man/commands/config.rst
docs/man/commands/download.rst
docs/man/commands/freeze.rst
docs/man/commands/hash.rst
docs/man/commands/help.rst
docs/man/commands/install.rst
docs/man/commands/list.rst
docs/man/commands/search.rst
docs/man/commands/show.rst
docs/man/commands/uninstall.rst
docs/man/commands/wheel.rst
docs/reference/index.rst
docs/reference/pip.rst
docs/reference/pip_check.rst
docs/reference/pip_config.rst
docs/reference/pip_download.rst
docs/reference/pip_freeze.rst
docs/reference/pip_hash.rst
docs/reference/pip_install.rst
docs/reference/pip_list.rst
docs/reference/pip_search.rst
docs/reference/pip_show.rst
docs/reference/pip_uninstall.rst
docs/reference/pip_wheel.rst
src/pip/__init__.py
src/pip/__main__.py
src/pip.egg-info/PKG-INFO
src/pip.egg-info/SOURCES.txt
src/pip.egg-info/dependency_links.txt
src/pip.egg-info/entry_points.txt
src/pip.egg-info/not-zip-safe
src/pip.egg-info/requires.txt
src/pip.egg-info/top_level.txt
src/pip/_internal/__init__.py
src/pip/_internal/basecommand.py
src/pip/_internal/baseparser.py
src/pip/_internal/build_env.py
src/pip/_internal/cache.py
src/pip/_internal/cmdoptions.py
src/pip/_internal/compat.py
src/pip/_internal/configuration.py
src/pip/_internal/download.py
src/pip/_internal/exceptions.py
src/pip/_internal/index.py
src/pip/_internal/locations.py
src/pip/_internal/pep425tags.py
src/pip/_internal/resolve.py
src/pip/_internal/status_codes.py
src/pip/_internal/wheel.py
src/pip/_internal/commands/__init__.py
src/pip/_internal/commands/check.py
src/pip/_internal/commands/completion.py
src/pip/_internal/commands/configuration.py
src/pip/_internal/commands/download.py
src/pip/_internal/commands/freeze.py
src/pip/_internal/commands/hash.py
src/pip/_internal/commands/help.py
src/pip/_internal/commands/install.py
src/pip/_internal/commands/list.py
src/pip/_internal/commands/search.py
src/pip/_internal/commands/show.py
src/pip/_internal/commands/uninstall.py
src/pip/_internal/commands/wheel.py
src/pip/_internal/models/__init__.py
src/pip/_internal/models/index.py
src/pip/_internal/operations/__init__.py
src/pip/_internal/operations/check.py
src/pip/_internal/operations/freeze.py
src/pip/_internal/operations/prepare.py
src/pip/_internal/req/__init__.py
src/pip/_internal/req/req_file.py
src/pip/_internal/req/req_install.py
src/pip/_internal/req/req_set.py
src/pip/_internal/req/req_uninstall.py
src/pip/_internal/utils/__init__.py
src/pip/_internal/utils/appdirs.py
src/pip/_internal/utils/deprecation.py
src/pip/_internal/utils/encoding.py
src/pip/_internal/utils/filesystem.py
src/pip/_internal/utils/glibc.py
src/pip/_internal/utils/hashes.py
src/pip/_internal/utils/logging.py
src/pip/_internal/utils/misc.py
src/pip/_internal/utils/outdated.py
src/pip/_internal/utils/packaging.py
src/pip/_internal/utils/setuptools_build.py
src/pip/_internal/utils/temp_dir.py
src/pip/_internal/utils/typing.py
src/pip/_internal/utils/ui.py
src/pip/_internal/vcs/__init__.py
src/pip/_internal/vcs/bazaar.py
src/pip/_internal/vcs/git.py
src/pip/_internal/vcs/mercurial.py
src/pip/_internal/vcs/subversion.py
src/pip/_vendor/README.rst
src/pip/_vendor/__init__.py
src/pip/_vendor/appdirs.py
src/pip/_vendor/distro.py
src/pip/_vendor/ipaddress.py
src/pip/_vendor/pyparsing.py
src/pip/_vendor/retrying.py
src/pip/_vendor/six.py
src/pip/_vendor/vendor.txt
src/pip/_vendor/cachecontrol/__init__.py
src/pip/_vendor/cachecontrol/_cmd.py
src/pip/_vendor/cachecontrol/adapter.py
src/pip/_vendor/cachecontrol/cache.py
src/pip/_vendor/cachecontrol/compat.py
src/pip/_vendor/cachecontrol/controller.py
src/pip/_vendor/cachecontrol/filewrapper.py
src/pip/_vendor/cachecontrol/heuristics.py
src/pip/_vendor/cachecontrol/serialize.py
src/pip/_vendor/cachecontrol/wrapper.py
src/pip/_vendor/cachecontrol/caches/__init__.py
src/pip/_vendor/cachecontrol/caches/file_cache.py
src/pip/_vendor/cachecontrol/caches/redis_cache.py
src/pip/_vendor/certifi/__init__.py
src/pip/_vendor/certifi/__main__.py
src/pip/_vendor/certifi/cacert.pem
src/pip/_vendor/certifi/core.py
src/pip/_vendor/chardet/__init__.py
src/pip/_vendor/chardet/big5freq.py
src/pip/_vendor/chardet/big5prober.py
src/pip/_vendor/chardet/chardistribution.py
src/pip/_vendor/chardet/charsetgroupprober.py
src/pip/_vendor/chardet/charsetprober.py
src/pip/_vendor/chardet/codingstatemachine.py
src/pip/_vendor/chardet/compat.py
src/pip/_vendor/chardet/cp949prober.py
src/pip/_vendor/chardet/enums.py
src/pip/_vendor/chardet/escprober.py
src/pip/_vendor/chardet/escsm.py
src/pip/_vendor/chardet/eucjpprober.py
src/pip/_vendor/chardet/euckrfreq.py
src/pip/_vendor/chardet/euckrprober.py
src/pip/_vendor/chardet/euctwfreq.py
src/pip/_vendor/chardet/euctwprober.py
src/pip/_vendor/chardet/gb2312freq.py
src/pip/_vendor/chardet/gb2312prober.py
src/pip/_vendor/chardet/hebrewprober.py
src/pip/_vendor/chardet/jisfreq.py
src/pip/_vendor/chardet/jpcntx.py
src/pip/_vendor/chardet/langbulgarianmodel.py
src/pip/_vendor/chardet/langcyrillicmodel.py
src/pip/_vendor/chardet/langgreekmodel.py
src/pip/_vendor/chardet/langhebrewmodel.py
src/pip/_vendor/chardet/langhungarianmodel.py
src/pip/_vendor/chardet/langthaimodel.py
src/pip/_vendor/chardet/langturkishmodel.py
src/pip/_vendor/chardet/latin1prober.py
src/pip/_vendor/chardet/mbcharsetprober.py
src/pip/_vendor/chardet/mbcsgroupprober.py
src/pip/_vendor/chardet/mbcssm.py
src/pip/_vendor/chardet/sbcharsetprober.py
src/pip/_vendor/chardet/sbcsgroupprober.py
src/pip/_vendor/chardet/sjisprober.py
src/pip/_vendor/chardet/universaldetector.py
src/pip/_vendor/chardet/utf8prober.py
src/pip/_vendor/chardet/version.py
src/pip/_vendor/chardet/cli/__init__.py
src/pip/_vendor/chardet/cli/chardetect.py
src/pip/_vendor/colorama/__init__.py
src/pip/_vendor/colorama/ansi.py
src/pip/_vendor/colorama/ansitowin32.py
src/pip/_vendor/colorama/initialise.py
src/pip/_vendor/colorama/win32.py
src/pip/_vendor/colorama/winterm.py
src/pip/_vendor/distlib/__init__.py
src/pip/_vendor/distlib/compat.py
src/pip/_vendor/distlib/database.py
src/pip/_vendor/distlib/index.py
src/pip/_vendor/distlib/locators.py
src/pip/_vendor/distlib/manifest.py
src/pip/_vendor/distlib/markers.py
src/pip/_vendor/distlib/metadata.py
src/pip/_vendor/distlib/resources.py
src/pip/_vendor/distlib/scripts.py
src/pip/_vendor/distlib/t32.exe
src/pip/_vendor/distlib/t64.exe
src/pip/_vendor/distlib/util.py
src/pip/_vendor/distlib/version.py
src/pip/_vendor/distlib/w32.exe
src/pip/_vendor/distlib/w64.exe
src/pip/_vendor/distlib/wheel.py
src/pip/_vendor/distlib/_backport/__init__.py
src/pip/_vendor/distlib/_backport/misc.py
src/pip/_vendor/distlib/_backport/shutil.py
src/pip/_vendor/distlib/_backport/sysconfig.cfg
src/pip/_vendor/distlib/_backport/sysconfig.py
src/pip/_vendor/distlib/_backport/tarfile.py
src/pip/_vendor/html5lib/__init__.py
src/pip/_vendor/html5lib/_ihatexml.py
src/pip/_vendor/html5lib/_inputstream.py
src/pip/_vendor/html5lib/_tokenizer.py
src/pip/_vendor/html5lib/_utils.py
src/pip/_vendor/html5lib/constants.py
src/pip/_vendor/html5lib/html5parser.py
src/pip/_vendor/html5lib/serializer.py
src/pip/_vendor/html5lib/_trie/__init__.py
src/pip/_vendor/html5lib/_trie/_base.py
src/pip/_vendor/html5lib/_trie/datrie.py
src/pip/_vendor/html5lib/_trie/py.py
src/pip/_vendor/html5lib/filters/__init__.py
src/pip/_vendor/html5lib/filters/alphabeticalattributes.py
src/pip/_vendor/html5lib/filters/base.py
src/pip/_vendor/html5lib/filters/inject_meta_charset.py
src/pip/_vendor/html5lib/filters/lint.py
src/pip/_vendor/html5lib/filters/optionaltags.py
src/pip/_vendor/html5lib/filters/sanitizer.py
src/pip/_vendor/html5lib/filters/whitespace.py
src/pip/_vendor/html5lib/treeadapters/__init__.py
src/pip/_vendor/html5lib/treeadapters/genshi.py
src/pip/_vendor/html5lib/treeadapters/sax.py
src/pip/_vendor/html5lib/treebuilders/__init__.py
src/pip/_vendor/html5lib/treebuilders/base.py
src/pip/_vendor/html5lib/treebuilders/dom.py
src/pip/_vendor/html5lib/treebuilders/etree.py
src/pip/_vendor/html5lib/treebuilders/etree_lxml.py
src/pip/_vendor/html5lib/treewalkers/__init__.py
src/pip/_vendor/html5lib/treewalkers/base.py
src/pip/_vendor/html5lib/treewalkers/dom.py
src/pip/_vendor/html5lib/treewalkers/etree.py
src/pip/_vendor/html5lib/treewalkers/etree_lxml.py
src/pip/_vendor/html5lib/treewalkers/genshi.py
src/pip/_vendor/idna/__init__.py
src/pip/_vendor/idna/codec.py
src/pip/_vendor/idna/compat.py
src/pip/_vendor/idna/core.py
src/pip/_vendor/idna/idnadata.py
src/pip/_vendor/idna/intranges.py
src/pip/_vendor/idna/package_data.py
src/pip/_vendor/idna/uts46data.py
src/pip/_vendor/lockfile/__init__.py
src/pip/_vendor/lockfile/linklockfile.py
src/pip/_vendor/lockfile/mkdirlockfile.py
src/pip/_vendor/lockfile/pidlockfile.py
src/pip/_vendor/lockfile/sqlitelockfile.py
src/pip/_vendor/lockfile/symlinklockfile.py
src/pip/_vendor/msgpack/__init__.py
src/pip/_vendor/msgpack/_version.py
src/pip/_vendor/msgpack/exceptions.py
src/pip/_vendor/msgpack/fallback.py
src/pip/_vendor/packaging/__about__.py
src/pip/_vendor/packaging/__init__.py
src/pip/_vendor/packaging/_compat.py
src/pip/_vendor/packaging/_structures.py
src/pip/_vendor/packaging/markers.py
src/pip/_vendor/packaging/requirements.py
src/pip/_vendor/packaging/specifiers.py
src/pip/_vendor/packaging/utils.py
src/pip/_vendor/packaging/version.py
src/pip/_vendor/pkg_resources/__init__.py
src/pip/_vendor/pkg_resources/py31compat.py
src/pip/_vendor/progress/__init__.py
src/pip/_vendor/progress/bar.py
src/pip/_vendor/progress/counter.py
src/pip/_vendor/progress/helpers.py
src/pip/_vendor/progress/spinner.py
src/pip/_vendor/pytoml/__init__.py
src/pip/_vendor/pytoml/core.py
src/pip/_vendor/pytoml/parser.py
src/pip/_vendor/pytoml/writer.py
src/pip/_vendor/requests/__init__.py
src/pip/_vendor/requests/__version__.py
src/pip/_vendor/requests/_internal_utils.py
src/pip/_vendor/requests/adapters.py
src/pip/_vendor/requests/api.py
src/pip/_vendor/requests/auth.py
src/pip/_vendor/requests/certs.py
src/pip/_vendor/requests/compat.py
src/pip/_vendor/requests/cookies.py
src/pip/_vendor/requests/exceptions.py
src/pip/_vendor/requests/help.py
src/pip/_vendor/requests/hooks.py
src/pip/_vendor/requests/models.py
src/pip/_vendor/requests/packages.py
src/pip/_vendor/requests/sessions.py
src/pip/_vendor/requests/status_codes.py
src/pip/_vendor/requests/structures.py
src/pip/_vendor/requests/utils.py
src/pip/_vendor/urllib3/__init__.py
src/pip/_vendor/urllib3/_collections.py
src/pip/_vendor/urllib3/connection.py
src/pip/_vendor/urllib3/connectionpool.py
src/pip/_vendor/urllib3/exceptions.py
src/pip/_vendor/urllib3/fields.py
src/pip/_vendor/urllib3/filepost.py
src/pip/_vendor/urllib3/poolmanager.py
src/pip/_vendor/urllib3/request.py
src/pip/_vendor/urllib3/response.py
src/pip/_vendor/urllib3/contrib/__init__.py
src/pip/_vendor/urllib3/contrib/appengine.py
src/pip/_vendor/urllib3/contrib/ntlmpool.py
src/pip/_vendor/urllib3/contrib/pyopenssl.py
src/pip/_vendor/urllib3/contrib/securetransport.py
src/pip/_vendor/urllib3/contrib/socks.py
src/pip/_vendor/urllib3/contrib/_securetransport/__init__.py
src/pip/_vendor/urllib3/contrib/_securetransport/bindings.py
src/pip/_vendor/urllib3/contrib/_securetransport/low_level.py
src/pip/_vendor/urllib3/packages/__init__.py
src/pip/_vendor/urllib3/packages/ordered_dict.py
src/pip/_vendor/urllib3/packages/six.py
src/pip/_vendor/urllib3/packages/backports/__init__.py
src/pip/_vendor/urllib3/packages/backports/makefile.py
src/pip/_vendor/urllib3/packages/ssl_match_hostname/__init__.py
src/pip/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py
src/pip/_vendor/urllib3/util/__init__.py
src/pip/_vendor/urllib3/util/connection.py
src/pip/_vendor/urllib3/util/request.py
src/pip/_vendor/urllib3/util/response.py
src/pip/_vendor/urllib3/util/retry.py
src/pip/_vendor/urllib3/util/selectors.py
src/pip/_vendor/urllib3/util/ssl_.py
src/pip/_vendor/urllib3/util/timeout.py
src/pip/_vendor/urllib3/util/url.py
src/pip/_vendor/urllib3/util/wait.py
src/pip/_vendor/webencodings/__init__.py
src/pip/_vendor/webencodings/labels.py
src/pip/_vendor/webencodings/mklabels.py
src/pip/_vendor/webencodings/tests.py
src/pip/_vendor/webencodings/x_user_defined.py
@@ -0,0 +1,5 @@
[console_scripts]
pip = pip._internal:main
pip3 = pip._internal:main
pip3.7 = pip._internal:main
@@ -0,0 +1,8 @@
[testing]
pytest
mock
pretend
scripttest>=1.3
virtualenv>=1.10
freezegun
@@ -0,0 +1 @@
pip
@@ -0,0 +1 @@
__version__ = "10.0.1"
@@ -0,0 +1,19 @@
from __future__ import absolute_import
import os
import sys
# If we are running from a wheel, add the wheel to sys.path
# This allows the usage python pip-*.whl/pip install pip-*.whl
if __package__ == '':
# __file__ is pip-*.whl/pip/__main__.py
# first dirname call strips of '/__main__.py', second strips off '/pip'
# Resulting path is the name of the wheel itself
# Add that to sys.path so we can import pip
path = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, path)
from pip._internal import main as _main # noqa
if __name__ == '__main__':
sys.exit(_main())
@@ -0,0 +1,246 @@
#!/usr/bin/env python
from __future__ import absolute_import
import locale
import logging
import os
import optparse
import warnings
import sys
# 2016-06-17 barry@debian.org: urllib3 1.14 added optional support for socks,
# but if invoked (i.e. imported), it will issue a warning to stderr if socks
# isn't available. requests unconditionally imports urllib3's socks contrib
# module, triggering this warning. The warning breaks DEP-8 tests (because of
# the stderr output) and is just plain annoying in normal usage. I don't want
# to add socks as yet another dependency for pip, nor do I want to allow-stder
# in the DEP-8 tests, so just suppress the warning. pdb tells me this has to
# be done before the import of pip.vcs.
from pip._vendor.urllib3.exceptions import DependencyWarning
warnings.filterwarnings("ignore", category=DependencyWarning) # noqa
# We want to inject the use of SecureTransport as early as possible so that any
# references or sessions or what have you are ensured to have it, however we
# only want to do this in the case that we're running on macOS and the linked
# OpenSSL is too old to handle TLSv1.2
try:
import ssl
except ImportError:
pass
else:
# Checks for OpenSSL 1.0.1 on MacOS
if sys.platform == "darwin" and ssl.OPENSSL_VERSION_NUMBER < 0x1000100f:
try:
from pip._vendor.urllib3.contrib import securetransport
except (ImportError, OSError):
pass
else:
securetransport.inject_into_urllib3()
from pip import __version__
from pip._internal import cmdoptions
from pip._internal.exceptions import CommandError, PipError
from pip._internal.utils.misc import get_installed_distributions, get_prog
from pip._internal.utils import deprecation
from pip._internal.vcs import git, mercurial, subversion, bazaar # noqa
from pip._internal.baseparser import (
ConfigOptionParser, UpdatingDefaultsHelpFormatter,
)
from pip._internal.commands import get_summaries, get_similar_commands
from pip._internal.commands import commands_dict
from pip._vendor.urllib3.exceptions import InsecureRequestWarning
logger = logging.getLogger(__name__)
# Hide the InsecureRequestWarning from urllib3
warnings.filterwarnings("ignore", category=InsecureRequestWarning)
def autocomplete():
"""Command and option completion for the main option parser (and options)
and its subcommands (and options).
Enable by sourcing one of the completion shell scripts (bash, zsh or fish).
"""
# Don't complete if user hasn't sourced bash_completion file.
if 'PIP_AUTO_COMPLETE' not in os.environ:
return
cwords = os.environ['COMP_WORDS'].split()[1:]
cword = int(os.environ['COMP_CWORD'])
try:
current = cwords[cword - 1]
except IndexError:
current = ''
subcommands = [cmd for cmd, summary in get_summaries()]
options = []
# subcommand
try:
subcommand_name = [w for w in cwords if w in subcommands][0]
except IndexError:
subcommand_name = None
parser = create_main_parser()
# subcommand options
if subcommand_name:
# special case: 'help' subcommand has no options
if subcommand_name == 'help':
sys.exit(1)
# special case: list locally installed dists for show and uninstall
should_list_installed = (
subcommand_name in ['show', 'uninstall'] and
not current.startswith('-')
)
if should_list_installed:
installed = []
lc = current.lower()
for dist in get_installed_distributions(local_only=True):
if dist.key.startswith(lc) and dist.key not in cwords[1:]:
installed.append(dist.key)
# if there are no dists installed, fall back to option completion
if installed:
for dist in installed:
print(dist)
sys.exit(1)
subcommand = commands_dict[subcommand_name]()
for opt in subcommand.parser.option_list_all:
if opt.help != optparse.SUPPRESS_HELP:
for opt_str in opt._long_opts + opt._short_opts:
options.append((opt_str, opt.nargs))
# filter out previously specified options from available options
prev_opts = [x.split('=')[0] for x in cwords[1:cword - 1]]
options = [(x, v) for (x, v) in options if x not in prev_opts]
# filter options by current input
options = [(k, v) for k, v in options if k.startswith(current)]
for option in options:
opt_label = option[0]
# append '=' to options which require args
if option[1] and option[0][:2] == "--":
opt_label += '='
print(opt_label)
else:
# show main parser options only when necessary
if current.startswith('-') or current.startswith('--'):
opts = [i.option_list for i in parser.option_groups]
opts.append(parser.option_list)
opts = (o for it in opts for o in it)
for opt in opts:
if opt.help != optparse.SUPPRESS_HELP:
subcommands += opt._long_opts + opt._short_opts
print(' '.join([x for x in subcommands if x.startswith(current)]))
sys.exit(1)
def create_main_parser():
parser_kw = {
'usage': '\n%prog <command> [options]',
'add_help_option': False,
'formatter': UpdatingDefaultsHelpFormatter(),
'name': 'global',
'prog': get_prog(),
}
parser = ConfigOptionParser(**parser_kw)
parser.disable_interspersed_args()
pip_pkg_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
parser.version = 'pip %s from %s (python %s)' % (
__version__, pip_pkg_dir, sys.version[:3],
)
# add the general options
gen_opts = cmdoptions.make_option_group(cmdoptions.general_group, parser)
parser.add_option_group(gen_opts)
parser.main = True # so the help formatter knows
# create command listing for description
command_summaries = get_summaries()
description = [''] + ['%-27s %s' % (i, j) for i, j in command_summaries]
parser.description = '\n'.join(description)
return parser
def parseopts(args):
parser = create_main_parser()
# Note: parser calls disable_interspersed_args(), so the result of this
# call is to split the initial args into the general options before the
# subcommand and everything else.
# For example:
# args: ['--timeout=5', 'install', '--user', 'INITools']
# general_options: ['--timeout==5']
# args_else: ['install', '--user', 'INITools']
general_options, args_else = parser.parse_args(args)
# --version
if general_options.version:
sys.stdout.write(parser.version)
sys.stdout.write(os.linesep)
sys.exit()
# pip || pip help -> print_help()
if not args_else or (args_else[0] == 'help' and len(args_else) == 1):
parser.print_help()
sys.exit()
# the subcommand name
cmd_name = args_else[0]
if cmd_name not in commands_dict:
guess = get_similar_commands(cmd_name)
msg = ['unknown command "%s"' % cmd_name]
if guess:
msg.append('maybe you meant "%s"' % guess)
raise CommandError(' - '.join(msg))
# all the args without the subcommand
cmd_args = args[:]
cmd_args.remove(cmd_name)
return cmd_name, cmd_args
def check_isolated(args):
isolated = False
if "--isolated" in args:
isolated = True
return isolated
def main(args=None):
if args is None:
args = sys.argv[1:]
# Configure our deprecation warnings to be sent through loggers
deprecation.install_warning_logger()
autocomplete()
try:
cmd_name, cmd_args = parseopts(args)
except PipError as exc:
sys.stderr.write("ERROR: %s" % exc)
sys.stderr.write(os.linesep)
sys.exit(1)
# Needed for locale.getpreferredencoding(False) to work
# in pip._internal.utils.encoding.auto_decode
try:
locale.setlocale(locale.LC_ALL, '')
except locale.Error as e:
# setlocale can apparently crash if locale are uninitialized
logger.debug("Ignoring error %s when setting locale", e)
command = commands_dict[cmd_name](isolated=check_isolated(cmd_args))
return command.main(cmd_args)
@@ -0,0 +1,373 @@
"""Base Command class, and related routines"""
from __future__ import absolute_import
import logging
import logging.config
import optparse
import os
import sys
import warnings
from pip._internal import cmdoptions
from pip._internal.baseparser import (
ConfigOptionParser, UpdatingDefaultsHelpFormatter,
)
from pip._internal.compat import WINDOWS
from pip._internal.download import PipSession
from pip._internal.exceptions import (
BadCommand, CommandError, InstallationError, PreviousBuildDirError,
UninstallationError,
)
from pip._internal.index import PackageFinder
from pip._internal.locations import running_under_virtualenv
from pip._internal.req.req_file import parse_requirements
from pip._internal.req.req_install import InstallRequirement
from pip._internal.status_codes import (
ERROR, PREVIOUS_BUILD_DIR_ERROR, SUCCESS, UNKNOWN_ERROR,
VIRTUALENV_NOT_FOUND,
)
from pip._internal.utils import deprecation
from pip._internal.utils.logging import IndentingFormatter
from pip._internal.utils.misc import get_prog, normalize_path
from pip._internal.utils.outdated import pip_version_check
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import Optional
__all__ = ['Command']
logger = logging.getLogger(__name__)
class Command(object):
name = None # type: Optional[str]
usage = None # type: Optional[str]
hidden = False # type: bool
ignore_require_venv = False # type: bool
log_streams = ("ext://sys.stdout", "ext://sys.stderr")
def __init__(self, isolated=False):
parser_kw = {
'usage': self.usage,
'prog': '%s %s' % (get_prog(), self.name),
'formatter': UpdatingDefaultsHelpFormatter(),
'add_help_option': False,
'name': self.name,
'description': self.__doc__,
'isolated': isolated,
}
self.parser = ConfigOptionParser(**parser_kw)
# Commands should add options to this option group
optgroup_name = '%s Options' % self.name.capitalize()
self.cmd_opts = optparse.OptionGroup(self.parser, optgroup_name)
# Add the general options
gen_opts = cmdoptions.make_option_group(
cmdoptions.general_group,
self.parser,
)
self.parser.add_option_group(gen_opts)
def _build_session(self, options, retries=None, timeout=None):
session = PipSession(
cache=(
normalize_path(os.path.join(options.cache_dir, "http"))
if options.cache_dir else None
),
retries=retries if retries is not None else options.retries,
insecure_hosts=options.trusted_hosts,
)
# Handle custom ca-bundles from the user
if options.cert:
session.verify = options.cert
# Handle SSL client certificate
if options.client_cert:
session.cert = options.client_cert
# Handle timeouts
if options.timeout or timeout:
session.timeout = (
timeout if timeout is not None else options.timeout
)
# Handle configured proxies
if options.proxy:
session.proxies = {
"http": options.proxy,
"https": options.proxy,
}
# Determine if we can prompt the user for authentication or not
session.auth.prompting = not options.no_input
return session
def parse_args(self, args):
# factored out for testability
return self.parser.parse_args(args)
def main(self, args):
options, args = self.parse_args(args)
# Set verbosity so that it can be used elsewhere.
self.verbosity = options.verbose - options.quiet
if self.verbosity >= 1:
level = "DEBUG"
elif self.verbosity == -1:
level = "WARNING"
elif self.verbosity == -2:
level = "ERROR"
elif self.verbosity <= -3:
level = "CRITICAL"
else:
level = "INFO"
# The root logger should match the "console" level *unless* we
# specified "--log" to send debug logs to a file.
root_level = level
if options.log:
root_level = "DEBUG"
logger_class = "pip._internal.utils.logging.ColorizedStreamHandler"
handler_class = "pip._internal.utils.logging.BetterRotatingFileHandler"
logging.config.dictConfig({
"version": 1,
"disable_existing_loggers": False,
"filters": {
"exclude_warnings": {
"()": "pip._internal.utils.logging.MaxLevelFilter",
"level": logging.WARNING,
},
},
"formatters": {
"indent": {
"()": IndentingFormatter,
"format": "%(message)s",
},
},
"handlers": {
"console": {
"level": level,
"class": logger_class,
"no_color": options.no_color,
"stream": self.log_streams[0],
"filters": ["exclude_warnings"],
"formatter": "indent",
},
"console_errors": {
"level": "WARNING",
"class": logger_class,
"no_color": options.no_color,
"stream": self.log_streams[1],
"formatter": "indent",
},
"user_log": {
"level": "DEBUG",
"class": handler_class,
"filename": options.log or "/dev/null",
"delay": True,
"formatter": "indent",
},
},
"root": {
"level": root_level,
"handlers": list(filter(None, [
"console",
"console_errors",
"user_log" if options.log else None,
])),
},
# Disable any logging besides WARNING unless we have DEBUG level
# logging enabled. These use both pip._vendor and the bare names
# for the case where someone unbundles our libraries.
"loggers": {
name: {
"level": (
"WARNING" if level in ["INFO", "ERROR"] else "DEBUG"
)
} for name in [
"pip._vendor", "distlib", "requests", "urllib3"
]
},
})
if sys.version_info[:2] == (3, 3):
warnings.warn(
"Python 3.3 supported has been deprecated and support for it "
"will be dropped in the future. Please upgrade your Python.",
deprecation.RemovedInPip11Warning,
)
# TODO: try to get these passing down from the command?
# without resorting to os.environ to hold these.
if options.no_input:
os.environ['PIP_NO_INPUT'] = '1'
if options.exists_action:
os.environ['PIP_EXISTS_ACTION'] = ' '.join(options.exists_action)
if options.require_venv and not self.ignore_require_venv:
# If a venv is required check if it can really be found
if not running_under_virtualenv():
logger.critical(
'Could not find an activated virtualenv (required).'
)
sys.exit(VIRTUALENV_NOT_FOUND)
original_root_handlers = set(logging.root.handlers)
try:
status = self.run(options, args)
# FIXME: all commands should return an exit status
# and when it is done, isinstance is not needed anymore
if isinstance(status, int):
return status
except PreviousBuildDirError as exc:
logger.critical(str(exc))
logger.debug('Exception information:', exc_info=True)
return PREVIOUS_BUILD_DIR_ERROR
except (InstallationError, UninstallationError, BadCommand) as exc:
logger.critical(str(exc))
logger.debug('Exception information:', exc_info=True)
return ERROR
except CommandError as exc:
logger.critical('ERROR: %s', exc)
logger.debug('Exception information:', exc_info=True)
return ERROR
except KeyboardInterrupt:
logger.critical('Operation cancelled by user')
logger.debug('Exception information:', exc_info=True)
return ERROR
except:
logger.critical('Exception:', exc_info=True)
return UNKNOWN_ERROR
finally:
# Check if we're using the latest version of pip available
if (not options.disable_pip_version_check and not
getattr(options, "no_index", False)):
with self._build_session(
options,
retries=0,
timeout=min(5, options.timeout)) as session:
pip_version_check(session, options)
# Avoid leaking loggers
for handler in set(logging.root.handlers) - original_root_handlers:
# this method benefit from the Logger class internal lock
logging.root.removeHandler(handler)
return SUCCESS
class RequirementCommand(Command):
@staticmethod
def populate_requirement_set(requirement_set, args, options, finder,
session, name, wheel_cache):
"""
Marshal cmd line args into a requirement set.
"""
# NOTE: As a side-effect, options.require_hashes and
# requirement_set.require_hashes may be updated
for filename in options.constraints:
for req_to_add in parse_requirements(
filename,
constraint=True, finder=finder, options=options,
session=session, wheel_cache=wheel_cache):
req_to_add.is_direct = True
requirement_set.add_requirement(req_to_add)
for req in args:
req_to_add = InstallRequirement.from_line(
req, None, isolated=options.isolated_mode,
wheel_cache=wheel_cache
)
req_to_add.is_direct = True
requirement_set.add_requirement(req_to_add)
for req in options.editables:
req_to_add = InstallRequirement.from_editable(
req,
isolated=options.isolated_mode,
wheel_cache=wheel_cache
)
req_to_add.is_direct = True
requirement_set.add_requirement(req_to_add)
for filename in options.requirements:
for req_to_add in parse_requirements(
filename,
finder=finder, options=options, session=session,
wheel_cache=wheel_cache):
req_to_add.is_direct = True
requirement_set.add_requirement(req_to_add)
# If --require-hashes was a line in a requirements file, tell
# RequirementSet about it:
requirement_set.require_hashes = options.require_hashes
if not (args or options.editables or options.requirements):
opts = {'name': name}
if options.find_links:
raise CommandError(
'You must give at least one requirement to %(name)s '
'(maybe you meant "pip %(name)s %(links)s"?)' %
dict(opts, links=' '.join(options.find_links)))
else:
raise CommandError(
'You must give at least one requirement to %(name)s '
'(see "pip help %(name)s")' % opts)
# On Windows, any operation modifying pip should be run as:
# python -m pip ...
# See https://github.com/pypa/pip/issues/1299 for more discussion
should_show_use_python_msg = (
WINDOWS and
requirement_set.has_requirement("pip") and
os.path.basename(sys.argv[0]).startswith("pip")
)
if should_show_use_python_msg:
new_command = [
sys.executable, "-m", "pip"
] + sys.argv[1:]
raise CommandError(
'To modify pip, please run the following command:\n{}'
.format(" ".join(new_command))
)
def _build_package_finder(self, options, session,
platform=None, python_versions=None,
abi=None, implementation=None):
"""
Create a package finder appropriate to this requirement command.
"""
index_urls = [options.index_url] + options.extra_index_urls
if options.no_index:
logger.debug('Ignoring indexes: %s', ','.join(index_urls))
index_urls = []
return PackageFinder(
find_links=options.find_links,
format_control=options.format_control,
index_urls=index_urls,
trusted_hosts=options.trusted_hosts,
allow_all_prereleases=options.pre,
process_dependency_links=options.process_dependency_links,
session=session,
platform=platform,
versions=python_versions,
abi=abi,
implementation=implementation,
)
@@ -0,0 +1,240 @@
"""Base option parser setup"""
from __future__ import absolute_import
import logging
import optparse
import sys
import textwrap
from distutils.util import strtobool
from pip._vendor.six import string_types
from pip._internal.compat import get_terminal_size
from pip._internal.configuration import Configuration, ConfigurationError
logger = logging.getLogger(__name__)
class PrettyHelpFormatter(optparse.IndentedHelpFormatter):
"""A prettier/less verbose help formatter for optparse."""
def __init__(self, *args, **kwargs):
# help position must be aligned with __init__.parseopts.description
kwargs['max_help_position'] = 30
kwargs['indent_increment'] = 1
kwargs['width'] = get_terminal_size()[0] - 2
optparse.IndentedHelpFormatter.__init__(self, *args, **kwargs)
def format_option_strings(self, option):
return self._format_option_strings(option, ' <%s>', ', ')
def _format_option_strings(self, option, mvarfmt=' <%s>', optsep=', '):
"""
Return a comma-separated list of option strings and metavars.
:param option: tuple of (short opt, long opt), e.g: ('-f', '--format')
:param mvarfmt: metavar format string - evaluated as mvarfmt % metavar
:param optsep: separator
"""
opts = []
if option._short_opts:
opts.append(option._short_opts[0])
if option._long_opts:
opts.append(option._long_opts[0])
if len(opts) > 1:
opts.insert(1, optsep)
if option.takes_value():
metavar = option.metavar or option.dest.lower()
opts.append(mvarfmt % metavar.lower())
return ''.join(opts)
def format_heading(self, heading):
if heading == 'Options':
return ''
return heading + ':\n'
def format_usage(self, usage):
"""
Ensure there is only one newline between usage and the first heading
if there is no description.
"""
msg = '\nUsage: %s\n' % self.indent_lines(textwrap.dedent(usage), " ")
return msg
def format_description(self, description):
# leave full control over description to us
if description:
if hasattr(self.parser, 'main'):
label = 'Commands'
else:
label = 'Description'
# some doc strings have initial newlines, some don't
description = description.lstrip('\n')
# some doc strings have final newlines and spaces, some don't
description = description.rstrip()
# dedent, then reindent
description = self.indent_lines(textwrap.dedent(description), " ")
description = '%s:\n%s\n' % (label, description)
return description
else:
return ''
def format_epilog(self, epilog):
# leave full control over epilog to us
if epilog:
return epilog
else:
return ''
def indent_lines(self, text, indent):
new_lines = [indent + line for line in text.split('\n')]
return "\n".join(new_lines)
class UpdatingDefaultsHelpFormatter(PrettyHelpFormatter):
"""Custom help formatter for use in ConfigOptionParser.
This is updates the defaults before expanding them, allowing
them to show up correctly in the help listing.
"""
def expand_default(self, option):
if self.parser is not None:
self.parser._update_defaults(self.parser.defaults)
return optparse.IndentedHelpFormatter.expand_default(self, option)
class CustomOptionParser(optparse.OptionParser):
def insert_option_group(self, idx, *args, **kwargs):
"""Insert an OptionGroup at a given position."""
group = self.add_option_group(*args, **kwargs)
self.option_groups.pop()
self.option_groups.insert(idx, group)
return group
@property
def option_list_all(self):
"""Get a list of all options, including those in option groups."""
res = self.option_list[:]
for i in self.option_groups:
res.extend(i.option_list)
return res
class ConfigOptionParser(CustomOptionParser):
"""Custom option parser which updates its defaults by checking the
configuration files and environmental variables"""
def __init__(self, *args, **kwargs):
self.name = kwargs.pop('name')
isolated = kwargs.pop("isolated", False)
self.config = Configuration(isolated)
assert self.name
optparse.OptionParser.__init__(self, *args, **kwargs)
def check_default(self, option, key, val):
try:
return option.check_value(key, val)
except optparse.OptionValueError as exc:
print("An error occurred during configuration: %s" % exc)
sys.exit(3)
def _get_ordered_configuration_items(self):
# Configuration gives keys in an unordered manner. Order them.
override_order = ["global", self.name, ":env:"]
# Pool the options into different groups
section_items = {name: [] for name in override_order}
for section_key, val in self.config.items():
# ignore empty values
if not val:
logger.debug(
"Ignoring configuration key '%s' as it's value is empty.",
section_key
)
continue
section, key = section_key.split(".", 1)
if section in override_order:
section_items[section].append((key, val))
# Yield each group in their override order
for section in override_order:
for key, val in section_items[section]:
yield key, val
def _update_defaults(self, defaults):
"""Updates the given defaults with values from the config files and
the environ. Does a little special handling for certain types of
options (lists)."""
# Accumulate complex default state.
self.values = optparse.Values(self.defaults)
late_eval = set()
# Then set the options with those values
for key, val in self._get_ordered_configuration_items():
# '--' because configuration supports only long names
option = self.get_option('--' + key)
# Ignore options not present in this parser. E.g. non-globals put
# in [global] by users that want them to apply to all applicable
# commands.
if option is None:
continue
if option.action in ('store_true', 'store_false', 'count'):
val = strtobool(val)
elif option.action == 'append':
val = val.split()
val = [self.check_default(option, key, v) for v in val]
elif option.action == 'callback':
late_eval.add(option.dest)
opt_str = option.get_opt_string()
val = option.convert_value(opt_str, val)
# From take_action
args = option.callback_args or ()
kwargs = option.callback_kwargs or {}
option.callback(option, opt_str, val, self, *args, **kwargs)
else:
val = self.check_default(option, key, val)
defaults[option.dest] = val
for key in late_eval:
defaults[key] = getattr(self.values, key)
self.values = None
return defaults
def get_default_values(self):
"""Overriding to make updating the defaults after instantiation of
the option parser possible, _update_defaults() does the dirty work."""
if not self.process_default_values:
# Old, pre-Optik 1.5 behaviour.
return optparse.Values(self.defaults)
# Load the configuration, or error out in case of an error
try:
self.config.load()
except ConfigurationError as err:
self.exit(2, err.args[0])
defaults = self._update_defaults(self.defaults.copy()) # ours
for option in self._get_all_options():
default = defaults.get(option.dest)
if isinstance(default, string_types):
opt_str = option.get_opt_string()
defaults[option.dest] = option.check_value(opt_str, default)
return optparse.Values(defaults)
def error(self, msg):
self.print_usage(sys.stderr)
self.exit(2, "%s\n" % msg)
@@ -0,0 +1,92 @@
"""Build Environment used for isolation during sdist building
"""
import os
from distutils.sysconfig import get_python_lib
from sysconfig import get_paths
from pip._internal.utils.temp_dir import TempDirectory
class BuildEnvironment(object):
"""Creates and manages an isolated environment to install build deps
"""
def __init__(self, no_clean):
self._temp_dir = TempDirectory(kind="build-env")
self._no_clean = no_clean
@property
def path(self):
return self._temp_dir.path
def __enter__(self):
self._temp_dir.create()
self.save_path = os.environ.get('PATH', None)
self.save_pythonpath = os.environ.get('PYTHONPATH', None)
self.save_nousersite = os.environ.get('PYTHONNOUSERSITE', None)
install_scheme = 'nt' if (os.name == 'nt') else 'posix_prefix'
install_dirs = get_paths(install_scheme, vars={
'base': self.path,
'platbase': self.path,
})
scripts = install_dirs['scripts']
if self.save_path:
os.environ['PATH'] = scripts + os.pathsep + self.save_path
else:
os.environ['PATH'] = scripts + os.pathsep + os.defpath
# Note: prefer distutils' sysconfig to get the
# library paths so PyPy is correctly supported.
purelib = get_python_lib(plat_specific=0, prefix=self.path)
platlib = get_python_lib(plat_specific=1, prefix=self.path)
if purelib == platlib:
lib_dirs = purelib
else:
lib_dirs = purelib + os.pathsep + platlib
if self.save_pythonpath:
os.environ['PYTHONPATH'] = lib_dirs + os.pathsep + \
self.save_pythonpath
else:
os.environ['PYTHONPATH'] = lib_dirs
os.environ['PYTHONNOUSERSITE'] = '1'
return self.path
def __exit__(self, exc_type, exc_val, exc_tb):
if not self._no_clean:
self._temp_dir.cleanup()
def restore_var(varname, old_value):
if old_value is None:
os.environ.pop(varname, None)
else:
os.environ[varname] = old_value
restore_var('PATH', self.save_path)
restore_var('PYTHONPATH', self.save_pythonpath)
restore_var('PYTHONNOUSERSITE', self.save_nousersite)
def cleanup(self):
self._temp_dir.cleanup()
class NoOpBuildEnvironment(BuildEnvironment):
"""A no-op drop-in replacement for BuildEnvironment
"""
def __init__(self, no_clean):
pass
def __enter__(self):
pass
def __exit__(self, exc_type, exc_val, exc_tb):
pass
def cleanup(self):
pass
@@ -0,0 +1,202 @@
"""Cache Management
"""
import errno
import hashlib
import logging
import os
from pip._vendor.packaging.utils import canonicalize_name
from pip._internal import index
from pip._internal.compat import expanduser
from pip._internal.download import path_to_url
from pip._internal.utils.temp_dir import TempDirectory
from pip._internal.wheel import InvalidWheelFilename, Wheel
logger = logging.getLogger(__name__)
class Cache(object):
"""An abstract class - provides cache directories for data from links
:param cache_dir: The root of the cache.
:param format_control: A pip.index.FormatControl object to limit
binaries being read from the cache.
:param allowed_formats: which formats of files the cache should store.
('binary' and 'source' are the only allowed values)
"""
def __init__(self, cache_dir, format_control, allowed_formats):
super(Cache, self).__init__()
self.cache_dir = expanduser(cache_dir) if cache_dir else None
self.format_control = format_control
self.allowed_formats = allowed_formats
_valid_formats = {"source", "binary"}
assert self.allowed_formats.union(_valid_formats) == _valid_formats
def _get_cache_path_parts(self, link):
"""Get parts of part that must be os.path.joined with cache_dir
"""
# We want to generate an url to use as our cache key, we don't want to
# just re-use the URL because it might have other items in the fragment
# and we don't care about those.
key_parts = [link.url_without_fragment]
if link.hash_name is not None and link.hash is not None:
key_parts.append("=".join([link.hash_name, link.hash]))
key_url = "#".join(key_parts)
# Encode our key url with sha224, we'll use this because it has similar
# security properties to sha256, but with a shorter total output (and
# thus less secure). However the differences don't make a lot of
# difference for our use case here.
hashed = hashlib.sha224(key_url.encode()).hexdigest()
# We want to nest the directories some to prevent having a ton of top
# level directories where we might run out of sub directories on some
# FS.
parts = [hashed[:2], hashed[2:4], hashed[4:6], hashed[6:]]
return parts
def _get_candidates(self, link, package_name):
can_not_cache = (
not self.cache_dir or
not package_name or
not link
)
if can_not_cache:
return []
canonical_name = canonicalize_name(package_name)
formats = index.fmt_ctl_formats(
self.format_control, canonical_name
)
if not self.allowed_formats.intersection(formats):
return []
root = self.get_path_for_link(link)
try:
return os.listdir(root)
except OSError as err:
if err.errno in {errno.ENOENT, errno.ENOTDIR}:
return []
raise
def get_path_for_link(self, link):
"""Return a directory to store cached items in for link.
"""
raise NotImplementedError()
def get(self, link, package_name):
"""Returns a link to a cached item if it exists, otherwise returns the
passed link.
"""
raise NotImplementedError()
def _link_for_candidate(self, link, candidate):
root = self.get_path_for_link(link)
path = os.path.join(root, candidate)
return index.Link(path_to_url(path))
def cleanup(self):
pass
class SimpleWheelCache(Cache):
"""A cache of wheels for future installs.
"""
def __init__(self, cache_dir, format_control):
super(SimpleWheelCache, self).__init__(
cache_dir, format_control, {"binary"}
)
def get_path_for_link(self, link):
"""Return a directory to store cached wheels for link
Because there are M wheels for any one sdist, we provide a directory
to cache them in, and then consult that directory when looking up
cache hits.
We only insert things into the cache if they have plausible version
numbers, so that we don't contaminate the cache with things that were
not unique. E.g. ./package might have dozens of installs done for it
and build a version of 0.0...and if we built and cached a wheel, we'd
end up using the same wheel even if the source has been edited.
:param link: The link of the sdist for which this will cache wheels.
"""
parts = self._get_cache_path_parts(link)
# Store wheels within the root cache_dir
return os.path.join(self.cache_dir, "wheels", *parts)
def get(self, link, package_name):
candidates = []
for wheel_name in self._get_candidates(link, package_name):
try:
wheel = Wheel(wheel_name)
except InvalidWheelFilename:
continue
if not wheel.supported():
# Built for a different python/arch/etc
continue
candidates.append((wheel.support_index_min(), wheel_name))
if not candidates:
return link
return self._link_for_candidate(link, min(candidates)[1])
class EphemWheelCache(SimpleWheelCache):
"""A SimpleWheelCache that creates it's own temporary cache directory
"""
def __init__(self, format_control):
self._temp_dir = TempDirectory(kind="ephem-wheel-cache")
self._temp_dir.create()
super(EphemWheelCache, self).__init__(
self._temp_dir.path, format_control
)
def cleanup(self):
self._temp_dir.cleanup()
class WheelCache(Cache):
"""Wraps EphemWheelCache and SimpleWheelCache into a single Cache
This Cache allows for gracefully degradation, using the ephem wheel cache
when a certain link is not found in the simple wheel cache first.
"""
def __init__(self, cache_dir, format_control):
super(WheelCache, self).__init__(
cache_dir, format_control, {'binary'}
)
self._wheel_cache = SimpleWheelCache(cache_dir, format_control)
self._ephem_cache = EphemWheelCache(format_control)
def get_path_for_link(self, link):
return self._wheel_cache.get_path_for_link(link)
def get_ephem_path_for_link(self, link):
return self._ephem_cache.get_path_for_link(link)
def get(self, link, package_name):
retval = self._wheel_cache.get(link, package_name)
if retval is link:
retval = self._ephem_cache.get(link, package_name)
return retval
def cleanup(self):
self._wheel_cache.cleanup()
self._ephem_cache.cleanup()
@@ -0,0 +1,609 @@
"""
shared options and groups
The principle here is to define options once, but *not* instantiate them
globally. One reason being that options with action='append' can carry state
between parses. pip parses general options twice internally, and shouldn't
pass on state. To be consistent, all options will follow this design.
"""
from __future__ import absolute_import
import warnings
from functools import partial
from optparse import SUPPRESS_HELP, Option, OptionGroup
from pip._internal.index import (
FormatControl, fmt_ctl_handle_mutual_exclude, fmt_ctl_no_binary,
)
from pip._internal.locations import USER_CACHE_DIR, src_prefix
from pip._internal.models import PyPI
from pip._internal.utils.hashes import STRONG_HASHES
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
from pip._internal.utils.ui import BAR_TYPES
if MYPY_CHECK_RUNNING:
from typing import Any
def make_option_group(group, parser):
"""
Return an OptionGroup object
group -- assumed to be dict with 'name' and 'options' keys
parser -- an optparse Parser
"""
option_group = OptionGroup(parser, group['name'])
for option in group['options']:
option_group.add_option(option())
return option_group
def check_install_build_global(options, check_options=None):
"""Disable wheels if per-setup.py call options are set.
:param options: The OptionParser options to update.
:param check_options: The options to check, if not supplied defaults to
options.
"""
if check_options is None:
check_options = options
def getname(n):
return getattr(check_options, n, None)
names = ["build_options", "global_options", "install_options"]
if any(map(getname, names)):
control = options.format_control
fmt_ctl_no_binary(control)
warnings.warn(
'Disabling all use of wheels due to the use of --build-options '
'/ --global-options / --install-options.', stacklevel=2,
)
###########
# options #
###########
help_ = partial(
Option,
'-h', '--help',
dest='help',
action='help',
help='Show help.',
) # type: Any
isolated_mode = partial(
Option,
"--isolated",
dest="isolated_mode",
action="store_true",
default=False,
help=(
"Run pip in an isolated mode, ignoring environment variables and user "
"configuration."
),
)
require_virtualenv = partial(
Option,
# Run only if inside a virtualenv, bail if not.
'--require-virtualenv', '--require-venv',
dest='require_venv',
action='store_true',
default=False,
help=SUPPRESS_HELP
) # type: Any
verbose = partial(
Option,
'-v', '--verbose',
dest='verbose',
action='count',
default=0,
help='Give more output. Option is additive, and can be used up to 3 times.'
)
no_color = partial(
Option,
'--no-color',
dest='no_color',
action='store_true',
default=False,
help="Suppress colored output",
)
version = partial(
Option,
'-V', '--version',
dest='version',
action='store_true',
help='Show version and exit.',
) # type: Any
quiet = partial(
Option,
'-q', '--quiet',
dest='quiet',
action='count',
default=0,
help=(
'Give less output. Option is additive, and can be used up to 3'
' times (corresponding to WARNING, ERROR, and CRITICAL logging'
' levels).'
),
) # type: Any
progress_bar = partial(
Option,
'--progress-bar',
dest='progress_bar',
type='choice',
choices=list(BAR_TYPES.keys()),
default='on',
help=(
'Specify type of progress to be displayed [' +
'|'.join(BAR_TYPES.keys()) + '] (default: %default)'
),
) # type: Any
log = partial(
Option,
"--log", "--log-file", "--local-log",
dest="log",
metavar="path",
help="Path to a verbose appending log."
) # type: Any
no_input = partial(
Option,
# Don't ask for input
'--no-input',
dest='no_input',
action='store_true',
default=False,
help=SUPPRESS_HELP
) # type: Any
proxy = partial(
Option,
'--proxy',
dest='proxy',
type='str',
default='',
help="Specify a proxy in the form [user:passwd@]proxy.server:port."
) # type: Any
retries = partial(
Option,
'--retries',
dest='retries',
type='int',
default=5,
help="Maximum number of retries each connection should attempt "
"(default %default times).",
) # type: Any
timeout = partial(
Option,
'--timeout', '--default-timeout',
metavar='sec',
dest='timeout',
type='float',
default=15,
help='Set the socket timeout (default %default seconds).',
) # type: Any
skip_requirements_regex = partial(
Option,
# A regex to be used to skip requirements
'--skip-requirements-regex',
dest='skip_requirements_regex',
type='str',
default='',
help=SUPPRESS_HELP,
) # type: Any
def exists_action():
return Option(
# Option when path already exist
'--exists-action',
dest='exists_action',
type='choice',
choices=['s', 'i', 'w', 'b', 'a'],
default=[],
action='append',
metavar='action',
help="Default action when a path already exists: "
"(s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort).",
)
cert = partial(
Option,
'--cert',
dest='cert',
type='str',
metavar='path',
help="Path to alternate CA bundle.",
) # type: Any
client_cert = partial(
Option,
'--client-cert',
dest='client_cert',
type='str',
default=None,
metavar='path',
help="Path to SSL client certificate, a single file containing the "
"private key and the certificate in PEM format.",
) # type: Any
index_url = partial(
Option,
'-i', '--index-url', '--pypi-url',
dest='index_url',
metavar='URL',
default=PyPI.simple_url,
help="Base URL of Python Package Index (default %default). "
"This should point to a repository compliant with PEP 503 "
"(the simple repository API) or a local directory laid out "
"in the same format.",
) # type: Any
def extra_index_url():
return Option(
'--extra-index-url',
dest='extra_index_urls',
metavar='URL',
action='append',
default=[],
help="Extra URLs of package indexes to use in addition to "
"--index-url. Should follow the same rules as "
"--index-url.",
)
no_index = partial(
Option,
'--no-index',
dest='no_index',
action='store_true',
default=False,
help='Ignore package index (only looking at --find-links URLs instead).',
) # type: Any
def find_links():
return Option(
'-f', '--find-links',
dest='find_links',
action='append',
default=[],
metavar='url',
help="If a url or path to an html file, then parse for links to "
"archives. If a local path or file:// url that's a directory, "
"then look for archives in the directory listing.",
)
def trusted_host():
return Option(
"--trusted-host",
dest="trusted_hosts",
action="append",
metavar="HOSTNAME",
default=[],
help="Mark this host as trusted, even though it does not have valid "
"or any HTTPS.",
)
# Remove after 1.5
process_dependency_links = partial(
Option,
"--process-dependency-links",
dest="process_dependency_links",
action="store_true",
default=False,
help="Enable the processing of dependency links.",
) # type: Any
def constraints():
return Option(
'-c', '--constraint',
dest='constraints',
action='append',
default=[],
metavar='file',
help='Constrain versions using the given constraints file. '
'This option can be used multiple times.'
)
def requirements():
return Option(
'-r', '--requirement',
dest='requirements',
action='append',
default=[],
metavar='file',
help='Install from the given requirements file. '
'This option can be used multiple times.'
)
def editable():
return Option(
'-e', '--editable',
dest='editables',
action='append',
default=[],
metavar='path/url',
help=('Install a project in editable mode (i.e. setuptools '
'"develop mode") from a local project path or a VCS url.'),
)
src = partial(
Option,
'--src', '--source', '--source-dir', '--source-directory',
dest='src_dir',
metavar='dir',
default=src_prefix,
help='Directory to check out editable projects into. '
'The default in a virtualenv is "<venv path>/src". '
'The default for global installs is "<current dir>/src".'
) # type: Any
def _get_format_control(values, option):
"""Get a format_control object."""
return getattr(values, option.dest)
def _handle_no_binary(option, opt_str, value, parser):
existing = getattr(parser.values, option.dest)
fmt_ctl_handle_mutual_exclude(
value, existing.no_binary, existing.only_binary,
)
def _handle_only_binary(option, opt_str, value, parser):
existing = getattr(parser.values, option.dest)
fmt_ctl_handle_mutual_exclude(
value, existing.only_binary, existing.no_binary,
)
def no_binary():
return Option(
"--no-binary", dest="format_control", action="callback",
callback=_handle_no_binary, type="str",
default=FormatControl(set(), set()),
help="Do not use binary packages. Can be supplied multiple times, and "
"each time adds to the existing value. Accepts either :all: to "
"disable all binary packages, :none: to empty the set, or one or "
"more package names with commas between them. Note that some "
"packages are tricky to compile and may fail to install when "
"this option is used on them.",
)
def only_binary():
return Option(
"--only-binary", dest="format_control", action="callback",
callback=_handle_only_binary, type="str",
default=FormatControl(set(), set()),
help="Do not use source packages. Can be supplied multiple times, and "
"each time adds to the existing value. Accepts either :all: to "
"disable all source packages, :none: to empty the set, or one or "
"more package names with commas between them. Packages without "
"binary distributions will fail to install when this option is "
"used on them.",
)
cache_dir = partial(
Option,
"--cache-dir",
dest="cache_dir",
default=USER_CACHE_DIR,
metavar="dir",
help="Store the cache data in <dir>."
)
no_cache = partial(
Option,
"--no-cache-dir",
dest="cache_dir",
action="store_false",
help="Disable the cache.",
)
no_deps = partial(
Option,
'--no-deps', '--no-dependencies',
dest='ignore_dependencies',
action='store_true',
default=False,
help="Don't install package dependencies.",
) # type: Any
build_dir = partial(
Option,
'-b', '--build', '--build-dir', '--build-directory',
dest='build_dir',
metavar='dir',
help='Directory to unpack packages into and build in. Note that '
'an initial build still takes place in a temporary directory. '
'The location of temporary directories can be controlled by setting '
'the TMPDIR environment variable (TEMP on Windows) appropriately. '
'When passed, build directories are not cleaned in case of failures.'
) # type: Any
ignore_requires_python = partial(
Option,
'--ignore-requires-python',
dest='ignore_requires_python',
action='store_true',
help='Ignore the Requires-Python information.'
) # type: Any
no_build_isolation = partial(
Option,
'--no-build-isolation',
dest='build_isolation',
action='store_false',
default=True,
help='Disable isolation when building a modern source distribution. '
'Build dependencies specified by PEP 518 must be already installed '
'if this option is used.'
) # type: Any
install_options = partial(
Option,
'--install-option',
dest='install_options',
action='append',
metavar='options',
help="Extra arguments to be supplied to the setup.py install "
"command (use like --install-option=\"--install-scripts=/usr/local/"
"bin\"). Use multiple --install-option options to pass multiple "
"options to setup.py install. If you are using an option with a "
"directory path, be sure to use absolute path.",
) # type: Any
global_options = partial(
Option,
'--global-option',
dest='global_options',
action='append',
metavar='options',
help="Extra global options to be supplied to the setup.py "
"call before the install command.",
) # type: Any
no_clean = partial(
Option,
'--no-clean',
action='store_true',
default=False,
help="Don't clean up build directories)."
) # type: Any
pre = partial(
Option,
'--pre',
action='store_true',
default=False,
help="Include pre-release and development versions. By default, "
"pip only finds stable versions.",
) # type: Any
disable_pip_version_check = partial(
Option,
"--disable-pip-version-check",
dest="disable_pip_version_check",
action="store_true",
default=False,
help="Don't periodically check PyPI to determine whether a new version "
"of pip is available for download. Implied with --no-index.",
) # type: Any
# Deprecated, Remove later
always_unzip = partial(
Option,
'-Z', '--always-unzip',
dest='always_unzip',
action='store_true',
help=SUPPRESS_HELP,
) # type: Any
def _merge_hash(option, opt_str, value, parser):
"""Given a value spelled "algo:digest", append the digest to a list
pointed to in a dict by the algo name."""
if not parser.values.hashes:
parser.values.hashes = {}
try:
algo, digest = value.split(':', 1)
except ValueError:
parser.error('Arguments to %s must be a hash name '
'followed by a value, like --hash=sha256:abcde...' %
opt_str)
if algo not in STRONG_HASHES:
parser.error('Allowed hash algorithms for %s are %s.' %
(opt_str, ', '.join(STRONG_HASHES)))
parser.values.hashes.setdefault(algo, []).append(digest)
hash = partial(
Option,
'--hash',
# Hash values eventually end up in InstallRequirement.hashes due to
# __dict__ copying in process_line().
dest='hashes',
action='callback',
callback=_merge_hash,
type='string',
help="Verify that the package's archive matches this "
'hash before installing. Example: --hash=sha256:abcdef...',
) # type: Any
require_hashes = partial(
Option,
'--require-hashes',
dest='require_hashes',
action='store_true',
default=False,
help='Require a hash to check each requirement against, for '
'repeatable installs. This option is implied when any package in a '
'requirements file has a --hash option.',
) # type: Any
##########
# groups #
##########
general_group = {
'name': 'General Options',
'options': [
help_,
isolated_mode,
require_virtualenv,
verbose,
version,
quiet,
log,
no_input,
proxy,
retries,
timeout,
skip_requirements_regex,
exists_action,
trusted_host,
cert,
client_cert,
cache_dir,
no_cache,
disable_pip_version_check,
no_color,
]
}
index_group = {
'name': 'Package Index Options',
'options': [
index_url,
extra_index_url,
no_index,
find_links,
process_dependency_links,
]
}
@@ -0,0 +1,79 @@
"""
Package containing all pip commands
"""
from __future__ import absolute_import
from pip._internal.commands.completion import CompletionCommand
from pip._internal.commands.configuration import ConfigurationCommand
from pip._internal.commands.download import DownloadCommand
from pip._internal.commands.freeze import FreezeCommand
from pip._internal.commands.hash import HashCommand
from pip._internal.commands.help import HelpCommand
from pip._internal.commands.list import ListCommand
from pip._internal.commands.check import CheckCommand
from pip._internal.commands.search import SearchCommand
from pip._internal.commands.show import ShowCommand
from pip._internal.commands.install import InstallCommand
from pip._internal.commands.uninstall import UninstallCommand
from pip._internal.commands.wheel import WheelCommand
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import List, Type
from pip._internal.basecommand import Command
commands_order = [
InstallCommand,
DownloadCommand,
UninstallCommand,
FreezeCommand,
ListCommand,
ShowCommand,
CheckCommand,
ConfigurationCommand,
SearchCommand,
WheelCommand,
HashCommand,
CompletionCommand,
HelpCommand,
] # type: List[Type[Command]]
commands_dict = {c.name: c for c in commands_order}
def get_summaries(ordered=True):
"""Yields sorted (command name, command summary) tuples."""
if ordered:
cmditems = _sort_commands(commands_dict, commands_order)
else:
cmditems = commands_dict.items()
for name, command_class in cmditems:
yield (name, command_class.summary)
def get_similar_commands(name):
"""Command name auto-correct."""
from difflib import get_close_matches
name = name.lower()
close_commands = get_close_matches(name, commands_dict.keys())
if close_commands:
return close_commands[0]
else:
return False
def _sort_commands(cmddict, order):
def keyfn(key):
try:
return order.index(key[1])
except ValueError:
# unordered items should come last
return 0xff
return sorted(cmddict.items(), key=keyfn)
@@ -0,0 +1,42 @@
import logging
from pip._internal.basecommand import Command
from pip._internal.operations.check import (
check_package_set, create_package_set_from_installed,
)
from pip._internal.utils.misc import get_installed_distributions
logger = logging.getLogger(__name__)
class CheckCommand(Command):
"""Verify installed packages have compatible dependencies."""
name = 'check'
usage = """
%prog [options]"""
summary = 'Verify installed packages have compatible dependencies.'
def run(self, options, args):
package_set = create_package_set_from_installed()
missing, conflicting = check_package_set(package_set)
for project_name in missing:
version = package_set[project_name].version
for dependency in missing[project_name]:
logger.info(
"%s %s requires %s, which is not installed.",
project_name, version, dependency[0],
)
for project_name in conflicting:
version = package_set[project_name].version
for dep_name, dep_version, req in conflicting[project_name]:
logger.info(
"%s %s has requirement %s, but you have %s %s.",
project_name, version, req, dep_name, dep_version,
)
if missing or conflicting:
return 1
else:
logger.info("No broken requirements found.")
@@ -0,0 +1,94 @@
from __future__ import absolute_import
import sys
import textwrap
from pip._internal.basecommand import Command
from pip._internal.utils.misc import get_prog
BASE_COMPLETION = """
# pip %(shell)s completion start%(script)s# pip %(shell)s completion end
"""
COMPLETION_SCRIPTS = {
'bash': """
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\
COMP_CWORD=$COMP_CWORD \\
PIP_AUTO_COMPLETE=1 $1 ) )
}
complete -o default -F _pip_completion %(prog)s
""",
'zsh': """
function _pip_completion {
local words cword
read -Ac words
read -cn cword
reply=( $( COMP_WORDS="$words[*]" \\
COMP_CWORD=$(( cword-1 )) \\
PIP_AUTO_COMPLETE=1 $words[1] ) )
}
compctl -K _pip_completion %(prog)s
""",
'fish': """
function __fish_complete_pip
set -lx COMP_WORDS (commandline -o) ""
set -lx COMP_CWORD ( \\
math (contains -i -- (commandline -t) $COMP_WORDS)-1 \\
)
set -lx PIP_AUTO_COMPLETE 1
string split \\ -- (eval $COMP_WORDS[1])
end
complete -fa "(__fish_complete_pip)" -c %(prog)s
""",
}
class CompletionCommand(Command):
"""A helper command to be used for command completion."""
name = 'completion'
summary = 'A helper command used for command completion.'
ignore_require_venv = True
def __init__(self, *args, **kw):
super(CompletionCommand, self).__init__(*args, **kw)
cmd_opts = self.cmd_opts
cmd_opts.add_option(
'--bash', '-b',
action='store_const',
const='bash',
dest='shell',
help='Emit completion code for bash')
cmd_opts.add_option(
'--zsh', '-z',
action='store_const',
const='zsh',
dest='shell',
help='Emit completion code for zsh')
cmd_opts.add_option(
'--fish', '-f',
action='store_const',
const='fish',
dest='shell',
help='Emit completion code for fish')
self.parser.insert_option_group(0, cmd_opts)
def run(self, options, args):
"""Prints the completion code of the given shell"""
shells = COMPLETION_SCRIPTS.keys()
shell_options = ['--' + shell for shell in sorted(shells)]
if options.shell in shells:
script = textwrap.dedent(
COMPLETION_SCRIPTS.get(options.shell, '') % {
'prog': get_prog(),
}
)
print(BASE_COMPLETION % {'script': script, 'shell': options.shell})
else:
sys.stderr.write(
'ERROR: You must pass %s\n' % ' or '.join(shell_options)
)
@@ -0,0 +1,227 @@
import logging
import os
import subprocess
from pip._internal.basecommand import Command
from pip._internal.configuration import Configuration, kinds
from pip._internal.exceptions import PipError
from pip._internal.locations import venv_config_file
from pip._internal.status_codes import ERROR, SUCCESS
from pip._internal.utils.misc import get_prog
logger = logging.getLogger(__name__)
class ConfigurationCommand(Command):
"""Manage local and global configuration.
Subcommands:
list: List the active configuration (or from the file specified)
edit: Edit the configuration file in an editor
get: Get the value associated with name
set: Set the name=value
unset: Unset the value associated with name
If none of --user, --global and --venv are passed, a virtual
environment configuration file is used if one is active and the file
exists. Otherwise, all modifications happen on the to the user file by
default.
"""
name = 'config'
usage = """
%prog [<file-option>] list
%prog [<file-option>] [--editor <editor-path>] edit
%prog [<file-option>] get name
%prog [<file-option>] set name value
%prog [<file-option>] unset name
"""
summary = "Manage local and global configuration."
def __init__(self, *args, **kwargs):
super(ConfigurationCommand, self).__init__(*args, **kwargs)
self.configuration = None
self.cmd_opts.add_option(
'--editor',
dest='editor',
action='store',
default=None,
help=(
'Editor to use to edit the file. Uses VISUAL or EDITOR '
'environment variables if not provided.'
)
)
self.cmd_opts.add_option(
'--global',
dest='global_file',
action='store_true',
default=False,
help='Use the system-wide configuration file only'
)
self.cmd_opts.add_option(
'--user',
dest='user_file',
action='store_true',
default=False,
help='Use the user configuration file only'
)
self.cmd_opts.add_option(
'--venv',
dest='venv_file',
action='store_true',
default=False,
help='Use the virtualenv configuration file only'
)
self.parser.insert_option_group(0, self.cmd_opts)
def run(self, options, args):
handlers = {
"list": self.list_values,
"edit": self.open_in_editor,
"get": self.get_name,
"set": self.set_name_value,
"unset": self.unset_name
}
# Determine action
if not args or args[0] not in handlers:
logger.error("Need an action ({}) to perform.".format(
", ".join(sorted(handlers)))
)
return ERROR
action = args[0]
# Determine which configuration files are to be loaded
# Depends on whether the command is modifying.
try:
load_only = self._determine_file(
options, need_value=(action in ["get", "set", "unset", "edit"])
)
except PipError as e:
logger.error(e.args[0])
return ERROR
# Load a new configuration
self.configuration = Configuration(
isolated=options.isolated_mode, load_only=load_only
)
self.configuration.load()
# Error handling happens here, not in the action-handlers.
try:
handlers[action](options, args[1:])
except PipError as e:
logger.error(e.args[0])
return ERROR
return SUCCESS
def _determine_file(self, options, need_value):
file_options = {
kinds.USER: options.user_file,
kinds.GLOBAL: options.global_file,
kinds.VENV: options.venv_file
}
if sum(file_options.values()) == 0:
if not need_value:
return None
# Default to user, unless there's a virtualenv file.
elif os.path.exists(venv_config_file):
return kinds.VENV
else:
return kinds.USER
elif sum(file_options.values()) == 1:
# There's probably a better expression for this.
return [key for key in file_options if file_options[key]][0]
raise PipError(
"Need exactly one file to operate upon "
"(--user, --venv, --global) to perform."
)
def list_values(self, options, args):
self._get_n_args(args, "list", n=0)
for key, value in sorted(self.configuration.items()):
logger.info("%s=%r", key, value)
def get_name(self, options, args):
key = self._get_n_args(args, "get [name]", n=1)
value = self.configuration.get_value(key)
logger.info("%s", value)
def set_name_value(self, options, args):
key, value = self._get_n_args(args, "set [name] [value]", n=2)
self.configuration.set_value(key, value)
self._save_configuration()
def unset_name(self, options, args):
key = self._get_n_args(args, "unset [name]", n=1)
self.configuration.unset_value(key)
self._save_configuration()
def open_in_editor(self, options, args):
editor = self._determine_editor(options)
fname = self.configuration.get_file_to_edit()
if fname is None:
raise PipError("Could not determine appropriate file.")
try:
subprocess.check_call([editor, fname])
except subprocess.CalledProcessError as e:
raise PipError(
"Editor Subprocess exited with exit code {}"
.format(e.returncode)
)
def _get_n_args(self, args, example, n):
"""Helper to make sure the command got the right number of arguments
"""
if len(args) != n:
msg = (
'Got unexpected number of arguments, expected {}. '
'(example: "{} config {}")'
).format(n, get_prog(), example)
raise PipError(msg)
if n == 1:
return args[0]
else:
return args
def _save_configuration(self):
# We successfully ran a modifying command. Need to save the
# configuration.
try:
self.configuration.save()
except Exception:
logger.error(
"Unable to save configuration. Please report this as a bug.",
exc_info=1
)
raise PipError("Internal Error.")
def _determine_editor(self, options):
if options.editor is not None:
return options.editor
elif "VISUAL" in os.environ:
return os.environ["VISUAL"]
elif "EDITOR" in os.environ:
return os.environ["EDITOR"]
else:
raise PipError("Could not determine editor to use.")
@@ -0,0 +1,233 @@
from __future__ import absolute_import
import logging
import os
from pip._internal import cmdoptions
from pip._internal.basecommand import RequirementCommand
from pip._internal.exceptions import CommandError
from pip._internal.index import FormatControl
from pip._internal.operations.prepare import RequirementPreparer
from pip._internal.req import RequirementSet
from pip._internal.resolve import Resolver
from pip._internal.utils.filesystem import check_path_owner
from pip._internal.utils.misc import ensure_dir, normalize_path
from pip._internal.utils.temp_dir import TempDirectory
logger = logging.getLogger(__name__)
class DownloadCommand(RequirementCommand):
"""
Download packages from:
- PyPI (and other indexes) using requirement specifiers.
- VCS project urls.
- Local project directories.
- Local or remote source archives.
pip also supports downloading from "requirements files", which provide
an easy way to specify a whole environment to be downloaded.
"""
name = 'download'
usage = """
%prog [options] <requirement specifier> [package-index-options] ...
%prog [options] -r <requirements file> [package-index-options] ...
%prog [options] <vcs project url> ...
%prog [options] <local project path> ...
%prog [options] <archive url/path> ..."""
summary = 'Download packages.'
def __init__(self, *args, **kw):
super(DownloadCommand, self).__init__(*args, **kw)
cmd_opts = self.cmd_opts
cmd_opts.add_option(cmdoptions.constraints())
cmd_opts.add_option(cmdoptions.requirements())
cmd_opts.add_option(cmdoptions.build_dir())
cmd_opts.add_option(cmdoptions.no_deps())
cmd_opts.add_option(cmdoptions.global_options())
cmd_opts.add_option(cmdoptions.no_binary())
cmd_opts.add_option(cmdoptions.only_binary())
cmd_opts.add_option(cmdoptions.src())
cmd_opts.add_option(cmdoptions.pre())
cmd_opts.add_option(cmdoptions.no_clean())
cmd_opts.add_option(cmdoptions.require_hashes())
cmd_opts.add_option(cmdoptions.progress_bar())
cmd_opts.add_option(cmdoptions.no_build_isolation())
cmd_opts.add_option(
'-d', '--dest', '--destination-dir', '--destination-directory',
dest='download_dir',
metavar='dir',
default=os.curdir,
help=("Download packages into <dir>."),
)
cmd_opts.add_option(
'--platform',
dest='platform',
metavar='platform',
default=None,
help=("Only download wheels compatible with <platform>. "
"Defaults to the platform of the running system."),
)
cmd_opts.add_option(
'--python-version',
dest='python_version',
metavar='python_version',
default=None,
help=("Only download wheels compatible with Python "
"interpreter version <version>. If not specified, then the "
"current system interpreter minor version is used. A major "
"version (e.g. '2') can be specified to match all "
"minor revs of that major version. A minor version "
"(e.g. '34') can also be specified."),
)
cmd_opts.add_option(
'--implementation',
dest='implementation',
metavar='implementation',
default=None,
help=("Only download wheels compatible with Python "
"implementation <implementation>, e.g. 'pp', 'jy', 'cp', "
" or 'ip'. If not specified, then the current "
"interpreter implementation is used. Use 'py' to force "
"implementation-agnostic wheels."),
)
cmd_opts.add_option(
'--abi',
dest='abi',
metavar='abi',
default=None,
help=("Only download wheels compatible with Python "
"abi <abi>, e.g. 'pypy_41'. If not specified, then the "
"current interpreter abi tag is used. Generally "
"you will need to specify --implementation, "
"--platform, and --python-version when using "
"this option."),
)
index_opts = cmdoptions.make_option_group(
cmdoptions.index_group,
self.parser,
)
self.parser.insert_option_group(0, index_opts)
self.parser.insert_option_group(0, cmd_opts)
def run(self, options, args):
options.ignore_installed = True
# editable doesn't really make sense for `pip download`, but the bowels
# of the RequirementSet code require that property.
options.editables = []
if options.python_version:
python_versions = [options.python_version]
else:
python_versions = None
dist_restriction_set = any([
options.python_version,
options.platform,
options.abi,
options.implementation,
])
binary_only = FormatControl(set(), {':all:'})
no_sdist_dependencies = (
options.format_control != binary_only and
not options.ignore_dependencies
)
if dist_restriction_set and no_sdist_dependencies:
raise CommandError(
"When restricting platform and interpreter constraints using "
"--python-version, --platform, --abi, or --implementation, "
"either --no-deps must be set, or --only-binary=:all: must be "
"set and --no-binary must not be set (or must be set to "
":none:)."
)
options.src_dir = os.path.abspath(options.src_dir)
options.download_dir = normalize_path(options.download_dir)
ensure_dir(options.download_dir)
with self._build_session(options) as session:
finder = self._build_package_finder(
options=options,
session=session,
platform=options.platform,
python_versions=python_versions,
abi=options.abi,
implementation=options.implementation,
)
build_delete = (not (options.no_clean or options.build_dir))
if options.cache_dir and not check_path_owner(options.cache_dir):
logger.warning(
"The directory '%s' or its parent directory is not owned "
"by the current user and caching wheels has been "
"disabled. check the permissions and owner of that "
"directory. If executing pip with sudo, you may want "
"sudo's -H flag.",
options.cache_dir,
)
options.cache_dir = None
with TempDirectory(
options.build_dir, delete=build_delete, kind="download"
) as directory:
requirement_set = RequirementSet(
require_hashes=options.require_hashes,
)
self.populate_requirement_set(
requirement_set,
args,
options,
finder,
session,
self.name,
None
)
preparer = RequirementPreparer(
build_dir=directory.path,
src_dir=options.src_dir,
download_dir=options.download_dir,
wheel_download_dir=None,
progress_bar=options.progress_bar,
build_isolation=options.build_isolation,
)
resolver = Resolver(
preparer=preparer,
finder=finder,
session=session,
wheel_cache=None,
use_user_site=False,
upgrade_strategy="to-satisfy-only",
force_reinstall=False,
ignore_dependencies=options.ignore_dependencies,
ignore_requires_python=False,
ignore_installed=True,
isolated=options.isolated_mode,
)
resolver.resolve(requirement_set)
downloaded = ' '.join([
req.name for req in requirement_set.successfully_downloaded
])
if downloaded:
logger.info('Successfully downloaded %s', downloaded)
# Clean up
if not options.no_clean:
requirement_set.cleanup_files()
return requirement_set
@@ -0,0 +1,96 @@
from __future__ import absolute_import
import sys
from pip._internal import index
from pip._internal.basecommand import Command
from pip._internal.cache import WheelCache
from pip._internal.compat import stdlib_pkgs
from pip._internal.operations.freeze import freeze
DEV_PKGS = {'pip', 'setuptools', 'distribute', 'wheel'}
class FreezeCommand(Command):
"""
Output installed packages in requirements format.
packages are listed in a case-insensitive sorted order.
"""
name = 'freeze'
usage = """
%prog [options]"""
summary = 'Output installed packages in requirements format.'
log_streams = ("ext://sys.stderr", "ext://sys.stderr")
def __init__(self, *args, **kw):
super(FreezeCommand, self).__init__(*args, **kw)
self.cmd_opts.add_option(
'-r', '--requirement',
dest='requirements',
action='append',
default=[],
metavar='file',
help="Use the order in the given requirements file and its "
"comments when generating output. This option can be "
"used multiple times.")
self.cmd_opts.add_option(
'-f', '--find-links',
dest='find_links',
action='append',
default=[],
metavar='URL',
help='URL for finding packages, which will be added to the '
'output.')
self.cmd_opts.add_option(
'-l', '--local',
dest='local',
action='store_true',
default=False,
help='If in a virtualenv that has global access, do not output '
'globally-installed packages.')
self.cmd_opts.add_option(
'--user',
dest='user',
action='store_true',
default=False,
help='Only output packages installed in user-site.')
self.cmd_opts.add_option(
'--all',
dest='freeze_all',
action='store_true',
help='Do not skip these packages in the output:'
' %s' % ', '.join(DEV_PKGS))
self.cmd_opts.add_option(
'--exclude-editable',
dest='exclude_editable',
action='store_true',
help='Exclude editable package from output.')
self.parser.insert_option_group(0, self.cmd_opts)
def run(self, options, args):
format_control = index.FormatControl(set(), set())
wheel_cache = WheelCache(options.cache_dir, format_control)
skip = set(stdlib_pkgs)
if not options.freeze_all:
skip.update(DEV_PKGS)
freeze_kwargs = dict(
requirement=options.requirements,
find_links=options.find_links,
local_only=options.local,
user_only=options.user,
skip_regex=options.skip_requirements_regex,
isolated=options.isolated_mode,
wheel_cache=wheel_cache,
skip=skip,
exclude_editable=options.exclude_editable,
)
try:
for line in freeze(**freeze_kwargs):
sys.stdout.write(line + '\n')
finally:
wheel_cache.cleanup()
@@ -0,0 +1,57 @@
from __future__ import absolute_import
import hashlib
import logging
import sys
from pip._internal.basecommand import Command
from pip._internal.status_codes import ERROR
from pip._internal.utils.hashes import FAVORITE_HASH, STRONG_HASHES
from pip._internal.utils.misc import read_chunks
logger = logging.getLogger(__name__)
class HashCommand(Command):
"""
Compute a hash of a local package archive.
These can be used with --hash in a requirements file to do repeatable
installs.
"""
name = 'hash'
usage = '%prog [options] <file> ...'
summary = 'Compute hashes of package archives.'
ignore_require_venv = True
def __init__(self, *args, **kw):
super(HashCommand, self).__init__(*args, **kw)
self.cmd_opts.add_option(
'-a', '--algorithm',
dest='algorithm',
choices=STRONG_HASHES,
action='store',
default=FAVORITE_HASH,
help='The hash algorithm to use: one of %s' %
', '.join(STRONG_HASHES))
self.parser.insert_option_group(0, self.cmd_opts)
def run(self, options, args):
if not args:
self.parser.print_usage(sys.stderr)
return ERROR
algorithm = options.algorithm
for path in args:
logger.info('%s:\n--hash=%s:%s',
path, algorithm, _hash_of_file(path, algorithm))
def _hash_of_file(path, algorithm):
"""Return the hash digest of a file."""
with open(path, 'rb') as archive:
hash = hashlib.new(algorithm)
for chunk in read_chunks(archive):
hash.update(chunk)
return hash.hexdigest()
@@ -0,0 +1,36 @@
from __future__ import absolute_import
from pip._internal.basecommand import SUCCESS, Command
from pip._internal.exceptions import CommandError
class HelpCommand(Command):
"""Show help for commands"""
name = 'help'
usage = """
%prog <command>"""
summary = 'Show help for commands.'
ignore_require_venv = True
def run(self, options, args):
from pip._internal.commands import commands_dict, get_similar_commands
try:
# 'pip help' with no args is handled by pip.__init__.parseopt()
cmd_name = args[0] # the command we need help for
except IndexError:
return SUCCESS
if cmd_name not in commands_dict:
guess = get_similar_commands(cmd_name)
msg = ['unknown command "%s"' % cmd_name]
if guess:
msg.append('maybe you meant "%s"' % guess)
raise CommandError(' - '.join(msg))
command = commands_dict[cmd_name]()
command.parser.print_help()
return SUCCESS
@@ -0,0 +1,502 @@
from __future__ import absolute_import
import errno
import logging
import operator
import os
import shutil
from optparse import SUPPRESS_HELP
from pip._internal import cmdoptions
from pip._internal.basecommand import RequirementCommand
from pip._internal.cache import WheelCache
from pip._internal.exceptions import (
CommandError, InstallationError, PreviousBuildDirError,
)
from pip._internal.locations import distutils_scheme, virtualenv_no_global
from pip._internal.operations.check import check_install_conflicts
from pip._internal.operations.prepare import RequirementPreparer
from pip._internal.req import RequirementSet, install_given_reqs
from pip._internal.resolve import Resolver
from pip._internal.status_codes import ERROR
from pip._internal.utils.filesystem import check_path_owner
from pip._internal.utils.misc import ensure_dir, get_installed_version
from pip._internal.utils.temp_dir import TempDirectory
from pip._internal.wheel import WheelBuilder
try:
import wheel
except ImportError:
wheel = None
logger = logging.getLogger(__name__)
class InstallCommand(RequirementCommand):
"""
Install packages from:
- PyPI (and other indexes) using requirement specifiers.
- VCS project urls.
- Local project directories.
- Local or remote source archives.
pip also supports installing from "requirements files", which provide
an easy way to specify a whole environment to be installed.
"""
name = 'install'
usage = """
%prog [options] <requirement specifier> [package-index-options] ...
%prog [options] -r <requirements file> [package-index-options] ...
%prog [options] [-e] <vcs project url> ...
%prog [options] [-e] <local project path> ...
%prog [options] <archive url/path> ..."""
summary = 'Install packages.'
def __init__(self, *args, **kw):
super(InstallCommand, self).__init__(*args, **kw)
cmd_opts = self.cmd_opts
cmd_opts.add_option(cmdoptions.requirements())
cmd_opts.add_option(cmdoptions.constraints())
cmd_opts.add_option(cmdoptions.no_deps())
cmd_opts.add_option(cmdoptions.pre())
cmd_opts.add_option(cmdoptions.editable())
cmd_opts.add_option(
'-t', '--target',
dest='target_dir',
metavar='dir',
default=None,
help='Install packages into <dir>. '
'By default this will not replace existing files/folders in '
'<dir>. Use --upgrade to replace existing packages in <dir> '
'with new versions.'
)
cmd_opts.add_option(
'--user',
dest='use_user_site',
action='store_true',
help="Install to the Python user install directory for your "
"platform. Typically ~/.local/, or %APPDATA%\\Python on "
"Windows. (See the Python documentation for site.USER_BASE "
"for full details.)")
cmd_opts.add_option(
'--no-user',
dest='use_user_site',
action='store_false',
help=SUPPRESS_HELP)
cmd_opts.add_option(
'--root',
dest='root_path',
metavar='dir',
default=None,
help="Install everything relative to this alternate root "
"directory.")
cmd_opts.add_option(
'--prefix',
dest='prefix_path',
metavar='dir',
default=None,
help="Installation prefix where lib, bin and other top-level "
"folders are placed")
cmd_opts.add_option(cmdoptions.build_dir())
cmd_opts.add_option(cmdoptions.src())
cmd_opts.add_option(
'-U', '--upgrade',
dest='upgrade',
action='store_true',
help='Upgrade all specified packages to the newest available '
'version. The handling of dependencies depends on the '
'upgrade-strategy used.'
)
cmd_opts.add_option(
'--upgrade-strategy',
dest='upgrade_strategy',
default='only-if-needed',
choices=['only-if-needed', 'eager'],
help='Determines how dependency upgrading should be handled '
'[default: %default]. '
'"eager" - dependencies are upgraded regardless of '
'whether the currently installed version satisfies the '
'requirements of the upgraded package(s). '
'"only-if-needed" - are upgraded only when they do not '
'satisfy the requirements of the upgraded package(s).'
)
cmd_opts.add_option(
'--force-reinstall',
dest='force_reinstall',
action='store_true',
help='Reinstall all packages even if they are already '
'up-to-date.')
cmd_opts.add_option(
'-I', '--ignore-installed',
dest='ignore_installed',
action='store_true',
help='Ignore the installed packages (reinstalling instead).')
cmd_opts.add_option(cmdoptions.ignore_requires_python())
cmd_opts.add_option(cmdoptions.no_build_isolation())
cmd_opts.add_option(cmdoptions.install_options())
cmd_opts.add_option(cmdoptions.global_options())
cmd_opts.add_option(
"--compile",
action="store_true",
dest="compile",
default=True,
help="Compile Python source files to bytecode",
)
cmd_opts.add_option(
"--no-compile",
action="store_false",
dest="compile",
help="Do not compile Python source files to bytecode",
)
cmd_opts.add_option(
"--no-warn-script-location",
action="store_false",
dest="warn_script_location",
default=True,
help="Do not warn when installing scripts outside PATH",
)
cmd_opts.add_option(
"--no-warn-conflicts",
action="store_false",
dest="warn_about_conflicts",
default=True,
help="Do not warn about broken dependencies",
)
cmd_opts.add_option(cmdoptions.no_binary())
cmd_opts.add_option(cmdoptions.only_binary())
cmd_opts.add_option(cmdoptions.no_clean())
cmd_opts.add_option(cmdoptions.require_hashes())
cmd_opts.add_option(cmdoptions.progress_bar())
index_opts = cmdoptions.make_option_group(
cmdoptions.index_group,
self.parser,
)
self.parser.insert_option_group(0, index_opts)
self.parser.insert_option_group(0, cmd_opts)
def run(self, options, args):
cmdoptions.check_install_build_global(options)
upgrade_strategy = "to-satisfy-only"
if options.upgrade:
upgrade_strategy = options.upgrade_strategy
if options.build_dir:
options.build_dir = os.path.abspath(options.build_dir)
options.src_dir = os.path.abspath(options.src_dir)
install_options = options.install_options or []
if options.use_user_site:
if options.prefix_path:
raise CommandError(
"Can not combine '--user' and '--prefix' as they imply "
"different installation locations"
)
if virtualenv_no_global():
raise InstallationError(
"Can not perform a '--user' install. User site-packages "
"are not visible in this virtualenv."
)
install_options.append('--user')
install_options.append('--prefix=')
target_temp_dir = TempDirectory(kind="target")
if options.target_dir:
options.ignore_installed = True
options.target_dir = os.path.abspath(options.target_dir)
if (os.path.exists(options.target_dir) and not
os.path.isdir(options.target_dir)):
raise CommandError(
"Target path exists but is not a directory, will not "
"continue."
)
# Create a target directory for using with the target option
target_temp_dir.create()
install_options.append('--home=' + target_temp_dir.path)
global_options = options.global_options or []
with self._build_session(options) as session:
finder = self._build_package_finder(options, session)
build_delete = (not (options.no_clean or options.build_dir))
wheel_cache = WheelCache(options.cache_dir, options.format_control)
if options.cache_dir and not check_path_owner(options.cache_dir):
logger.warning(
"The directory '%s' or its parent directory is not owned "
"by the current user and caching wheels has been "
"disabled. check the permissions and owner of that "
"directory. If executing pip with sudo, you may want "
"sudo's -H flag.",
options.cache_dir,
)
options.cache_dir = None
with TempDirectory(
options.build_dir, delete=build_delete, kind="install"
) as directory:
requirement_set = RequirementSet(
require_hashes=options.require_hashes,
)
try:
self.populate_requirement_set(
requirement_set, args, options, finder, session,
self.name, wheel_cache
)
preparer = RequirementPreparer(
build_dir=directory.path,
src_dir=options.src_dir,
download_dir=None,
wheel_download_dir=None,
progress_bar=options.progress_bar,
build_isolation=options.build_isolation,
)
resolver = Resolver(
preparer=preparer,
finder=finder,
session=session,
wheel_cache=wheel_cache,
use_user_site=options.use_user_site,
upgrade_strategy=upgrade_strategy,
force_reinstall=options.force_reinstall,
ignore_dependencies=options.ignore_dependencies,
ignore_requires_python=options.ignore_requires_python,
ignore_installed=options.ignore_installed,
isolated=options.isolated_mode,
)
resolver.resolve(requirement_set)
# If caching is disabled or wheel is not installed don't
# try to build wheels.
if wheel and options.cache_dir:
# build wheels before install.
wb = WheelBuilder(
finder, preparer, wheel_cache,
build_options=[], global_options=[],
)
# Ignore the result: a failed wheel will be
# installed from the sdist/vcs whatever.
wb.build(
requirement_set.requirements.values(),
session=session, autobuilding=True
)
to_install = resolver.get_installation_order(
requirement_set
)
# Consistency Checking of the package set we're installing.
should_warn_about_conflicts = (
not options.ignore_dependencies and
options.warn_about_conflicts
)
if should_warn_about_conflicts:
self._warn_about_conflicts(to_install)
# Don't warn about script install locations if
# --target has been specified
warn_script_location = options.warn_script_location
if options.target_dir:
warn_script_location = False
installed = install_given_reqs(
to_install,
install_options,
global_options,
root=options.root_path,
home=target_temp_dir.path,
prefix=options.prefix_path,
pycompile=options.compile,
warn_script_location=warn_script_location,
use_user_site=options.use_user_site,
)
possible_lib_locations = get_lib_location_guesses(
user=options.use_user_site,
home=target_temp_dir.path,
root=options.root_path,
prefix=options.prefix_path,
isolated=options.isolated_mode,
)
reqs = sorted(installed, key=operator.attrgetter('name'))
items = []
for req in reqs:
item = req.name
try:
installed_version = get_installed_version(
req.name, possible_lib_locations
)
if installed_version:
item += '-' + installed_version
except Exception:
pass
items.append(item)
installed = ' '.join(items)
if installed:
logger.info('Successfully installed %s', installed)
except EnvironmentError as error:
show_traceback = (self.verbosity >= 1)
message = create_env_error_message(
error, show_traceback, options.use_user_site,
)
logger.error(message, exc_info=show_traceback)
return ERROR
except PreviousBuildDirError:
options.no_clean = True
raise
finally:
# Clean up
if not options.no_clean:
requirement_set.cleanup_files()
wheel_cache.cleanup()
if options.target_dir:
self._handle_target_dir(
options.target_dir, target_temp_dir, options.upgrade
)
return requirement_set
def _handle_target_dir(self, target_dir, target_temp_dir, upgrade):
ensure_dir(target_dir)
# Checking both purelib and platlib directories for installed
# packages to be moved to target directory
lib_dir_list = []
with target_temp_dir:
# Checking both purelib and platlib directories for installed
# packages to be moved to target directory
scheme = distutils_scheme('', home=target_temp_dir.path)
purelib_dir = scheme['purelib']
platlib_dir = scheme['platlib']
data_dir = scheme['data']
if os.path.exists(purelib_dir):
lib_dir_list.append(purelib_dir)
if os.path.exists(platlib_dir) and platlib_dir != purelib_dir:
lib_dir_list.append(platlib_dir)
if os.path.exists(data_dir):
lib_dir_list.append(data_dir)
for lib_dir in lib_dir_list:
for item in os.listdir(lib_dir):
if lib_dir == data_dir:
ddir = os.path.join(data_dir, item)
if any(s.startswith(ddir) for s in lib_dir_list[:-1]):
continue
target_item_dir = os.path.join(target_dir, item)
if os.path.exists(target_item_dir):
if not upgrade:
logger.warning(
'Target directory %s already exists. Specify '
'--upgrade to force replacement.',
target_item_dir
)
continue
if os.path.islink(target_item_dir):
logger.warning(
'Target directory %s already exists and is '
'a link. Pip will not automatically replace '
'links, please remove if replacement is '
'desired.',
target_item_dir
)
continue
if os.path.isdir(target_item_dir):
shutil.rmtree(target_item_dir)
else:
os.remove(target_item_dir)
shutil.move(
os.path.join(lib_dir, item),
target_item_dir
)
def _warn_about_conflicts(self, to_install):
package_set, _dep_info = check_install_conflicts(to_install)
missing, conflicting = _dep_info
# NOTE: There is some duplication here from pip check
for project_name in missing:
version = package_set[project_name][0]
for dependency in missing[project_name]:
logger.critical(
"%s %s requires %s, which is not installed.",
project_name, version, dependency[1],
)
for project_name in conflicting:
version = package_set[project_name][0]
for dep_name, dep_version, req in conflicting[project_name]:
logger.critical(
"%s %s has requirement %s, but you'll have %s %s which is "
"incompatible.",
project_name, version, req, dep_name, dep_version,
)
def get_lib_location_guesses(*args, **kwargs):
scheme = distutils_scheme('', *args, **kwargs)
return [scheme['purelib'], scheme['platlib']]
def create_env_error_message(error, show_traceback, using_user_site):
"""Format an error message for an EnvironmentError
It may occur anytime during the execution of the install command.
"""
parts = []
# Mention the error if we are not going to show a traceback
parts.append("Could not install packages due to an EnvironmentError")
if not show_traceback:
parts.append(": ")
parts.append(str(error))
else:
parts.append(".")
# Spilt the error indication from a helper message (if any)
parts[-1] += "\n"
# Suggest useful actions to the user:
# (1) using user site-packages or (2) verifying the permissions
if error.errno == errno.EACCES:
user_option_part = "Consider using the `--user` option"
permissions_part = "Check the permissions"
if not using_user_site:
parts.extend([
user_option_part, " or ",
permissions_part.lower(),
])
else:
parts.append(permissions_part)
parts.append(".\n")
return "".join(parts).strip() + "\n"
@@ -0,0 +1,343 @@
from __future__ import absolute_import
import json
import logging
import warnings
from pip._vendor import six
from pip._vendor.six.moves import zip_longest
from pip._internal.basecommand import Command
from pip._internal.cmdoptions import index_group, make_option_group
from pip._internal.exceptions import CommandError
from pip._internal.index import PackageFinder
from pip._internal.utils.deprecation import RemovedInPip11Warning
from pip._internal.utils.misc import (
dist_is_editable, get_installed_distributions,
)
from pip._internal.utils.packaging import get_installer
logger = logging.getLogger(__name__)
class ListCommand(Command):
"""
List installed packages, including editables.
Packages are listed in a case-insensitive sorted order.
"""
name = 'list'
usage = """
%prog [options]"""
summary = 'List installed packages.'
def __init__(self, *args, **kw):
super(ListCommand, self).__init__(*args, **kw)
cmd_opts = self.cmd_opts
cmd_opts.add_option(
'-o', '--outdated',
action='store_true',
default=False,
help='List outdated packages')
cmd_opts.add_option(
'-u', '--uptodate',
action='store_true',
default=False,
help='List uptodate packages')
cmd_opts.add_option(
'-e', '--editable',
action='store_true',
default=False,
help='List editable projects.')
cmd_opts.add_option(
'-l', '--local',
action='store_true',
default=False,
help=('If in a virtualenv that has global access, do not list '
'globally-installed packages.'),
)
self.cmd_opts.add_option(
'--user',
dest='user',
action='store_true',
default=False,
help='Only output packages installed in user-site.')
cmd_opts.add_option(
'--pre',
action='store_true',
default=False,
help=("Include pre-release and development versions. By default, "
"pip only finds stable versions."),
)
cmd_opts.add_option(
'--format',
action='store',
dest='list_format',
default="columns",
choices=('legacy', 'columns', 'freeze', 'json'),
help="Select the output format among: columns (default), freeze, "
"json, or legacy.",
)
cmd_opts.add_option(
'--not-required',
action='store_true',
dest='not_required',
help="List packages that are not dependencies of "
"installed packages.",
)
cmd_opts.add_option(
'--exclude-editable',
action='store_false',
dest='include_editable',
help='Exclude editable package from output.',
)
cmd_opts.add_option(
'--include-editable',
action='store_true',
dest='include_editable',
help='Include editable package from output.',
default=True,
)
index_opts = make_option_group(index_group, self.parser)
self.parser.insert_option_group(0, index_opts)
self.parser.insert_option_group(0, cmd_opts)
def _build_package_finder(self, options, index_urls, session):
"""
Create a package finder appropriate to this list command.
"""
return PackageFinder(
find_links=options.find_links,
index_urls=index_urls,
allow_all_prereleases=options.pre,
trusted_hosts=options.trusted_hosts,
process_dependency_links=options.process_dependency_links,
session=session,
)
def run(self, options, args):
if options.list_format == "legacy":
warnings.warn(
"The legacy format has been deprecated and will be removed "
"in the future.",
RemovedInPip11Warning,
)
if options.outdated and options.uptodate:
raise CommandError(
"Options --outdated and --uptodate cannot be combined.")
packages = get_installed_distributions(
local_only=options.local,
user_only=options.user,
editables_only=options.editable,
include_editables=options.include_editable,
)
if options.outdated:
packages = self.get_outdated(packages, options)
elif options.uptodate:
packages = self.get_uptodate(packages, options)
if options.not_required:
packages = self.get_not_required(packages, options)
self.output_package_listing(packages, options)
def get_outdated(self, packages, options):
return [
dist for dist in self.iter_packages_latest_infos(packages, options)
if dist.latest_version > dist.parsed_version
]
def get_uptodate(self, packages, options):
return [
dist for dist in self.iter_packages_latest_infos(packages, options)
if dist.latest_version == dist.parsed_version
]
def get_not_required(self, packages, options):
dep_keys = set()
for dist in packages:
dep_keys.update(requirement.key for requirement in dist.requires())
return {pkg for pkg in packages if pkg.key not in dep_keys}
def iter_packages_latest_infos(self, packages, options):
index_urls = [options.index_url] + options.extra_index_urls
if options.no_index:
logger.debug('Ignoring indexes: %s', ','.join(index_urls))
index_urls = []
dependency_links = []
for dist in packages:
if dist.has_metadata('dependency_links.txt'):
dependency_links.extend(
dist.get_metadata_lines('dependency_links.txt'),
)
with self._build_session(options) as session:
finder = self._build_package_finder(options, index_urls, session)
finder.add_dependency_links(dependency_links)
for dist in packages:
typ = 'unknown'
all_candidates = finder.find_all_candidates(dist.key)
if not options.pre:
# Remove prereleases
all_candidates = [candidate for candidate in all_candidates
if not candidate.version.is_prerelease]
if not all_candidates:
continue
best_candidate = max(all_candidates,
key=finder._candidate_sort_key)
remote_version = best_candidate.version
if best_candidate.location.is_wheel:
typ = 'wheel'
else:
typ = 'sdist'
# This is dirty but makes the rest of the code much cleaner
dist.latest_version = remote_version
dist.latest_filetype = typ
yield dist
def output_legacy(self, dist, options):
if options.verbose >= 1:
return '%s (%s, %s, %s)' % (
dist.project_name,
dist.version,
dist.location,
get_installer(dist),
)
elif dist_is_editable(dist):
return '%s (%s, %s)' % (
dist.project_name,
dist.version,
dist.location,
)
else:
return '%s (%s)' % (dist.project_name, dist.version)
def output_legacy_latest(self, dist, options):
return '%s - Latest: %s [%s]' % (
self.output_legacy(dist, options),
dist.latest_version,
dist.latest_filetype,
)
def output_package_listing(self, packages, options):
packages = sorted(
packages,
key=lambda dist: dist.project_name.lower(),
)
if options.list_format == 'columns' and packages:
data, header = format_for_columns(packages, options)
self.output_package_listing_columns(data, header)
elif options.list_format == 'freeze':
for dist in packages:
if options.verbose >= 1:
logger.info("%s==%s (%s)", dist.project_name,
dist.version, dist.location)
else:
logger.info("%s==%s", dist.project_name, dist.version)
elif options.list_format == 'json':
logger.info(format_for_json(packages, options))
elif options.list_format == "legacy":
for dist in packages:
if options.outdated:
logger.info(self.output_legacy_latest(dist, options))
else:
logger.info(self.output_legacy(dist, options))
def output_package_listing_columns(self, data, header):
# insert the header first: we need to know the size of column names
if len(data) > 0:
data.insert(0, header)
pkg_strings, sizes = tabulate(data)
# Create and add a separator.
if len(data) > 0:
pkg_strings.insert(1, " ".join(map(lambda x: '-' * x, sizes)))
for val in pkg_strings:
logger.info(val)
def tabulate(vals):
# From pfmoore on GitHub:
# https://github.com/pypa/pip/issues/3651#issuecomment-216932564
assert len(vals) > 0
sizes = [0] * max(len(x) for x in vals)
for row in vals:
sizes = [max(s, len(str(c))) for s, c in zip_longest(sizes, row)]
result = []
for row in vals:
display = " ".join([str(c).ljust(s) if c is not None else ''
for s, c in zip_longest(sizes, row)])
result.append(display)
return result, sizes
def format_for_columns(pkgs, options):
"""
Convert the package data into something usable
by output_package_listing_columns.
"""
running_outdated = options.outdated
# Adjust the header for the `pip list --outdated` case.
if running_outdated:
header = ["Package", "Version", "Latest", "Type"]
else:
header = ["Package", "Version"]
data = []
if options.verbose >= 1 or any(dist_is_editable(x) for x in pkgs):
header.append("Location")
if options.verbose >= 1:
header.append("Installer")
for proj in pkgs:
# if we're working on the 'outdated' list, separate out the
# latest_version and type
row = [proj.project_name, proj.version]
if running_outdated:
row.append(proj.latest_version)
row.append(proj.latest_filetype)
if options.verbose >= 1 or dist_is_editable(proj):
row.append(proj.location)
if options.verbose >= 1:
row.append(get_installer(proj))
data.append(row)
return data, header
def format_for_json(packages, options):
data = []
for dist in packages:
info = {
'name': dist.project_name,
'version': six.text_type(dist.version),
}
if options.verbose >= 1:
info['location'] = dist.location
info['installer'] = get_installer(dist)
if options.outdated:
info['latest_version'] = six.text_type(dist.latest_version)
info['latest_filetype'] = dist.latest_filetype
data.append(info)
return json.dumps(data)
@@ -0,0 +1,135 @@
from __future__ import absolute_import
import logging
import sys
import textwrap
from collections import OrderedDict
from pip._vendor import pkg_resources
from pip._vendor.packaging.version import parse as parse_version
# NOTE: XMLRPC Client is not annotated in typeshed as on 2017-07-17, which is
# why we ignore the type on this import
from pip._vendor.six.moves import xmlrpc_client # type: ignore
from pip._internal.basecommand import SUCCESS, Command
from pip._internal.compat import get_terminal_size
from pip._internal.download import PipXmlrpcTransport
from pip._internal.exceptions import CommandError
from pip._internal.models import PyPI
from pip._internal.status_codes import NO_MATCHES_FOUND
from pip._internal.utils.logging import indent_log
logger = logging.getLogger(__name__)
class SearchCommand(Command):
"""Search for PyPI packages whose name or summary contains <query>."""
name = 'search'
usage = """
%prog [options] <query>"""
summary = 'Search PyPI for packages.'
ignore_require_venv = True
def __init__(self, *args, **kw):
super(SearchCommand, self).__init__(*args, **kw)
self.cmd_opts.add_option(
'-i', '--index',
dest='index',
metavar='URL',
default=PyPI.pypi_url,
help='Base URL of Python Package Index (default %default)')
self.parser.insert_option_group(0, self.cmd_opts)
def run(self, options, args):
if not args:
raise CommandError('Missing required argument (search query).')
query = args
pypi_hits = self.search(query, options)
hits = transform_hits(pypi_hits)
terminal_width = None
if sys.stdout.isatty():
terminal_width = get_terminal_size()[0]
print_results(hits, terminal_width=terminal_width)
if pypi_hits:
return SUCCESS
return NO_MATCHES_FOUND
def search(self, query, options):
index_url = options.index
with self._build_session(options) as session:
transport = PipXmlrpcTransport(index_url, session)
pypi = xmlrpc_client.ServerProxy(index_url, transport)
hits = pypi.search({'name': query, 'summary': query}, 'or')
return hits
def transform_hits(hits):
"""
The list from pypi is really a list of versions. We want a list of
packages with the list of versions stored inline. This converts the
list from pypi into one we can use.
"""
packages = OrderedDict()
for hit in hits:
name = hit['name']
summary = hit['summary']
version = hit['version']
if name not in packages.keys():
packages[name] = {
'name': name,
'summary': summary,
'versions': [version],
}
else:
packages[name]['versions'].append(version)
# if this is the highest version, replace summary and score
if version == highest_version(packages[name]['versions']):
packages[name]['summary'] = summary
return list(packages.values())
def print_results(hits, name_column_width=None, terminal_width=None):
if not hits:
return
if name_column_width is None:
name_column_width = max([
len(hit['name']) + len(highest_version(hit.get('versions', ['-'])))
for hit in hits
]) + 4
installed_packages = [p.project_name for p in pkg_resources.working_set]
for hit in hits:
name = hit['name']
summary = hit['summary'] or ''
latest = highest_version(hit.get('versions', ['-']))
if terminal_width is not None:
target_width = terminal_width - name_column_width - 5
if target_width > 10:
# wrap and indent summary to fit terminal
summary = textwrap.wrap(summary, target_width)
summary = ('\n' + ' ' * (name_column_width + 3)).join(summary)
line = '%-*s - %s' % (name_column_width,
'%s (%s)' % (name, latest), summary)
try:
logger.info(line)
if name in installed_packages:
dist = pkg_resources.get_distribution(name)
with indent_log():
if dist.version == latest:
logger.info('INSTALLED: %s (latest)', dist.version)
else:
logger.info('INSTALLED: %s', dist.version)
logger.info('LATEST: %s', latest)
except UnicodeEncodeError:
pass
def highest_version(versions):
return max(versions, key=parse_version)
@@ -0,0 +1,164 @@
from __future__ import absolute_import
import logging
import os
from email.parser import FeedParser # type: ignore
from pip._vendor import pkg_resources
from pip._vendor.packaging.utils import canonicalize_name
from pip._internal.basecommand import Command
from pip._internal.status_codes import ERROR, SUCCESS
logger = logging.getLogger(__name__)
class ShowCommand(Command):
"""Show information about one or more installed packages."""
name = 'show'
usage = """
%prog [options] <package> ..."""
summary = 'Show information about installed packages.'
ignore_require_venv = True
def __init__(self, *args, **kw):
super(ShowCommand, self).__init__(*args, **kw)
self.cmd_opts.add_option(
'-f', '--files',
dest='files',
action='store_true',
default=False,
help='Show the full list of installed files for each package.')
self.parser.insert_option_group(0, self.cmd_opts)
def run(self, options, args):
if not args:
logger.warning('ERROR: Please provide a package name or names.')
return ERROR
query = args
results = search_packages_info(query)
if not print_results(
results, list_files=options.files, verbose=options.verbose):
return ERROR
return SUCCESS
def search_packages_info(query):
"""
Gather details from installed distributions. Print distribution name,
version, location, and installed files. Installed files requires a
pip generated 'installed-files.txt' in the distributions '.egg-info'
directory.
"""
installed = {}
for p in pkg_resources.working_set:
installed[canonicalize_name(p.project_name)] = p
query_names = [canonicalize_name(name) for name in query]
for dist in [installed[pkg] for pkg in query_names if pkg in installed]:
package = {
'name': dist.project_name,
'version': dist.version,
'location': dist.location,
'requires': [dep.project_name for dep in dist.requires()],
}
file_list = None
metadata = None
if isinstance(dist, pkg_resources.DistInfoDistribution):
# RECORDs should be part of .dist-info metadatas
if dist.has_metadata('RECORD'):
lines = dist.get_metadata_lines('RECORD')
paths = [l.split(',')[0] for l in lines]
paths = [os.path.join(dist.location, p) for p in paths]
file_list = [os.path.relpath(p, dist.location) for p in paths]
if dist.has_metadata('METADATA'):
metadata = dist.get_metadata('METADATA')
else:
# Otherwise use pip's log for .egg-info's
if dist.has_metadata('installed-files.txt'):
paths = dist.get_metadata_lines('installed-files.txt')
paths = [os.path.join(dist.egg_info, p) for p in paths]
file_list = [os.path.relpath(p, dist.location) for p in paths]
if dist.has_metadata('PKG-INFO'):
metadata = dist.get_metadata('PKG-INFO')
if dist.has_metadata('entry_points.txt'):
entry_points = dist.get_metadata_lines('entry_points.txt')
package['entry_points'] = entry_points
if dist.has_metadata('INSTALLER'):
for line in dist.get_metadata_lines('INSTALLER'):
if line.strip():
package['installer'] = line.strip()
break
# @todo: Should pkg_resources.Distribution have a
# `get_pkg_info` method?
feed_parser = FeedParser()
feed_parser.feed(metadata)
pkg_info_dict = feed_parser.close()
for key in ('metadata-version', 'summary',
'home-page', 'author', 'author-email', 'license'):
package[key] = pkg_info_dict.get(key)
# It looks like FeedParser cannot deal with repeated headers
classifiers = []
for line in metadata.splitlines():
if line.startswith('Classifier: '):
classifiers.append(line[len('Classifier: '):])
package['classifiers'] = classifiers
if file_list:
package['files'] = sorted(file_list)
yield package
def print_results(distributions, list_files=False, verbose=False):
"""
Print the informations from installed distributions found.
"""
results_printed = False
for i, dist in enumerate(distributions):
results_printed = True
if i > 0:
logger.info("---")
name = dist.get('name', '')
required_by = [
pkg.project_name for pkg in pkg_resources.working_set
if name in [required.name for required in pkg.requires()]
]
logger.info("Name: %s", name)
logger.info("Version: %s", dist.get('version', ''))
logger.info("Summary: %s", dist.get('summary', ''))
logger.info("Home-page: %s", dist.get('home-page', ''))
logger.info("Author: %s", dist.get('author', ''))
logger.info("Author-email: %s", dist.get('author-email', ''))
logger.info("License: %s", dist.get('license', ''))
logger.info("Location: %s", dist.get('location', ''))
logger.info("Requires: %s", ', '.join(dist.get('requires', [])))
logger.info("Required-by: %s", ', '.join(required_by))
if verbose:
logger.info("Metadata-Version: %s",
dist.get('metadata-version', ''))
logger.info("Installer: %s", dist.get('installer', ''))
logger.info("Classifiers:")
for classifier in dist.get('classifiers', []):
logger.info(" %s", classifier)
logger.info("Entry-points:")
for entry in dist.get('entry_points', []):
logger.info(" %s", entry.strip())
if list_files:
logger.info("Files:")
for line in dist.get('files', []):
logger.info(" %s", line.strip())
if "files" not in dist:
logger.info("Cannot locate installed-files.txt")
return results_printed
@@ -0,0 +1,71 @@
from __future__ import absolute_import
from pip._vendor.packaging.utils import canonicalize_name
from pip._internal.basecommand import Command
from pip._internal.exceptions import InstallationError
from pip._internal.req import InstallRequirement, parse_requirements
class UninstallCommand(Command):
"""
Uninstall packages.
pip is able to uninstall most installed packages. Known exceptions are:
- Pure distutils packages installed with ``python setup.py install``, which
leave behind no metadata to determine what files were installed.
- Script wrappers installed by ``python setup.py develop``.
"""
name = 'uninstall'
usage = """
%prog [options] <package> ...
%prog [options] -r <requirements file> ..."""
summary = 'Uninstall packages.'
def __init__(self, *args, **kw):
super(UninstallCommand, self).__init__(*args, **kw)
self.cmd_opts.add_option(
'-r', '--requirement',
dest='requirements',
action='append',
default=[],
metavar='file',
help='Uninstall all the packages listed in the given requirements '
'file. This option can be used multiple times.',
)
self.cmd_opts.add_option(
'-y', '--yes',
dest='yes',
action='store_true',
help="Don't ask for confirmation of uninstall deletions.")
self.parser.insert_option_group(0, self.cmd_opts)
def run(self, options, args):
with self._build_session(options) as session:
reqs_to_uninstall = {}
for name in args:
req = InstallRequirement.from_line(
name, isolated=options.isolated_mode,
)
if req.name:
reqs_to_uninstall[canonicalize_name(req.name)] = req
for filename in options.requirements:
for req in parse_requirements(
filename,
options=options,
session=session):
if req.name:
reqs_to_uninstall[canonicalize_name(req.name)] = req
if not reqs_to_uninstall:
raise InstallationError(
'You must give at least one requirement to %(name)s (see '
'"pip help %(name)s")' % dict(name=self.name)
)
for req in reqs_to_uninstall.values():
uninstall_pathset = req.uninstall(
auto_confirm=options.yes, verbose=self.verbosity > 0,
)
if uninstall_pathset:
uninstall_pathset.commit()
@@ -0,0 +1,179 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import os
from pip._internal import cmdoptions
from pip._internal.basecommand import RequirementCommand
from pip._internal.cache import WheelCache
from pip._internal.exceptions import CommandError, PreviousBuildDirError
from pip._internal.operations.prepare import RequirementPreparer
from pip._internal.req import RequirementSet
from pip._internal.resolve import Resolver
from pip._internal.utils.temp_dir import TempDirectory
from pip._internal.wheel import WheelBuilder
logger = logging.getLogger(__name__)
class WheelCommand(RequirementCommand):
"""
Build Wheel archives for your requirements and dependencies.
Wheel is a built-package format, and offers the advantage of not
recompiling your software during every install. For more details, see the
wheel docs: https://wheel.readthedocs.io/en/latest/
Requirements: setuptools>=0.8, and wheel.
'pip wheel' uses the bdist_wheel setuptools extension from the wheel
package to build individual wheels.
"""
name = 'wheel'
usage = """
%prog [options] <requirement specifier> ...
%prog [options] -r <requirements file> ...
%prog [options] [-e] <vcs project url> ...
%prog [options] [-e] <local project path> ...
%prog [options] <archive url/path> ..."""
summary = 'Build wheels from your requirements.'
def __init__(self, *args, **kw):
super(WheelCommand, self).__init__(*args, **kw)
cmd_opts = self.cmd_opts
cmd_opts.add_option(
'-w', '--wheel-dir',
dest='wheel_dir',
metavar='dir',
default=os.curdir,
help=("Build wheels into <dir>, where the default is the "
"current working directory."),
)
cmd_opts.add_option(cmdoptions.no_binary())
cmd_opts.add_option(cmdoptions.only_binary())
cmd_opts.add_option(
'--build-option',
dest='build_options',
metavar='options',
action='append',
help="Extra arguments to be supplied to 'setup.py bdist_wheel'.",
)
cmd_opts.add_option(cmdoptions.no_build_isolation())
cmd_opts.add_option(cmdoptions.constraints())
cmd_opts.add_option(cmdoptions.editable())
cmd_opts.add_option(cmdoptions.requirements())
cmd_opts.add_option(cmdoptions.src())
cmd_opts.add_option(cmdoptions.ignore_requires_python())
cmd_opts.add_option(cmdoptions.no_deps())
cmd_opts.add_option(cmdoptions.build_dir())
cmd_opts.add_option(cmdoptions.progress_bar())
cmd_opts.add_option(
'--global-option',
dest='global_options',
action='append',
metavar='options',
help="Extra global options to be supplied to the setup.py "
"call before the 'bdist_wheel' command.")
cmd_opts.add_option(
'--pre',
action='store_true',
default=False,
help=("Include pre-release and development versions. By default, "
"pip only finds stable versions."),
)
cmd_opts.add_option(cmdoptions.no_clean())
cmd_opts.add_option(cmdoptions.require_hashes())
index_opts = cmdoptions.make_option_group(
cmdoptions.index_group,
self.parser,
)
self.parser.insert_option_group(0, index_opts)
self.parser.insert_option_group(0, cmd_opts)
def run(self, options, args):
cmdoptions.check_install_build_global(options)
index_urls = [options.index_url] + options.extra_index_urls
if options.no_index:
logger.debug('Ignoring indexes: %s', ','.join(index_urls))
index_urls = []
if options.build_dir:
options.build_dir = os.path.abspath(options.build_dir)
options.src_dir = os.path.abspath(options.src_dir)
with self._build_session(options) as session:
finder = self._build_package_finder(options, session)
build_delete = (not (options.no_clean or options.build_dir))
wheel_cache = WheelCache(options.cache_dir, options.format_control)
with TempDirectory(
options.build_dir, delete=build_delete, kind="wheel"
) as directory:
requirement_set = RequirementSet(
require_hashes=options.require_hashes,
)
try:
self.populate_requirement_set(
requirement_set, args, options, finder, session,
self.name, wheel_cache
)
preparer = RequirementPreparer(
build_dir=directory.path,
src_dir=options.src_dir,
download_dir=None,
wheel_download_dir=options.wheel_dir,
progress_bar=options.progress_bar,
build_isolation=options.build_isolation,
)
resolver = Resolver(
preparer=preparer,
finder=finder,
session=session,
wheel_cache=wheel_cache,
use_user_site=False,
upgrade_strategy="to-satisfy-only",
force_reinstall=False,
ignore_dependencies=options.ignore_dependencies,
ignore_requires_python=options.ignore_requires_python,
ignore_installed=True,
isolated=options.isolated_mode,
)
resolver.resolve(requirement_set)
# build wheels
wb = WheelBuilder(
finder, preparer, wheel_cache,
build_options=options.build_options or [],
global_options=options.global_options or [],
no_clean=options.no_clean,
)
wheels_built_successfully = wb.build(
requirement_set.requirements.values(), session=session,
)
if not wheels_built_successfully:
raise CommandError(
"Failed to build one or more wheels"
)
except PreviousBuildDirError:
options.no_clean = True
raise
finally:
if not options.no_clean:
requirement_set.cleanup_files()
wheel_cache.cleanup()
@@ -0,0 +1,235 @@
"""Stuff that differs in different Python versions and platform
distributions."""
from __future__ import absolute_import, division
import codecs
import locale
import logging
import os
import shutil
import sys
from pip._vendor.six import text_type
try:
import ipaddress
except ImportError:
try:
from pip._vendor import ipaddress # type: ignore
except ImportError:
import ipaddr as ipaddress # type: ignore
ipaddress.ip_address = ipaddress.IPAddress
ipaddress.ip_network = ipaddress.IPNetwork
__all__ = [
"ipaddress", "uses_pycache", "console_to_str", "native_str",
"get_path_uid", "stdlib_pkgs", "WINDOWS", "samefile", "get_terminal_size",
]
logger = logging.getLogger(__name__)
if sys.version_info >= (3, 4):
uses_pycache = True
from importlib.util import cache_from_source
else:
import imp
try:
cache_from_source = imp.cache_from_source # type: ignore
except AttributeError:
# does not use __pycache__
cache_from_source = None
uses_pycache = cache_from_source is not None
if sys.version_info >= (3, 5):
backslashreplace_decode = "backslashreplace"
else:
# In version 3.4 and older, backslashreplace exists
# but does not support use for decoding.
# We implement our own replace handler for this
# situation, so that we can consistently use
# backslash replacement for all versions.
def backslashreplace_decode_fn(err):
raw_bytes = (err.object[i] for i in range(err.start, err.end))
if sys.version_info[0] == 2:
# Python 2 gave us characters - convert to numeric bytes
raw_bytes = (ord(b) for b in raw_bytes)
return u"".join(u"\\x%x" % c for c in raw_bytes), err.end
codecs.register_error(
"backslashreplace_decode",
backslashreplace_decode_fn,
)
backslashreplace_decode = "backslashreplace_decode"
def console_to_str(data):
"""Return a string, safe for output, of subprocess output.
We assume the data is in the locale preferred encoding.
If it won't decode properly, we warn the user but decode as
best we can.
We also ensure that the output can be safely written to
standard output without encoding errors.
"""
# First, get the encoding we assume. This is the preferred
# encoding for the locale, unless that is not found, or
# it is ASCII, in which case assume UTF-8
encoding = locale.getpreferredencoding()
if (not encoding) or codecs.lookup(encoding).name == "ascii":
encoding = "utf-8"
# Now try to decode the data - if we fail, warn the user and
# decode with replacement.
try:
s = data.decode(encoding)
except UnicodeDecodeError:
logger.warning(
"Subprocess output does not appear to be encoded as %s",
encoding,
)
s = data.decode(encoding, errors=backslashreplace_decode)
# Make sure we can print the output, by encoding it to the output
# encoding with replacement of unencodable characters, and then
# decoding again.
# We use stderr's encoding because it's less likely to be
# redirected and if we don't find an encoding we skip this
# step (on the assumption that output is wrapped by something
# that won't fail).
# The double getattr is to deal with the possibility that we're
# being called in a situation where sys.__stderr__ doesn't exist,
# or doesn't have an encoding attribute. Neither of these cases
# should occur in normal pip use, but there's no harm in checking
# in case people use pip in (unsupported) unusual situations.
output_encoding = getattr(getattr(sys, "__stderr__", None),
"encoding", None)
if output_encoding:
s = s.encode(output_encoding, errors="backslashreplace")
s = s.decode(output_encoding)
return s
if sys.version_info >= (3,):
def native_str(s, replace=False):
if isinstance(s, bytes):
return s.decode('utf-8', 'replace' if replace else 'strict')
return s
else:
def native_str(s, replace=False):
# Replace is ignored -- unicode to UTF-8 can't fail
if isinstance(s, text_type):
return s.encode('utf-8')
return s
def get_path_uid(path):
"""
Return path's uid.
Does not follow symlinks:
https://github.com/pypa/pip/pull/935#discussion_r5307003
Placed this function in compat due to differences on AIX and
Jython, that should eventually go away.
:raises OSError: When path is a symlink or can't be read.
"""
if hasattr(os, 'O_NOFOLLOW'):
fd = os.open(path, os.O_RDONLY | os.O_NOFOLLOW)
file_uid = os.fstat(fd).st_uid
os.close(fd)
else: # AIX and Jython
# WARNING: time of check vulnerability, but best we can do w/o NOFOLLOW
if not os.path.islink(path):
# older versions of Jython don't have `os.fstat`
file_uid = os.stat(path).st_uid
else:
# raise OSError for parity with os.O_NOFOLLOW above
raise OSError(
"%s is a symlink; Will not return uid for symlinks" % path
)
return file_uid
def expanduser(path):
"""
Expand ~ and ~user constructions.
Includes a workaround for http://bugs.python.org/issue14768
"""
expanded = os.path.expanduser(path)
if path.startswith('~/') and expanded.startswith('//'):
expanded = expanded[1:]
return expanded
# packages in the stdlib that may have installation metadata, but should not be
# considered 'installed'. this theoretically could be determined based on
# dist.location (py27:`sysconfig.get_paths()['stdlib']`,
# py26:sysconfig.get_config_vars('LIBDEST')), but fear platform variation may
# make this ineffective, so hard-coding
stdlib_pkgs = {"python", "wsgiref", "argparse"}
# windows detection, covers cpython and ironpython
WINDOWS = (sys.platform.startswith("win") or
(sys.platform == 'cli' and os.name == 'nt'))
def samefile(file1, file2):
"""Provide an alternative for os.path.samefile on Windows/Python2"""
if hasattr(os.path, 'samefile'):
return os.path.samefile(file1, file2)
else:
path1 = os.path.normcase(os.path.abspath(file1))
path2 = os.path.normcase(os.path.abspath(file2))
return path1 == path2
if hasattr(shutil, 'get_terminal_size'):
def get_terminal_size():
"""
Returns a tuple (x, y) representing the width(x) and the height(y)
in characters of the terminal window.
"""
return tuple(shutil.get_terminal_size())
else:
def get_terminal_size():
"""
Returns a tuple (x, y) representing the width(x) and the height(y)
in characters of the terminal window.
"""
def ioctl_GWINSZ(fd):
try:
import fcntl
import termios
import struct
cr = struct.unpack_from(
'hh',
fcntl.ioctl(fd, termios.TIOCGWINSZ, '12345678')
)
except:
return None
if cr == (0, 0):
return None
return cr
cr = ioctl_GWINSZ(0) or ioctl_GWINSZ(1) or ioctl_GWINSZ(2)
if not cr:
try:
fd = os.open(os.ctermid(), os.O_RDONLY)
cr = ioctl_GWINSZ(fd)
os.close(fd)
except:
pass
if not cr:
cr = (os.environ.get('LINES', 25), os.environ.get('COLUMNS', 80))
return int(cr[1]), int(cr[0])
Loaded 100 of 399 files, more files were not shown because too many files have changed in this diff. Show more