From 1d215b66989f564a5a7472a0a125d40fcbd5261b Mon Sep 17 00:00:00 2001
From: Sebastian David <sebastian.david@uni-hamburg.de>
Date: Wed, 15 Dec 2021 12:00:16 +0100
Subject: [PATCH] letzte Aenderungen vor dem merge request

---
 citation_parser_ui.py                         |  28 ++++++++-----
 input/get/__pycache__/__init__.cpython-38.pyc | Bin 175 -> 153 bytes
 input/get/__pycache__/acs.cpython-38.pyc      | Bin 4215 -> 4193 bytes
 .../journal_fetcher.cpython-38.pyc            | Bin 3815 -> 3793 bytes
 input/get/__pycache__/nature.cpython-38.pyc   | Bin 1654 -> 1632 bytes
 ui_programm_fragmente/README.md               |  38 ++++++++++++++++++
 6 files changed, 55 insertions(+), 11 deletions(-)
 create mode 100644 ui_programm_fragmente/README.md

diff --git a/citation_parser_ui.py b/citation_parser_ui.py
index fd7ee84..453ead9 100644
--- a/citation_parser_ui.py
+++ b/citation_parser_ui.py
@@ -14,7 +14,8 @@ app = dash.Dash(__name__)
 # List of options when inputting data and generating the graph
 additional_options = ['Update Automatically','Smart Input']
 
-# Reads the contents of info_box.txt. They can later be displayed by pressing the corresponding button.
+# Reads the contents of info_box.txt. 
+# They can later be displayed by pressing the corresponding button.
 f = open('info_box.txt', 'r')
 boxcontent = f.read()
 f.close()
@@ -28,13 +29,14 @@ app.layout = html.Div([
     # Layer 1: For all mandatory Inputs
     html.Div([
         "Input: ",
-        # A simple box for inputting a string. Value is transmitted upon pressen return or clicking out of the box.
+        # A simple box for inputting a string. 
+        # Value is transmitted upon pressing return or clicking out of the box.
         dcc.Input(id='input-string', value='', type='text',debounce=True),
         # Forward recursion. Values between 1 and 10 can be entered.
         dcc.Input(id='forward-depth',value='1',type='number',min='1',max='10'),
         # Backward recursion. Values between 1 and 10 can be entered.
         dcc.Input(id='backward-depth',value='1',type='number',min='1',max='10'),
-        # Upload box. Can be used via drag-and-drop or byclicking on it to open a file viewer. 
+        # Upload box. Can be used via drag-and-drop or byclicking on it to open a file viewer.
         dcc.Upload(
             id="upload-data",
             children=html.Div(
@@ -52,8 +54,10 @@ app.layout = html.Div([
     ]),
     # Layer 2: For the checklist, Remove-/Start-Buttons and input-error-message
     html.Div([
-        # All input DOIs are collected in this checklist. It is initialized to avoid error messages.
-        dcc.Checklist(id='input-checklist',options=[],labelStyle = dict(display='block'),value=[]),
+        # All input DOIs are collected in this checklist. 
+        # It is initialized to avoid error messages.
+        dcc.Checklist(id='input-checklist',options=[],
+            labelStyle = dict(display='block'),value=[]),
         # Displays error message if 'Smart Input' is active.
         html.Div(id='input-err',style={'color':'red'}),
         # Clears the entire list.
@@ -90,7 +94,8 @@ app.layout = html.Div([
     State('input-checklist','value'),
     State('additional-options','value')
 )
-def update_input_checklist(input_value,btn1,btn2,filecontents,all_inputs,selected_inputs,additional_options):
+def update_input_checklist(input_value,btn1,btn2,filecontents,all_inputs,
+        selected_inputs,additional_options):
     '''
     Most important callback function. Updates the checklist that holds all inputs.
     State of the checklist as input is needed so that previews entries are readded.
@@ -140,11 +145,12 @@ def update_input_checklist(input_value,btn1,btn2,filecontents,all_inputs,selecte
                     # Attempts to call get_publication. If unsuccesful, 
                     # the DOI is not added and an error message is returned
                     i = InputInterface()
-                    pub = i.get_publication(input_value)
+                    pub = i.get_pub_light(input_value)
                 except Exception as err:
                     return options,selected_inputs,'','{}'.format(err)
                 # Creates a more readable string to display in the checklist
-                rep_str = pub.contributors[0] + ',' + pub.journal + ',' + pub.publication_date
+                rep_str = pub.contributors[0] + ',' + pub.journal + \
+                        ',' + pub.publication_date
                 all_inputs.append({'label':rep_str, 'value':input_value})
             
             # if 'Smart Input' is not selected, the input value is added as is,
@@ -169,10 +175,11 @@ def update_input_checklist(input_value,btn1,btn2,filecontents,all_inputs,selecte
                     if 'Smart Input' in additional_options:
                         try:
                             i = InputInterface()
-                            pub = i.get_publication(input_value)
+                            pub = i.get_pub_light(input_value)
                         except Exception as err:
                             return all_inputs,selected_inputs,'','{}'.format(err)
-                        rep_str = pub.contributors[0] + ',' + pub.journal + ',' + pub.publication_date
+                        rep_str = pub.contributors[0] + ',' + pub.journal + \
+                                ',' + pub.publication_date
                         all_inputs.append({'label':rep_str, 'value':input_value})
                     else:
                         all_inputs.append({'label':input_value,'value':input_value})
@@ -181,7 +188,6 @@ def update_input_checklist(input_value,btn1,btn2,filecontents,all_inputs,selecte
     # if this is not done, the input_checklist will be generated 
     # with one element that contains an empty string
     if input_value == '':
-        app.layout['input-checklist'].options.clear()
         return list(),list(),'',''
 
 @app.callback(
diff --git a/input/get/__pycache__/__init__.cpython-38.pyc b/input/get/__pycache__/__init__.cpython-38.pyc
index 8f81f36aaccfa12fdee27996811a2c67cc19fff8..a1e24ad908499dfeb45afebf60601d0704dbbbcb 100644
GIT binary patch
delta 27
jcmZ3_IFpe(l$V!_fq{X+_r}_Z+%}AM6FoF1wrc<YR`mw@

delta 49
zcmbQqxSo+al$V!_fq{YH$IGP?xosFjCVFU!mS)Bm6y>KECFbVFrxhip=ceYBq)sf*
F1OROz5Pbju

diff --git a/input/get/__pycache__/acs.cpython-38.pyc b/input/get/__pycache__/acs.cpython-38.pyc
index 0f8c362e84d5ccbbdf32f8310eeafd1376ab1977..f3585b798ebbeab22676f00cc409ef48cd6b6019 100644
GIT binary patch
delta 31
ncmeya@KAv}l$V!_fq{X+_r}_d+$PM7mXjTrH8<BY|KI@tia`j}

delta 53
zcmaE;@LhpBl$V!_fq{WRC2sjfZWCrk|H%%_nxdtd@dZWs=|zdTx$$X5iRrnic_pcv
JGnjw!005Fj5c&WB

diff --git a/input/get/__pycache__/journal_fetcher.cpython-38.pyc b/input/get/__pycache__/journal_fetcher.cpython-38.pyc
index 894af00c5d09c44d55f9e5d9a60d05409a7620db..3be8ddceae79b7f027f194a2c4cec6c1fe9575a5 100644
GIT binary patch
delta 31
ncmaDZdr_7<l$V!_fq{X+_r}_d+{>65T_<m1*4+G&`5PAik!K1F

delta 53
zcmca8`&^bgl$V!_fq{YH$IGP~xtB3BMo-?vtSMTW8DCJ8pI(%hn;V~2l$f5Inpcv#
J`4;ncE&$-j6ORA@

diff --git a/input/get/__pycache__/nature.cpython-38.pyc b/input/get/__pycache__/nature.cpython-38.pyc
index 47affbf4e197c535229a9e2bbecf3988abfad115..6008e587da3dab81c3c79bb42345b63f0226ebbd 100644
GIT binary patch
delta 31
ncmeyy^MHptl$V!_fq{X+_r}_d+-6LSHj|y0G&eUgePsp!g{TOm

delta 53
zcmaFB^Noi)l$V!_fq{YH$IGP~xy_gugC;vMX^NI+#upUjrxzvW=EkQLC8p=5=9Q#w
J&SLt;3;@7?5+?uv

diff --git a/ui_programm_fragmente/README.md b/ui_programm_fragmente/README.md
new file mode 100644
index 0000000..d3a7e43
--- /dev/null
+++ b/ui_programm_fragmente/README.md
@@ -0,0 +1,38 @@
+# Projekt CiS-Biochemie 2021-22 UI
+
+# Benötigt:
+- Dash 
+- Pandas
+- beautifulsoup4
+- requests
+
+# Starten des Programms:
+
+Ausführen von citation_parser_ui.py und einfügen des entstandenen Liks in einen Browser.
+Danach müsste sich die Benutzeroberfläche im Browser öffnen.
+
+
+# Übersicht der Benutzeroberfläche:
+
+- Show Info: Durch wiederholtes klicken kann das Fenster ein und aus geblendet werden.
+
+- Input: Die Eingabe erfolgt in Form eines DOI ("Digital Object Identifier") 
+
+- Drag and drop or click to select a file to upload: Mehrere DOI in einem txt-Dokument (genau ein DOI pro Zeile).
+
+- Recursion: die beiden noch unbeschrifteten Felder rechts neben Input sind für die Rekursionstiefen in beide Richtungen
+
+- Clear All: alle Eingaben werden gelöscht
+
+- Clear Selected: alle markierten Eingaben werden gelöscht
+
+- Generate Graph: generiert den zugehörigen Graphen (generiert momentan nur einen string)
+
+- Update Automatically: automatische Aktualisierung des Graphen bei jeder neuen Eingabe
+
+- Smart Input: direkte Überprüfung der Eingabe auf Richtigkeit zudem wird nicht mehr der DOI angezeigt sondern: 
+  Der Autor, Das Journal, Das Veröffentlichungsdatum. (muss vor Hinzufügen aktiviert worden sein)
+
+## Autoren
+- Isabelle Siebels
+- Sebastian David
-- 
GitLab