From 0091c08d613c515f8297f49db63fb3a568255e5f Mon Sep 17 00:00:00 2001 From: raymondw2 <56237041+raymondw2@users.noreply.github.com> Date: Sat, 30 Oct 2021 18:59:51 -0700 Subject: [PATCH 1/3] Delete .ipynb_checkpoints directory --- .ipynb_checkpoints/d8error-checkpoint.py | 89 ------------------------ 1 file changed, 89 deletions(-) delete mode 100644 .ipynb_checkpoints/d8error-checkpoint.py diff --git a/.ipynb_checkpoints/d8error-checkpoint.py b/.ipynb_checkpoints/d8error-checkpoint.py deleted file mode 100644 index 8c1d661..0000000 --- a/.ipynb_checkpoints/d8error-checkpoint.py +++ /dev/null @@ -1,89 +0,0 @@ -from IPython.core.display import display, HTML, Markdown -import json -import os.path -import csv - -class Announce: - def __init__(self, etype, value): - self.etype = etype - self.value = value - self.errorname = str(etype().__class__.__name__) - with open("errorConfig.json", "r") as f: - diction = json.load(f) - exceptionClass = diction.get(self.errorname) - prewrittenMessge = False - - if exceptionClass is None: - self.print = False - else: - self.print = True - for i in exceptionClass: - key, items = list(i.items())[0] - if (key in str(value)): - prewrittenMessge = True - self.print = prewrittenMessge - - if not os.path.isfile("errorLog.csv"): - with open('errorLog.csv', 'w', newline='') as f: - - fieldnames = ['errorType', 'errorMSG'] - writer = csv.DictWriter(f, fieldnames=fieldnames) - writer.writerow({"errorType": self.errorname,"errorMSG": str(value)}) - else: - with open('errorLog.csv', 'a', newline='') as f: - - fieldnames = ['errorType', 'errorMSG'] - writer = csv.DictWriter(f, fieldnames=fieldnames) - writer.writerow({"errorType": self.errorname,"errorMSG": str(value)}) - - def tips(self): - etype = self.etype - value = self.value - - with open("errorConfig.json", "r") as f: - diction = json.load(f) - exceptionClass = diction.get(self.errorname) - if exceptionClass is not None: - self.default() - for i in exceptionClass: - key, items = list(i.items())[0] - if (key in str(value)): - c=1 - for j in items.get("helptext"): - - display(Markdown(str(c)+". "+j)) - c += 1 - def data8(self): - display(Markdown("The Data 8 Reference might be helpful to look over for examples and usage: [Data 8 Reference](http://data8.org/fa21/python-reference.html)")) - def furtherTips(self): - display(Markdown("If you are having more trouble please feel free to consult a staff member at [Office Hours](https://oh.data8.org)\ - \n or see the error message below ")) - def print(self, i): - display(Markdown) - def title(self): - display(Markdown("## **Uh-o it seems we have an error!**")) - def default(self): - display(Markdown("It seems we have a "+self.errorname+ ". " +self.errorname+ "s are usually because of:")) - def feedback(self): - display(Markdown("Please fill out this quick survey to help us improve the the error feedback [Data 8 Error Feedback Survey](https://forms.gle/6UZQjwZmAxVDMsBR6)")) - -def test_exception(self, etype, value, tb, tb_offset=None): - try: - announce = Announce(etype, value) - if announce.print: - announce.title() - announce.tips() - announce.data8() - announce.furtherTips() - announce.feedback() - self.showtraceback((etype, value, tb), tb_offset=tb_offset) - except: - self.showtraceback((etype, value, tb), tb_offset=tb_offset) - -get_ipython().set_custom_exc((Exception,), test_exception) - -if not os.path.isfile("errorLog.csv"): - with open('errorLog.csv', 'w', newline='') as f: - fieldnames = ['errorType', 'errorMSG'] - writer = csv.DictWriter(f, fieldnames=fieldnames) - From 87ddce8e88ba61243cd567d29c177005b57ac57c Mon Sep 17 00:00:00 2001 From: raymondw2 <56237041+raymondw2@users.noreply.github.com> Date: Sat, 30 Oct 2021 18:59:58 -0700 Subject: [PATCH 2/3] Delete __pycache__ directory --- __pycache__/d8error.cpython-39.pyc | Bin 3654 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 __pycache__/d8error.cpython-39.pyc diff --git a/__pycache__/d8error.cpython-39.pyc b/__pycache__/d8error.cpython-39.pyc deleted file mode 100644 index d860a40c17d2887cf6ffdd5e307cab32792877ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3654 zcmb_f%WoUU8K2o*E|*VHvJl(pYf`7Ksn(PoppL7isa-ox3|OigD|N#pU{;)2a;fDm zJu{RnVR@2I1q>HG7CBHr4|V^99{M-*yw{%cFBm=a`-TtE4;=z@iT!3~=k zDH3?f|L*wztq}4b94tN_3~s=y{tko_P9xH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X@Op8V`HxRmI?u5{6jM~`l%U4UZ&|kwl zyYfUKCgy&3gIkh*s8FD3TzqOnUY#x){%KwhqtSeT_RNufhR`=fNw$f`)47N6`T&uk8=P zgpy#RZl9RA2`F#UrhE?$xe4zK(%M{$)9CY>05+^P0-WaN&+bpnIE*5e3^mwTsMw=n z*xqGoDEGtx+BJGRu+75$K!T?mLp(9YSuUFU`A1j`ushQf#U7Y*PK+MHL|-*JkyyX> zS@ZY3{bv8><3HTqRKNZ7TK#nGd9!PbJX0?}$yc-4EeN!4fz(;C)#@jF7-1n$ZnYi( z=998OHeg!*0tp5T`AZ~dtr9)NfGmH7y%U2rJ&eFI2Lw}wLO>zpGH=K84!< zA&D7huvnpT2(@StDv(LmLV6BH5^Y;zeIW}-@Q;(A7au~ USQ4yGq_(Ozij^8 Date: Sat, 30 Oct 2021 19:00:08 -0700 Subject: [PATCH 3/3] Delete errorLog.csv --- errorLog.csv | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 errorLog.csv diff --git a/errorLog.csv b/errorLog.csv deleted file mode 100644 index ba6152c..0000000 --- a/errorLog.csv +++ /dev/null @@ -1,2 +0,0 @@ -FileNotFoundError,[Errno 2] No such file or directory: 'star_bakers.csv' -FileNotFoundError,[Errno 2] No such file or directory: 'star_bakers.csv'