From 8fa1aae39ed6cf808f8b3138ec2131df9e08de91 Mon Sep 17 00:00:00 2001 From: Raffu Khondaker <2022rkhondak@tjhsst.edu> Date: Tue, 16 Jun 2020 01:45:45 -0400 Subject: [PATCH 1/7] teacher fix --- CLI/student.py | 27 ++++++++++--------- CLI/teacher.py | 24 +++++++---------- .../instruct.txt | 0 3 files changed, 24 insertions(+), 27 deletions(-) rename eharris1/APLit_eharris1/{Essay1_eharris1 => Essay1_APLit_eharris1}/instruct.txt (100%) diff --git a/CLI/student.py b/CLI/student.py index 5d6ad51..8559979 100644 --- a/CLI/student.py +++ b/CLI/student.py @@ -186,6 +186,7 @@ class Student: print("ADDING CLASS: " + str(c['name'])) self.addClass(str(c['name'])) command("git checkout master") + print(os.getcwd()) #updates 1 class, does not switch to master def updateClass(self, course): @@ -222,14 +223,14 @@ class Student: os.system(url) cdir = os.getcwd() - # path1 = self.username + "/" + self.username - # path2 = self.username - # if(os.path.isdir(path1)): - # os.chdir(path1) - # else: - # os.chdir(self.username) - # command("git clone " + self.repo) - # os.chdir(self.username) + path1 = self.username + "/" + self.username + path2 = self.username + if(os.path.isdir(path1)): + os.chdir(path1) + else: + os.chdir(self.username) + command("git clone " + self.repo) + os.chdir(self.username) #push to git, start at master os.chdir(self.username) @@ -277,6 +278,7 @@ class Student: data={ 'user':self.user, 'added_to':self.snew, + 'classes':self.sclass } print(self.url) print(patchDB(data, self.url)) @@ -366,15 +368,14 @@ class Student: command('git checkout master') os.chdir(cdir) -# data = getStudent("2022rkhondak") -# s = Student(data) -# #s.viewClass("APLit_eharris1") -# #s.updateClass("APLit_eharris1") +data = getStudent("2022rkhondak") +s = Student(data) +#s.viewClass("APLit_eharris1") +s.addClass("APLit_eharris1") # #s.update() # s.exitCLI() def main(): - print("noooo") pass if __name__ == "__main__": diff --git a/CLI/teacher.py b/CLI/teacher.py index 8062406..01aec2c 100644 --- a/CLI/teacher.py +++ b/CLI/teacher.py @@ -332,24 +332,23 @@ class Teacher: command('git push -u origin ' + cname) os.chdir(cdir) - if(course['confirmed']==""): + if(course['confirmed']==[]): course['confirmed']=student['ion_user'] else: - course['confirmed']=course['confirmed']+ "," + student['ion_user'] + course['confirmed'].append(student['ion_user']) #only 1 pereson on confirmeed - if(("," in course['unconfirmed']) == False): - course['unconfirmed']="" + if(len(course['unconfirmed']) == 1): + course['unconfirmed']=[] #mutiple else: - course['unconfirmed']= course['unconfirmed'].replace("," + student['ion_user'], "") - course['unconfirmed']= course['unconfirmed'].replace(student['ion_user']+",", "") + course['unconfirmed'].remove(student['ion_user']) cinfo = { "confirmed": course["confirmed"], "unconfirmed": course['unconfirmed'] } - print(patchDB(cinfo, "http://localhost:8000/api/classes/" + course['name'] + "/")) + print(putDB(course, "http://localhost:8000/api/classes/" + course['name'] + "/")) return True #goes through list of studennts, tries to add, then request, return unconfirmed students @@ -436,15 +435,12 @@ class Teacher: 'due_date':due } postDB(ass, 'http://127.0.0.1:8000/api/assignments/') - if(course['assignments'] == ""): - course['assignments'] = ass - else: - course['assignments'] = course['assignments'].append(ass) + course['assignments'].append(aname) cinfo = { "assignments": course['assignments'], } - patchDB(cinfo, "http://127.0.0.1:8000/api/classes/" + course['name'] + "/") + print(patchDB(cinfo, "http://127.0.0.1:8000/api/classes/" + course['name'] + "/")) return True else: print("Assignment already addedd") @@ -602,11 +598,11 @@ class Teacher: data = getTeacher("eharris1") t = Teacher(data) #t.addClass("eharris1/APLit_eharris1") -#t.addAssignment("eharris1/APLit_eharris1/Essay1_eharris1", "APLit_eharris1", '2020-08-11 16:58:33.383124') +t.addAssignment("eharris1/APLit_eharris1/Essay1_APLit_eharris1", "APLit_eharris1", '2020-08-11 16:58:33.383124') #ar = ['2022rkhondak','2022inafi','2023rumareti'] #extra = t.reqAddStudentList(ar, "APLit_eharris1") #print(extra) -t.reqStudent('2022rkhondak', 'APLit_eharris1') +#t.addStudent('2022rkhondak', 'APLit_eharris1') # t.getChanges('2022rkhondak','APLit_eharris1', 10) ''' diff --git a/eharris1/APLit_eharris1/Essay1_eharris1/instruct.txt b/eharris1/APLit_eharris1/Essay1_APLit_eharris1/instruct.txt similarity index 100% rename from eharris1/APLit_eharris1/Essay1_eharris1/instruct.txt rename to eharris1/APLit_eharris1/Essay1_APLit_eharris1/instruct.txt From bc5effb80ba1f2bd69100930bdc2150ca46326cc Mon Sep 17 00:00:00 2001 From: Rushil Umaretiya Date: Tue, 16 Jun 2020 10:41:24 -0400 Subject: [PATCH 2/7] PyGObject can't be installed from pip --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 39bd1f5..1bb1472 100644 --- a/requirements.txt +++ b/requirements.txt @@ -34,7 +34,7 @@ pulsemixer==1.5.0 pycairo==1.19.1 pyclipper==1.1.0.post3 Pygments==2.6.1 -PyGObject==3.34.0 +# PyGObject==3.34.0 pyinotify==0.9.6 PyInquirer==1.0.3 pylint==2.5.3 From 9444f9b34e19e18be317d3b99093d29f6395e152 Mon Sep 17 00:00:00 2001 From: Rushil Umaretiya Date: Tue, 16 Jun 2020 10:42:01 -0400 Subject: [PATCH 3/7] PyGObject can't be installed from pip --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 39bd1f5..1bb1472 100644 --- a/requirements.txt +++ b/requirements.txt @@ -34,7 +34,7 @@ pulsemixer==1.5.0 pycairo==1.19.1 pyclipper==1.1.0.post3 Pygments==2.6.1 -PyGObject==3.34.0 +# PyGObject==3.34.0 pyinotify==0.9.6 PyInquirer==1.0.3 pylint==2.5.3 From fe42f52a91b59189f20e36f35c2a831991dd83d3 Mon Sep 17 00:00:00 2001 From: rushilwiz Date: Tue, 16 Jun 2020 10:55:05 -0400 Subject: [PATCH 4/7] chilled the dependencies --- requirements.txt | 85 +++++++++++++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 33 deletions(-) diff --git a/requirements.txt b/requirements.txt index 1bb1472..27546fe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,62 +1,81 @@ appdirs==1.4.3 -asgiref==3.2.7 -astroid==2.4.2 -CacheControl==0.12.6 -certifi==2020.4.5.1 -chardet==3.0.4 +cachecontrol==0.12.6 click==7.1.2 colorama==0.4.3 contextlib2==0.6.0 distlib==0.3.0 distro==1.4.0 -Django==3.0.7 django-cors-middleware==1.5.0 django-crispy-forms==1.9.1 +django-forms-bootstrap==3.1.0 django-oauth-toolkit==1.3.2 +django-request-token==0.10.1 djangorestframework==3.11.0 -greenlet==0.4.16 +hashids==1.2.0 html5lib==1.0.1 -idna==2.9 -isort==4.3.21 -lazy-object-proxy==1.4.3 -mccabe==0.6.1 meson==0.53.2 -msgpack==0.6.2 numpy==1.18.5 -oauthlib==3.1.0 ordered-set==3.1.1 -packaging==20.1 pep517==0.8.1 -Pillow==7.1.2 +pip-chill==1.0.0 progress==1.5 -prompt-toolkit==1.0.14 pulsemixer==1.5.0 pycairo==1.19.1 pyclipper==1.1.0.post3 -Pygments==2.6.1 -# PyGObject==3.34.0 pyinotify==0.9.6 -PyInquirer==1.0.3 +pyinquirer==1.0.3 pylint==2.5.3 pynvim==0.4.1 -pyparsing==2.4.6 pyperclip==1.8.0 pytoml==0.1.21 -pytz==2020.1 -pywal==3.3.0 -regex==2020.5.14 -requests==2.23.0 +requests-oauth==0.4.1 requests-oauthlib==1.3.0 retrying==1.3.3 selenium==3.141.0 -six==1.15.0 -sqlparse==0.3.1 -toml==0.10.0 -urllib3==1.25.9 -wcwidth==0.2.3 -webencodings==0.5.1 -Werkzeug==1.0.1 +sphinx==3.1.1 +werkzeug==1.0.1 wpgtk==6.1.3 -wrapt==1.12.1 yapf==0.30.0 - +# alabaster==0.7.12 # Installed as dependency for sphinx +# asgiref==3.2.7 # Installed as dependency for django +# astroid==2.4.2 # Installed as dependency for pylint +# babel==2.8.0 # Installed as dependency for sphinx +# certifi==2020.4.5.1 # Installed as dependency for requests +# chardet==3.0.4 # Installed as dependency for requests +# django==3.0.7 # Installed as dependency for django-request-token, djangorestframework, django-oauth-toolkit +# docutils==0.16 # Installed as dependency for sphinx +# greenlet==0.4.16 # Installed as dependency for pynvim +# idna==2.9 # Installed as dependency for requests +# imagesize==1.2.0 # Installed as dependency for sphinx +# isort==4.3.21 # Installed as dependency for pylint +# jinja2==2.11.2 # Installed as dependency for sphinx +# lazy-object-proxy==1.4.3 # Installed as dependency for astroid +# markupsafe==1.1.1 # Installed as dependency for jinja2 +# mccabe==0.6.1 # Installed as dependency for pylint +# msgpack==0.6.2 # Installed as dependency for pynvim, cachecontrol +# oauthlib==3.1.0 # Installed as dependency for requests-oauthlib, django-oauth-toolkit +# packaging==20.1 # Installed as dependency for sphinx +# pillow==7.1.2 # Installed as dependency for wpgtk +# prompt-toolkit==1.0.14 # Installed as dependency for pyinquirer +# psycopg2-binary==2.8.5 # Installed as dependency for django-request-token +# pygments==2.6.1 # Installed as dependency for sphinx, pyinquirer +# pyjwt==1.7.1 # Installed as dependency for django-request-token +# pyparsing==2.4.6 # Installed as dependency for packaging +# pytz==2020.1 # Installed as dependency for django, babel +# pywal==3.3.0 # Installed as dependency for wpgtk +# regex==2020.5.14 # Installed as dependency for pyinquirer +# requests==2.23.0 # Installed as dependency for cachecontrol, requests-oauth, django-oauth-toolkit, sphinx, requests-oauthlib +# six==1.15.0 # Installed as dependency for astroid, prompt-toolkit, html5lib, retrying, packaging +# snowballstemmer==2.0.0 # Installed as dependency for sphinx +# sphinxcontrib-applehelp==1.0.2 # Installed as dependency for sphinx +# sphinxcontrib-devhelp==1.0.2 # Installed as dependency for sphinx +# sphinxcontrib-htmlhelp==1.0.3 # Installed as dependency for sphinx +# sphinxcontrib-jsmath==1.0.1 # Installed as dependency for sphinx +# sphinxcontrib-qthelp==1.0.3 # Installed as dependency for sphinx +# sphinxcontrib-serializinghtml==1.1.4 # Installed as dependency for sphinx +# sqlparse==0.3.1 # Installed as dependency for django, django-request-token +# toml==0.10.0 # Installed as dependency for pylint, pep517 +# urllib3==1.25.9 # Installed as dependency for selenium, requests +# wcwidth==0.2.3 # Installed as dependency for prompt-toolkit +# webencodings==0.5.1 # Installed as dependency for html5lib +# wrapt==1.12.1 # Installed as dependency for astroid From f893b964255022cf98e576a48e48ea85c6e31851 Mon Sep 17 00:00:00 2001 From: rushilwiz Date: Tue, 16 Jun 2020 11:02:38 -0400 Subject: [PATCH 5/7] started ReadTheDocs --- docs/Makefile | 20 ++++++++++++++++++ docs/conf.py | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ docs/index.rst | 20 ++++++++++++++++++ docs/make.bat | 35 ++++++++++++++++++++++++++++++++ 4 files changed, 130 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/conf.py create mode 100644 docs/index.rst create mode 100644 docs/make.bat diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..d4bb2cb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..2fbcbaf --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,55 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'SkoolOS' +copyright = '2020, Rushil Umaretiya, Raffu Khondaker, Nathaniel Kenschaft' +author = 'Rushil Umaretiya, Raffu Khondaker, Nathaniel Kenschaft' + +# The full version, including alpha/beta/rc tags +release = '0.0.1' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'alabaster' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..bd6b02b --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,20 @@ +.. SkoolOS documentation master file, created by + sphinx-quickstart on Tue Jun 16 11:01:18 2020. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to SkoolOS's documentation! +=================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..2119f51 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd From 693fc5ee7580c808a4a802238c5dcb5ed13744cc Mon Sep 17 00:00:00 2001 From: rushilwiz Date: Tue, 16 Jun 2020 11:15:07 -0400 Subject: [PATCH 6/7] removed theme in conf --- docs/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 2fbcbaf..d79a150 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,9 +47,9 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +# html_theme = 'alabaster' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] \ No newline at end of file +html_static_path = ['_static'] From d7a6b96dc817008c66bee1090842e8fe1081b6fe Mon Sep 17 00:00:00 2001 From: rushilwiz Date: Tue, 16 Jun 2020 11:22:54 -0400 Subject: [PATCH 7/7] remade sphinx w/ source and build seperate --- docs/Makefile | 4 ++-- docs/make.bat | 4 ++-- docs/{ => source}/conf.py | 2 +- docs/{ => source}/index.rst | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename docs/{ => source}/conf.py (97%) rename docs/{ => source}/index.rst (88%) diff --git a/docs/Makefile b/docs/Makefile index d4bb2cb..d0c3cbf 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -5,8 +5,8 @@ # from the environment for the first two. SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build +SOURCEDIR = source +BUILDDIR = build # Put it first so that "make" without argument is like "make help". help: diff --git a/docs/make.bat b/docs/make.bat index 2119f51..6247f7e 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -7,8 +7,8 @@ REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) -set SOURCEDIR=. -set BUILDDIR=_build +set SOURCEDIR=source +set BUILDDIR=build if "%1" == "" goto help diff --git a/docs/conf.py b/docs/source/conf.py similarity index 97% rename from docs/conf.py rename to docs/source/conf.py index d79a150..214287e 100644 --- a/docs/conf.py +++ b/docs/source/conf.py @@ -39,7 +39,7 @@ templates_path = ['_templates'] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = [] # -- Options for HTML output ------------------------------------------------- diff --git a/docs/index.rst b/docs/source/index.rst similarity index 88% rename from docs/index.rst rename to docs/source/index.rst index bd6b02b..dfff865 100644 --- a/docs/index.rst +++ b/docs/source/index.rst @@ -1,5 +1,5 @@ .. SkoolOS documentation master file, created by - sphinx-quickstart on Tue Jun 16 11:01:18 2020. + sphinx-quickstart on Tue Jun 16 11:22:02 2020. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive.