Merge remote-tracking branch 'origin/development' into development

This commit is contained in:
Rushil Umaretiya 2020-06-16 23:10:07 -04:00
commit b3d05d236b
15 changed files with 11353 additions and 128 deletions

View File

@ -33,10 +33,10 @@ def getStudent(ion_user, password):
def getDB(user, pwd, url): def getDB(user, pwd, url):
""" """
Sends a GET request to url Sends a GET request to url
:param user: username param user: username
:param pwd: password param pwd: password
:param url: URL for request param url: URL for request
:return: json request response return: json request response
""" """
r = requests.get(url=url, auth=(user, pwd)) r = requests.get(url=url, auth=(user, pwd))
print("GET:" + str(r.status_code)) print("GET:" + str(r.status_code))
@ -46,11 +46,11 @@ def getDB(user, pwd, url):
def patchDB(user, pwd, data, url): def patchDB(user, pwd, data, url):
""" """
Sends a PATCH request to url Sends a PATCH request to url
:param user: username param user: username
:param pwd: password param pwd: password
:param url: URL for request param url: URL for request
:param data: data to request param data: data to request
:return: json request response return: json request response
""" """
r = requests.patch(url=url, data=data, auth=(user, pwd)) r = requests.patch(url=url, data=data, auth=(user, pwd))
print("PATCH:" + str(r.status_code)) print("PATCH:" + str(r.status_code))
@ -61,11 +61,11 @@ def patchDB(user, pwd, data, url):
def postDB(user, pwd, data, url): def postDB(user, pwd, data, url):
""" """
Sends a POST request to url Sends a POST request to url
:param user: username param user: username
:param pwd: password param pwd: password
:param url: URL for request param url: URL for request
:param data: data to request param data: data to request
:return: json request response return: json request response
""" """
r = requests.post(url=url, data=data, auth=(user, pwd)) r = requests.post(url=url, data=data, auth=(user, pwd))
print("POST:" + str(r.status_code)) print("POST:" + str(r.status_code))
@ -76,11 +76,11 @@ def postDB(user, pwd, data, url):
def putDB(user, pwd, data, url): def putDB(user, pwd, data, url):
""" """
Sends a PUT request to url Sends a PUT request to url
:param user: username param user: username
:param pwd: password param pwd: password
:param url: URL for request param url: URL for request
:param data: data to request param data: data to request
:return: json request response return: json request response
""" """
r = requests.put(url=url, data=data, auth=(user, pwd)) r = requests.put(url=url, data=data, auth=(user, pwd))
print("PUT:" + str(r.status_code)) print("PUT:" + str(r.status_code))
@ -91,10 +91,10 @@ def putDB(user, pwd, data, url):
def delDB(user, pwd, url): def delDB(user, pwd, url):
""" """
Sends a DELETE request to url Sends a DELETE request to url
:param user: username param user: username
:param pwd: password param pwd: password
:param url: URL for request param url: URL for request
:return: json request response return: json request response
""" """
r = requests.delete(url=url, auth=(user, pwd)) r = requests.delete(url=url, auth=(user, pwd))
print("DELETE:" + str(r.status_code)) print("DELETE:" + str(r.status_code))

View File

@ -566,7 +566,7 @@ class Teacher:
'path': path, 'path': path,
'classes': course['name'], 'classes': course['name'],
'teacher': self.username, 'teacher': self.username,
'due_date': due, 'due_date': str(due),
'owner':self.id 'owner':self.id
} }
postDB(self.username, self.password, ass, 'http://127.0.0.1:8000/api/assignments/') postDB(self.username, self.password, ass, 'http://127.0.0.1:8000/api/assignments/')
@ -740,9 +740,11 @@ class Teacher:
print("heheheh") print("heheheh")
# data = getTeacher("eharris1","PWD") data = getTeacher("eharris1",'hackgroup1')
# print(data) # print(data)
#t = Teacher(data, "PWD") t = Teacher(data, 'hackgroup1')
t.addAssignment("eharris1/Truck_eharris1/Assignment1", "Truck_eharris1", '2020-08-11 16:58:33.383124')
# t.makeClass("APLit_eharris1") # t.makeClass("APLit_eharris1")
# t.updateAssignment("eharris1/APLit_eharris1/BookReport", "APLit_eharris1", '2020-08-11 16:58:33.383124') # t.updateAssignment("eharris1/APLit_eharris1/BookReport", "APLit_eharris1", '2020-08-11 16:58:33.383124')
# ar = ['2022rkhondak','2022inafi','2023rumareti'] # ar = ['2022rkhondak','2022inafi','2023rumareti']
@ -752,6 +754,13 @@ class Teacher:
# t.getChanges('2022rkhondak','APLit_eharris1', 10) # t.getChanges('2022rkhondak','APLit_eharris1', 10)
''' '''
{
"name": "a",
"due_date": '2020-08-11 16:58:33.383124',
"path": "",
"teacher": ""
}
TO-DO TO-DO
- More checks - More checks
- add students to APLit_eharris1 - add students to APLit_eharris1

View File

@ -0,0 +1,55 @@
Start time: Tuesday, June 16, 2020 22:18:48
Event: Opened file
Event Path: /home/nkenschaft/Sysadmin/skoolos/bgservice/run.py
Timestamp: Tuesday, June 16, 2020 22:18:48
Event: Created file
Event Path: /home/nkenschaft/Sysadmin/skoolos/bgservice.run.html
Timestamp: Tuesday, June 16, 2020 22:18:48
Event: Opened file
Event Path: /home/nkenschaft/Sysadmin/skoolos/bgservice.run.html
Timestamp: Tuesday, June 16, 2020 22:18:48
wrote bgservice.run.html
Event: Wrote to a file
Event Path: /home/nkenschaft/Sysadmin/skoolos/bgservice.run.html
Timestamp: Tuesday, June 16, 2020 22:18:48
Event: Opened file
Event Path: /home/nkenschaft/Sysadmin/skoolos/bgservice/__pycache__/test.cpython-38.pyc
Timestamp: Tuesday, June 16, 2020 22:18:48
Event: Opened file
Event Path: /home/nkenschaft/Sysadmin/skoolos/bgservice/test.py
Timestamp: Tuesday, June 16, 2020 22:18:48
Event: Created file
Event Path: /home/nkenschaft/Sysadmin/skoolos/bgservice/__pycache__/test.cpython-38.pyc.139630150929712
Timestamp: Tuesday, June 16, 2020 22:18:48
Event: Opened file
Event Path: /home/nkenschaft/Sysadmin/skoolos/bgservice/__pycache__/test.cpython-38.pyc.139630150929712
Timestamp: Tuesday, June 16, 2020 22:18:48
Event: Wrote to a file
Event Path: /home/nkenschaft/Sysadmin/skoolos/bgservice/__pycache__/test.cpython-38.pyc.139630150929712
Timestamp: Tuesday, June 16, 2020 22:18:48
Event: Moved a file out
Event Path: /home/nkenschaft/Sysadmin/skoolos/bgservice/__pycache__/test.cpython-38.pyc.139630150929712
Timestamp: Tuesday, June 16, 2020 22:18:48
Event: Moved a file in
Event Path: /home/nkenschaft/Sysadmin/skoolos/bgservice/__pycache__/test.cpython-38.pyc
Timestamp: Tuesday, June 16, 2020 22:18:48
Event: Created file
Event Path: /home/nkenschaft/Sysadmin/skoolos/SkoolOS/logs/skoolos_06162020-221848
Timestamp: Tuesday, June 16, 2020 22:18:48
Event: Opened file
Event Path: /home/nkenschaft/Sysadmin/skoolos/SkoolOS/logs/skoolos_06162020-221848
Timestamp: Tuesday, June 16, 2020 22:18:48

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

187
bgservice.bgservice.html Normal file
View File

@ -0,0 +1,187 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module bgservice.bgservice</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="bgservice.html"><font color="#ffffff">bgservice</font></a>.bgservice</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/nkenschaft/Sysadmin/skoolos/bgservice/bgservice.py">/home/nkenschaft/Sysadmin/skoolos/bgservice/bgservice.py</a></font></td></tr></table>
<p><tt>A&nbsp;simple&nbsp;background&nbsp;service&nbsp;to&nbsp;log&nbsp;events&nbsp;in&nbsp;a&nbsp;directory,<br>
check&nbsp;for&nbsp;git&nbsp;commands&nbsp;in&nbsp;bash/zsh&nbsp;history,<br>
and&nbsp;check&nbsp;for&nbsp;non-whitelisted&nbsp;files&nbsp;in&nbsp;the&nbsp;watched&nbsp;directory.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="bgservice.checker.html">bgservice.checker</a><br>
<a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="pyinotify.html">pyinotify</a><br>
<a href="sys.html">sys</a><br>
</td><td width="25%" valign=top><a href="time.html">time</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="pyinotify.html#ProcessEvent">pyinotify.ProcessEvent</a>(<a href="pyinotify.html#_ProcessEvent">pyinotify._ProcessEvent</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="bgservice.bgservice.html#EventHandler">EventHandler</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="EventHandler">class <strong>EventHandler</strong></a>(<a href="pyinotify.html#ProcessEvent">pyinotify.ProcessEvent</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt><a href="#EventHandler">EventHandler</a>(pevent=None,&nbsp;**kargs)<br>
&nbsp;<br>
Custom&nbsp;event&nbsp;handler&nbsp;for&nbsp;watching&nbsp;a&nbsp;SkoolOS&nbsp;work&nbsp;directory<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="bgservice.bgservice.html#EventHandler">EventHandler</a></dd>
<dd><a href="pyinotify.html#ProcessEvent">pyinotify.ProcessEvent</a></dd>
<dd><a href="pyinotify.html#_ProcessEvent">pyinotify._ProcessEvent</a></dd>
<dd><a href="builtins.html#object">builtins.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="EventHandler-process_IN_CLOSE_WRITE"><strong>process_IN_CLOSE_WRITE</strong></a>(self, event)</dt><dd><tt>Generates&nbsp;an&nbsp;output&nbsp;to&nbsp;record&nbsp;for&nbsp;IN_CLOSE_WRITE&nbsp;events<br>
param&nbsp;event:&nbsp;event&nbsp;automatically&nbsp;passed&nbsp;to&nbsp;function<br>
return:&nbsp;none</tt></dd></dl>
<dl><dt><a name="EventHandler-process_IN_CREATE"><strong>process_IN_CREATE</strong></a>(self, event)</dt><dd><tt>Generates&nbsp;an&nbsp;output&nbsp;to&nbsp;record&nbsp;for&nbsp;IN_CREATE&nbsp;events<br>
param&nbsp;event:&nbsp;event&nbsp;automatically&nbsp;passed&nbsp;to&nbsp;function<br>
return:&nbsp;none</tt></dd></dl>
<dl><dt><a name="EventHandler-process_IN_DELETE"><strong>process_IN_DELETE</strong></a>(self, event)</dt><dd><tt>Generates&nbsp;an&nbsp;output&nbsp;to&nbsp;record&nbsp;for&nbsp;IN_DELETE&nbsp;events<br>
param&nbsp;event:&nbsp;event&nbsp;automatically&nbsp;passed&nbsp;to&nbsp;function<br>
return:&nbsp;none</tt></dd></dl>
<dl><dt><a name="EventHandler-process_IN_MOVED_FROM"><strong>process_IN_MOVED_FROM</strong></a>(self, event)</dt><dd><tt>Generates&nbsp;an&nbsp;output&nbsp;to&nbsp;record&nbsp;for&nbsp;IN_MOVED_FROM&nbsp;events<br>
param&nbsp;event:&nbsp;event&nbsp;automatically&nbsp;passed&nbsp;to&nbsp;function<br>
return:&nbsp;none</tt></dd></dl>
<dl><dt><a name="EventHandler-process_IN_MOVED_TO"><strong>process_IN_MOVED_TO</strong></a>(self, event)</dt><dd><tt>Generates&nbsp;an&nbsp;output&nbsp;to&nbsp;record&nbsp;for&nbsp;IN_MOVED_TO&nbsp;events<br>
param&nbsp;event:&nbsp;event&nbsp;automatically&nbsp;passed&nbsp;to&nbsp;function<br>
return:&nbsp;none</tt></dd></dl>
<dl><dt><a name="EventHandler-process_IN_OPEN"><strong>process_IN_OPEN</strong></a>(self, event)</dt><dd><tt>Generates&nbsp;an&nbsp;output&nbsp;to&nbsp;record&nbsp;for&nbsp;IN_OPEN&nbsp;events<br>
param&nbsp;event:&nbsp;event&nbsp;automatically&nbsp;passed&nbsp;to&nbsp;function<br>
return:&nbsp;none</tt></dd></dl>
<hr>
Methods inherited from <a href="pyinotify.html#ProcessEvent">pyinotify.ProcessEvent</a>:<br>
<dl><dt><a name="EventHandler-__call__"><strong>__call__</strong></a>(self, event)</dt><dd><tt>To&nbsp;behave&nbsp;like&nbsp;a&nbsp;functor&nbsp;the&nbsp;object&nbsp;must&nbsp;be&nbsp;callable.<br>
This&nbsp;method&nbsp;is&nbsp;a&nbsp;dispatch&nbsp;method.&nbsp;Its&nbsp;lookup&nbsp;order&nbsp;is:<br>
&nbsp;&nbsp;1.&nbsp;process_MASKNAME&nbsp;method<br>
&nbsp;&nbsp;2.&nbsp;process_FAMILY_NAME&nbsp;method<br>
&nbsp;&nbsp;3.&nbsp;otherwise&nbsp;calls&nbsp;process_default<br>
&nbsp;<br>
@param&nbsp;event:&nbsp;Event&nbsp;to&nbsp;be&nbsp;processed.<br>
@type&nbsp;event:&nbsp;Event&nbsp;object<br>
@return:&nbsp;By&nbsp;convention&nbsp;when&nbsp;used&nbsp;from&nbsp;the&nbsp;<a href="pyinotify.html#ProcessEvent">ProcessEvent</a>&nbsp;class:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;Returning&nbsp;False&nbsp;or&nbsp;None&nbsp;(default&nbsp;value)&nbsp;means&nbsp;keep&nbsp;on<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;executing&nbsp;next&nbsp;chained&nbsp;functors&nbsp;(see&nbsp;chain.py&nbsp;example).<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;Returning&nbsp;True&nbsp;instead&nbsp;means&nbsp;do&nbsp;not&nbsp;execute&nbsp;next<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;processing&nbsp;functions.<br>
@rtype:&nbsp;bool<br>
@raise&nbsp;ProcessEventError:&nbsp;Event&nbsp;object&nbsp;undispatchable,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unknown&nbsp;event.</tt></dd></dl>
<dl><dt><a name="EventHandler-__init__"><strong>__init__</strong></a>(self, pevent=None, **kargs)</dt><dd><tt>Enable&nbsp;chaining&nbsp;of&nbsp;<a href="pyinotify.html#ProcessEvent">ProcessEvent</a>&nbsp;instances.<br>
&nbsp;<br>
@param&nbsp;pevent:&nbsp;Optional&nbsp;callable&nbsp;object,&nbsp;will&nbsp;be&nbsp;called&nbsp;on&nbsp;event<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;processing&nbsp;(before&nbsp;self).<br>
@type&nbsp;pevent:&nbsp;callable<br>
@param&nbsp;kargs:&nbsp;This&nbsp;constructor&nbsp;is&nbsp;implemented&nbsp;as&nbsp;a&nbsp;template&nbsp;method<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delegating&nbsp;its&nbsp;optionals&nbsp;keyworded&nbsp;arguments&nbsp;to&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;method&nbsp;<a href="#EventHandler-my_init">my_init</a>().<br>
@type&nbsp;kargs:&nbsp;dict</tt></dd></dl>
<dl><dt><a name="EventHandler-my_init"><strong>my_init</strong></a>(self, **kargs)</dt><dd><tt>This&nbsp;method&nbsp;is&nbsp;called&nbsp;from&nbsp;<a href="pyinotify.html#ProcessEvent">ProcessEvent</a>.<a href="#EventHandler-__init__">__init__</a>().&nbsp;This&nbsp;method&nbsp;is<br>
empty&nbsp;here&nbsp;and&nbsp;must&nbsp;be&nbsp;redefined&nbsp;to&nbsp;be&nbsp;useful.&nbsp;In&nbsp;effect,&nbsp;if&nbsp;you<br>
need&nbsp;to&nbsp;specifically&nbsp;initialize&nbsp;your&nbsp;subclass'&nbsp;instance&nbsp;then&nbsp;you<br>
just&nbsp;have&nbsp;to&nbsp;override&nbsp;this&nbsp;method&nbsp;in&nbsp;your&nbsp;subclass.&nbsp;Then&nbsp;all&nbsp;the<br>
keyworded&nbsp;arguments&nbsp;passed&nbsp;to&nbsp;<a href="pyinotify.html#ProcessEvent">ProcessEvent</a>.<a href="#EventHandler-__init__">__init__</a>()&nbsp;will&nbsp;be<br>
transmitted&nbsp;as&nbsp;parameters&nbsp;to&nbsp;this&nbsp;method.&nbsp;Beware&nbsp;you&nbsp;MUST&nbsp;pass<br>
keyword&nbsp;arguments&nbsp;though.<br>
&nbsp;<br>
@param&nbsp;kargs:&nbsp;optional&nbsp;delegated&nbsp;arguments&nbsp;from&nbsp;<a href="#EventHandler-__init__">__init__</a>().<br>
@type&nbsp;kargs:&nbsp;dict</tt></dd></dl>
<dl><dt><a name="EventHandler-nested_pevent"><strong>nested_pevent</strong></a>(self)</dt></dl>
<dl><dt><a name="EventHandler-process_IN_Q_OVERFLOW"><strong>process_IN_Q_OVERFLOW</strong></a>(self, event)</dt><dd><tt>By&nbsp;default&nbsp;this&nbsp;method&nbsp;only&nbsp;reports&nbsp;warning&nbsp;messages,&nbsp;you&nbsp;can&nbsp;overredide<br>
it&nbsp;by&nbsp;subclassing&nbsp;<a href="pyinotify.html#ProcessEvent">ProcessEvent</a>&nbsp;and&nbsp;implement&nbsp;your&nbsp;own<br>
process_IN_Q_OVERFLOW&nbsp;method.&nbsp;The&nbsp;actions&nbsp;you&nbsp;can&nbsp;take&nbsp;on&nbsp;receiving&nbsp;this<br>
event&nbsp;is&nbsp;either&nbsp;to&nbsp;update&nbsp;the&nbsp;variable&nbsp;max_queued_events&nbsp;in&nbsp;order&nbsp;to<br>
handle&nbsp;more&nbsp;simultaneous&nbsp;events&nbsp;or&nbsp;to&nbsp;modify&nbsp;your&nbsp;code&nbsp;in&nbsp;order&nbsp;to<br>
accomplish&nbsp;a&nbsp;better&nbsp;filtering&nbsp;diminishing&nbsp;the&nbsp;number&nbsp;of&nbsp;raised&nbsp;events.<br>
Because&nbsp;this&nbsp;method&nbsp;is&nbsp;defined,&nbsp;IN_Q_OVERFLOW&nbsp;will&nbsp;never&nbsp;get<br>
transmitted&nbsp;as&nbsp;arguments&nbsp;to&nbsp;process_default&nbsp;calls.<br>
&nbsp;<br>
@param&nbsp;event:&nbsp;IN_Q_OVERFLOW&nbsp;event.<br>
@type&nbsp;event:&nbsp;dict</tt></dd></dl>
<dl><dt><a name="EventHandler-process_default"><strong>process_default</strong></a>(self, event)</dt><dd><tt>Default&nbsp;processing&nbsp;event&nbsp;method.&nbsp;By&nbsp;default&nbsp;does&nbsp;nothing.&nbsp;Subclass<br>
<a href="pyinotify.html#ProcessEvent">ProcessEvent</a>&nbsp;and&nbsp;redefine&nbsp;this&nbsp;method&nbsp;in&nbsp;order&nbsp;to&nbsp;modify&nbsp;its&nbsp;behavior.<br>
&nbsp;<br>
@param&nbsp;event:&nbsp;Event&nbsp;to&nbsp;be&nbsp;processed.&nbsp;Can&nbsp;be&nbsp;of&nbsp;any&nbsp;type&nbsp;of&nbsp;events&nbsp;but<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IN_Q_OVERFLOW&nbsp;events&nbsp;(see&nbsp;method&nbsp;process_IN_Q_OVERFLOW).<br>
@type&nbsp;event:&nbsp;Event&nbsp;instance</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="pyinotify.html#ProcessEvent">pyinotify.ProcessEvent</a>:<br>
<dl><dt><strong>pevent</strong> = None</dl>
<hr>
Methods inherited from <a href="pyinotify.html#_ProcessEvent">pyinotify._ProcessEvent</a>:<br>
<dl><dt><a name="EventHandler-__repr__"><strong>__repr__</strong></a>(self)</dt><dd><tt>Return&nbsp;repr(self).</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="pyinotify.html#_ProcessEvent">pyinotify._ProcessEvent</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-stop_watching"><strong>stop_watching</strong></a>()</dt><dd><tt>Stops&nbsp;the&nbsp;watch&nbsp;started&nbsp;by&nbsp;<a href="#-watch_dir">watch_dir</a>()<br>
return:&nbsp;none</tt></dd></dl>
<dl><dt><a name="-watch_dir"><strong>watch_dir</strong></a>(watched_dir='/home/nkenschaft', log_dir='SkoolOS/logs')</dt><dd><tt>Watches&nbsp;the&nbsp;specified&nbsp;directory&nbsp;for&nbsp;changes&nbsp;and&nbsp;outputs&nbsp;it&nbsp;in<br>
human&nbsp;readable&nbsp;format&nbsp;to&nbsp;a&nbsp;log&nbsp;file&nbsp;in&nbsp;the&nbsp;specified&nbsp;log&nbsp;directory.<br>
param&nbsp;watched_dir:&nbsp;directory&nbsp;to&nbsp;watch&nbsp;for&nbsp;changes<br>
param&nbsp;log_dir:&nbsp;directory&nbsp;to&nbsp;store&nbsp;log&nbsp;files<br>
return:&nbsp;none</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>DIR</strong> = None<br>
<strong>NOTIFIER</strong> = None<br>
<strong>START_TIME</strong> = None<br>
<strong>STDOUT</strong> = &lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='utf-8'&gt;</td></tr></table>
</body></html>

44
bgservice.checker.html Normal file
View File

@ -0,0 +1,44 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module bgservice.checker</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="bgservice.html"><font color="#ffffff">bgservice</font></a>.checker</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/nkenschaft/Sysadmin/skoolos/bgservice/checker.py">/home/nkenschaft/Sysadmin/skoolos/bgservice/checker.py</a></font></td></tr></table>
<p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="os.html">os</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-file_check"><strong>file_check</strong></a>(dir_)</dt><dd><tt>Checks&nbsp;specified&nbsp;dir_&nbsp;for&nbsp;non-whitelisted&nbsp;files&nbsp;using&nbsp;<a href="#-verify_file">verify_file</a>()<br>
param&nbsp;dir_:&nbsp;directory&nbsp;to&nbsp;check<br>
return:&nbsp;list&nbsp;of&nbsp;suspicious&nbsp;files</tt></dd></dl>
<dl><dt><a name="-shell_check"><strong>shell_check</strong></a>()</dt><dd><tt>Check&nbsp;.bash_history&nbsp;and&nbsp;.histfile&nbsp;for&nbsp;git&nbsp;commands&nbsp;that&nbsp;could&nbsp;interfere&nbsp;with&nbsp;SkoolOS<br>
return:&nbsp;results&nbsp;of&nbsp;the&nbsp;check</tt></dd></dl>
<dl><dt><a name="-verify_file"><strong>verify_file</strong></a>(file_)</dt><dd><tt>Check&nbsp;if&nbsp;the&nbsp;file&nbsp;name&nbsp;has&nbsp;an&nbsp;extension&nbsp;in&nbsp;the&nbsp;list&nbsp;of&nbsp;whitelisted&nbsp;file&nbsp;exentsions<br>
param&nbsp;file_:&nbsp;path&nbsp;to&nbsp;file<br>
return:&nbsp;whether&nbsp;or&nbsp;not&nbsp;the&nbsp;file's&nbsp;extension&nbsp;is&nbsp;whitelisted</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>file_whitelist</strong> = ['.doc', '.docx', '.odt', '.pdf', '.rtf', '.tex', '.txt', '.wpd', '.3g2', '.3gp', '.avi', '.flv', '.h264', '.m4v', '.mkv', '.mov', '.mp4', '.mpg', '.mpeg', '.rm', ...]</td></tr></table>
</body></html>

23
bgservice.html Normal file
View File

@ -0,0 +1,23 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: package bgservice</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>bgservice</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/nkenschaft/Sysadmin/skoolos/bgservice/__init__.py">/home/nkenschaft/Sysadmin/skoolos/bgservice/__init__.py</a></font></td></tr></table>
<p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="bgservice.bgservice.html">bgservice</a><br>
</td><td width="25%" valign=top><a href="bgservice.checker.html">checker</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table>
</body></html>

View File

@ -12,6 +12,9 @@ from pathlib import Path
class EventHandler(pyinotify.ProcessEvent): class EventHandler(pyinotify.ProcessEvent):
"""
Custom event handler for watching a SkoolOS work directory
"""
_methods = [ _methods = [
"IN_CREATE", "IN_CREATE",
"IN_CLOSE_WRITE", "IN_CLOSE_WRITE",
@ -24,8 +27,8 @@ class EventHandler(pyinotify.ProcessEvent):
def process_IN_CREATE(self, event): def process_IN_CREATE(self, event):
""" """
Generates an output to record for IN_CREATE events Generates an output to record for IN_CREATE events
:param event: event automatically passed to function param event: event automatically passed to function
:return: none return: none
""" """
description = \ description = \
"Event: Created file\n" \ "Event: Created file\n" \
@ -39,8 +42,8 @@ class EventHandler(pyinotify.ProcessEvent):
def process_IN_CLOSE_WRITE(self, event): def process_IN_CLOSE_WRITE(self, event):
""" """
Generates an output to record for IN_CLOSE_WRITE events Generates an output to record for IN_CLOSE_WRITE events
:param event: event automatically passed to function param event: event automatically passed to function
:return: none return: none
""" """
description = \ description = \
"Event: Wrote to a file\n" \ "Event: Wrote to a file\n" \
@ -54,8 +57,8 @@ class EventHandler(pyinotify.ProcessEvent):
def process_IN_DELETE(self, event): def process_IN_DELETE(self, event):
""" """
Generates an output to record for IN_DELETE events Generates an output to record for IN_DELETE events
:param event: event automatically passed to function param event: event automatically passed to function
:return: none return: none
""" """
description = \ description = \
"Event: Deleted file\n" \ "Event: Deleted file\n" \
@ -69,8 +72,8 @@ class EventHandler(pyinotify.ProcessEvent):
def process_IN_MOVED_TO(self, event): def process_IN_MOVED_TO(self, event):
""" """
Generates an output to record for IN_MOVED_TO events Generates an output to record for IN_MOVED_TO events
:param event: event automatically passed to function param event: event automatically passed to function
:return: none return: none
""" """
description = \ description = \
"Event: Moved a file in\n" \ "Event: Moved a file in\n" \
@ -84,8 +87,8 @@ class EventHandler(pyinotify.ProcessEvent):
def process_IN_MOVED_FROM(self, event): def process_IN_MOVED_FROM(self, event):
""" """
Generates an output to record for IN_MOVED_FROM events Generates an output to record for IN_MOVED_FROM events
:param event: event automatically passed to function param event: event automatically passed to function
:return: none return: none
""" """
description = \ description = \
"Event: Moved a file out\n" \ "Event: Moved a file out\n" \
@ -99,8 +102,8 @@ class EventHandler(pyinotify.ProcessEvent):
def process_IN_OPEN(self, event): def process_IN_OPEN(self, event):
""" """
Generates an output to record for IN_OPEN events Generates an output to record for IN_OPEN events
:param event: event automatically passed to function param event: event automatically passed to function
:return: none return: none
""" """
description = \ description = \
"Event: Opened file\n" \ "Event: Opened file\n" \
@ -122,9 +125,9 @@ def watch_dir(watched_dir=str(Path.home()), log_dir="SkoolOS/logs"):
""" """
Watches the specified directory for changes and outputs it in Watches the specified directory for changes and outputs it in
human readable format to a log file in the specified log directory. human readable format to a log file in the specified log directory.
:param watched_dir: directory to watch for changes param watched_dir: directory to watch for changes
:param log_dir: directory to store log files param log_dir: directory to store log files
:return: none return: none
""" """
global DIR global DIR
global START_TIME global START_TIME
@ -152,7 +155,7 @@ def watch_dir(watched_dir=str(Path.home()), log_dir="SkoolOS/logs"):
def stop_watching(): def stop_watching():
""" """
Stops the watch started by watch_dir() Stops the watch started by watch_dir()
:return: none return: none
""" """
NOTIFIER.stop() NOTIFIER.stop()
now = time.time() now = time.time()

View File

@ -70,7 +70,7 @@ file_whitelist = [
def shell_check(): def shell_check():
""" """
Check .bash_history and .histfile for git commands that could interfere with SkoolOS Check .bash_history and .histfile for git commands that could interfere with SkoolOS
:return: results of the check return: results of the check
""" """
bash_history = [ bash_history = [
line.strip() line.strip()
@ -93,8 +93,8 @@ def shell_check():
def verify_file(file_): def verify_file(file_):
""" """
Check if the file name has an extension in the list of whitelisted file exentsions Check if the file name has an extension in the list of whitelisted file exentsions
:param file_: path to file param file_: path to file
:return: whether or not the file's extension is whitelisted return: whether or not the file's extension is whitelisted
""" """
for ext in file_whitelist: for ext in file_whitelist:
if len(file_) > len(ext): if len(file_) > len(ext):
@ -106,8 +106,8 @@ def verify_file(file_):
def file_check(dir_): def file_check(dir_):
""" """
Checks specified dir_ for non-whitelisted files using verify_file() Checks specified dir_ for non-whitelisted files using verify_file()
:param dir_: directory to check param dir_: directory to check
:return: list of suspicious files return: list of suspicious files
""" """
files = glob(dir_ + "/**/*", recursive=True) files = glob(dir_ + "/**/*", recursive=True)
suspicious_files = [] suspicious_files = []

View File

@ -1,2 +0,0 @@
import bgservice as bg
bg.watch_dir()

View File

@ -1,4 +0,0 @@
import bgservice as bg
bg.watch_dir()
input()
bg.stop_watching()

View File

@ -1,2 +1,5 @@
Background Service Background Service
================= =================
This requires no user input. The proper events are
called by the main application to log events in the student's work directory.

View File

@ -17,23 +17,22 @@ Enter the valid SkoolOS username and password. Congratialations, you have succes
1. CLI as a teacher: 1. CLI as a teacher:
============ ============
Start the CLI and select your username. For instance, teacher 'eharris1' Start the CLI and select your username. For instance, teacher 'eharris1'::
.. code-block:: python
python skoolos.py python skoolos.py
? Select User: (Use arrow keys) ? Select User: (Use arrow keys)
1) 2022rkhondak 1) 2022rkhondak
2) eharris1 2) eharris1
3) Make new user 3) Make new user
You will then be given the choice to select an existing class, Make a new class, or exit the CLI: You will then be given the choice to select an existing class, Make a new class, or exit the CLI:::
? Select class: (Use arrow keys) ? Select class: (Use arrow keys)
Art12_eharris1 Art12_eharris1
English12_eharris1 English12_eharris1
History12_eharris1 History12_eharris1
Make New Class Make New Class
Exit SkoolOS Exit SkoolOS
Making a new class: Making a new class:
------- -------
@ -41,85 +40,77 @@ Making a new class:
Select 'Make a New Class'. You will then be prompted to enter a class name. The format for every class must be <subject>_<teacher_username> (Example: Art12_eharris1). Select 'Make a New Class'. You will then be prompted to enter a class name. The format for every class must be <subject>_<teacher_username> (Example: Art12_eharris1).
Enter Period (must be a positive integer). You will then be prompted to add students. If you have a list of students, enter the relative path of a text file with the student usernames. Enter Period (must be a positive integer). You will then be prompted to add students. If you have a list of students, enter the relative path of a text file with the student usernames.
The file must be a .txt file and have one student username per line. If you add an individual student, simply enter their ion username. The file must be a .txt file and have one student username per line. If you add an individual student, simply enter their ion username.
one username per line. one username per line.::
? Select class: (Use arrow keys) ? Select class: (Use arrow keys)
Art12_eharris1 Art12_eharris1
English12_eharris1 English12_eharris1
History12_eharris1 History12_eharris1
Make New Class Make New Class
Exit SkoolOS Exit SkoolOS
? Add Students): (Use arrow keys)
1) Add individual student
2) Add list of students through path
3) Exit
? Add Students): 2) Add list of students through path
File must be .txt and have 1 student username per line
Relative Path: students.txt
? Add Students): (Use arrow keys) OR::
1) Add individual student
2) Add list of students through path
3) Exit
? Add Students): 2) Add list of students through path ? Add Students): 1) Add individual student
File must be .txt and have 1 student username per line Student name: 2022rkhondak
Relative Path: students.txt
OR
? Add Students): 1) Add individual student
Student name: 2022rkhondak
Accessing an existing class Accessing an existing class
===================== =====================
Once you have created a class, you can then view and modify certain fields. (Open opening a class, any students who have accepted the request will be automatically Once you have created a class, you can then view and modify certain fields. (Open opening a class, any students who have accepted the request will be automatically
added you the class.) added you the class.)::
? Select class: (Use arrow keys) ? Select class: (Use arrow keys)
Art12_eharris1 Art12_eharris1
Civ_eharris1 Civ_eharris1
English12_eharris1 English12_eharris1
History12_eharris1 History12_eharris1
Random_eharris1 Random_eharris1
Truck_eharris1 Truck_eharris1
Make New Class Make New Class
Exit SkoolOS Exit SkoolOS
Class: English12_eharris1 Class: English12_eharris1
? Select option: (Use arrow keys) ? Select option: (Use arrow keys)
1) Request Student 1) Request Student
2) Add assignment 2) Add assignment
3) View student information 3) View student information
4) Exit 4) Exit
Requesting Students Requesting Students
------- -------
Select 'Request Student'. You will then be prompted to add students. If you have a list of students, enter the relative path of a text file with the student usernames. Select 'Request Student'. You will then be prompted to add students. If you have a list of students, enter the relative path of a text file with the student usernames.
The file must be a .txt file and have one student username per line. If you add an individual student, simply enter their ion username. The file must be a .txt file and have one student username per line. If you add an individual student, simply enter their ion username.
one username per line. one username per line.::
Class: English12_eharris1
? Select option: (Use arrow keys)
1) Request Student
2) Add assignment
3) View student information
4) Exit
? Add list of students (input path): (Use arrow keys)
1) Add individual student
2) Add list of students through path
3) Exit
? Select option: 1) Request Student
? Add list of students (input path): 1) Add individual student
? Student Name: 2022rkhondak
OR
? Add Students): 2) Add list of students through path
File must be .txt and have 1 student username per line
Relative Path: students.txt
Class: English12_eharris1
? Select option: (Use arrow keys)
1) Request Student
2) Add assignment
3) View student information
4) Exit
? Add list of students (input path): (Use arrow keys)
1) Add individual student
2) Add list of students through path
3) Exit
? Select option: 1) Request Student
? Add list of students (input path): 1) Add individual student
? Student Name: 2022rkhondak
OR::
? Add Students): 2) Add list of students through path
File must be .txt and have 1 student username per line
Relative Path: students.txt

112
skoolos.html Normal file
View File

@ -0,0 +1,112 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module skoolos</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>skoolos</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/nkenschaft/Sysadmin/skoolos/skoolos.py">/home/nkenschaft/Sysadmin/skoolos/skoolos.py</a></font></td></tr></table>
<p><tt>The&nbsp;main&nbsp;program&nbsp;file&nbsp;for&nbsp;SkoolOS</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="argparse.html">argparse</a><br>
<a href="datetime.html">datetime</a><br>
<a href="http.html">http</a><br>
</td><td width="25%" valign=top><a href="json.html">json</a><br>
<a href="os.html">os</a><br>
<a href="pprint.html">pprint</a><br>
</td><td width="25%" valign=top><a href="requests.html">requests</a><br>
<a href="socketserver.html">socketserver</a><br>
<a href="sys.html">sys</a><br>
</td><td width="25%" valign=top><a href="time.html">time</a><br>
<a href="webbrowser.html">webbrowser</a><br>
<a href="selenium.webdriver.html">selenium.webdriver</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-addAssignmentTeacher"><strong>addAssignmentTeacher</strong></a>(teacher, course)</dt></dl>
<dl><dt><a name="-addStudentsTeacher"><strong>addStudentsTeacher</strong></a>(teacher, course)</dt></dl>
<dl><dt><a name="-authenticate"><strong>authenticate</strong></a>()</dt><dd><tt>Authenticates&nbsp;the&nbsp;user&nbsp;via&nbsp;Ion&nbsp;OAuth</tt></dd></dl>
<dl><dt><a name="-chooseClassStudent"><strong>chooseClassStudent</strong></a>(student)</dt><dd><tt>Chooses&nbsp;a&nbsp;class&nbsp;for&nbsp;a&nbsp;student&nbsp;to&nbsp;view&nbsp;and&nbsp;work&nbsp;on<br>
param&nbsp;student:&nbsp;a&nbsp;student<br>
return:&nbsp;a&nbsp;course&nbsp;prompt</tt></dd></dl>
<dl><dt><a name="-chooseGeneralTeacher"><strong>chooseGeneralTeacher</strong></a>(teacher)</dt></dl>
<dl><dt><a name="-classOptionsStudent"><strong>classOptionsStudent</strong></a>(student, course)</dt><dd><tt>Allows&nbsp;students&nbsp;to&nbsp;choose&nbsp;what&nbsp;they&nbsp;want&nbsp;to&nbsp;do&nbsp;related&nbsp;to&nbsp;a&nbsp;class<br>
The&nbsp;student&nbsp;can&nbsp;save,&nbsp;exit,&nbsp;or&nbsp;go&nbsp;back<br>
param&nbsp;student:&nbsp;a&nbsp;student<br>
param&nbsp;course:&nbsp;a&nbsp;course<br>
return:&nbsp;True&nbsp;if&nbsp;exiting,&nbsp;False&nbsp;if&nbsp;going&nbsp;back</tt></dd></dl>
<dl><dt><a name="-classOptionsTeacher"><strong>classOptionsTeacher</strong></a>(teacher, course)</dt></dl>
<dl><dt><a name="-create_server"><strong>create_server</strong></a>()</dt><dd><tt>Creates&nbsp;a&nbsp;simple&nbsp;HTTP&nbsp;server&nbsp;for&nbsp;creating&nbsp;api&nbsp;requests&nbsp;from&nbsp;the&nbsp;CLI</tt></dd></dl>
<dl><dt><a name="-delDB"><strong>delDB</strong></a>(USER, PWD, url)</dt><dd><tt>Sends&nbsp;a&nbsp;DELETE&nbsp;request&nbsp;to&nbsp;url<br>
param&nbsp;USER:&nbsp;username<br>
param&nbsp;PWD:&nbsp;password<br>
param&nbsp;url:&nbsp;URL&nbsp;for&nbsp;request<br>
return:&nbsp;json&nbsp;request&nbsp;response</tt></dd></dl>
<dl><dt><a name="-getDB"><strong>getDB</strong></a>(USER, PWD, url)</dt><dd><tt>Sends&nbsp;a&nbsp;GET&nbsp;request&nbsp;to&nbsp;url<br>
param&nbsp;USER:&nbsp;username<br>
param&nbsp;PWD:&nbsp;password<br>
param&nbsp;url:&nbsp;URL&nbsp;for&nbsp;request<br>
return:&nbsp;json&nbsp;request&nbsp;response</tt></dd></dl>
<dl><dt><a name="-getUser"><strong>getUser</strong></a>(ion_user, password, utype)</dt><dd><tt>Returns&nbsp;user&nbsp;information<br>
param&nbsp;ion_user:&nbsp;user<br>
param&nbsp;password:&nbsp;user's&nbsp;password<br>
param&nbsp;utype:&nbsp;type&nbsp;of&nbsp;user&nbsp;(student&nbsp;or&nbsp;teacher<br>
return:&nbsp;api&nbsp;user&nbsp;information</tt></dd></dl>
<dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>The&nbsp;Command&nbsp;Line&nbsp;Interface&nbsp;(CLI)&nbsp;for&nbsp;SkoolOS<br>
Serves&nbsp;to&nbsp;allow&nbsp;both&nbsp;teachers&nbsp;and&nbsp;students&nbsp;to&nbsp;access&nbsp;the&nbsp;majority&nbsp;of&nbsp;the&nbsp;features&nbsp;of&nbsp;SkoolOS</tt></dd></dl>
<dl><dt><a name="-makeClassTeacher"><strong>makeClassTeacher</strong></a>(teacher)</dt></dl>
<dl><dt><a name="-makePass"><strong>makePass</strong></a>()</dt><dd><tt>Prompts&nbsp;the&nbsp;user&nbsp;to&nbsp;create&nbsp;a&nbsp;password<br>
return:&nbsp;the&nbsp;password</tt></dd></dl>
<dl><dt><a name="-patchDB"><strong>patchDB</strong></a>(USER, PWD, url, data)</dt><dd><tt>Sends&nbsp;a&nbsp;PATCH&nbsp;request&nbsp;to&nbsp;url<br>
param&nbsp;USER:&nbsp;username<br>
param&nbsp;PWD:&nbsp;password<br>
param&nbsp;url:&nbsp;URL&nbsp;for&nbsp;request<br>
param&nbsp;data:&nbsp;data&nbsp;to&nbsp;request<br>
return:&nbsp;json&nbsp;request&nbsp;response</tt></dd></dl>
<dl><dt><a name="-postDB"><strong>postDB</strong></a>(USER, PWD, url, data)</dt><dd><tt>Sends&nbsp;a&nbsp;POST&nbsp;request&nbsp;to&nbsp;url<br>
param&nbsp;USER:&nbsp;username<br>
param&nbsp;PWD:&nbsp;password<br>
param&nbsp;url:&nbsp;URL&nbsp;for&nbsp;request<br>
param&nbsp;data:&nbsp;data&nbsp;to&nbsp;request<br>
return:&nbsp;json&nbsp;request&nbsp;response</tt></dd></dl>
<dl><dt><a name="-putDB"><strong>putDB</strong></a>(USER, PWD, url, data)</dt><dd><tt>Sends&nbsp;a&nbsp;PUT&nbsp;request&nbsp;to&nbsp;url<br>
param&nbsp;USER:&nbsp;username<br>
param&nbsp;PWD:&nbsp;password<br>
param&nbsp;url:&nbsp;URL&nbsp;for&nbsp;request<br>
param&nbsp;data:&nbsp;data&nbsp;to&nbsp;request<br>
return:&nbsp;json&nbsp;request&nbsp;response</tt></dd></dl>
<dl><dt><a name="-studentCLI"><strong>studentCLI</strong></a>(user, password)</dt><dd><tt>The&nbsp;CLI&nbsp;for&nbsp;students&nbsp;to&nbsp;access<br>
param&nbsp;user:&nbsp;student&nbsp;username<br>
param&nbsp;password:&nbsp;student&nbsp;password</tt></dd></dl>
<dl><dt><a name="-teacherCLI"><strong>teacherCLI</strong></a>(user, password)</dt><dd><tt>The&nbsp;CLI&nbsp;for&nbsp;teachers&nbsp;to&nbsp;access<br>
param&nbsp;user:&nbsp;teachers&nbsp;username<br>
param&nbsp;password:&nbsp;teachers&nbsp;password</tt></dd></dl>
<dl><dt><a name="-viewStudentsTeacher"><strong>viewStudentsTeacher</strong></a>(teacher, course)</dt></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>PWD</strong> = ''<br>
<strong>USER</strong> = ''<br>
<strong>client_id</strong> = 'QeZPBSKqdvWFfBv1VYTSv9iFGz5T9pVJtNUjbEr6'<br>
<strong>client_secret</strong> = '0Wl3hAIGY9SvYOqTOLUiLNYa4OlCgZYdno9ZbcgCT7RGQ8x2...mOADHIv5fHxaa7GqFNtQr11HX9ySTw3DscKsphCVi5P71mlGY'<br>
<strong>redirect_uri</strong> = 'http://localhost:8000/callback/'<br>
<strong>scope</strong> = ['read']<br>
<strong>token_url</strong> = 'https://ion.tjhsst.edu/oauth/token/'</td></tr></table>
</body></html>