EasySci commited on
Commit
88041f6
·
1 Parent(s): 51057f3

Update app2.py

Browse files
Files changed (1) hide show
  1. app2.py +12 -3
app2.py CHANGED
@@ -3,11 +3,20 @@ import pytz
3
  from datetime import date
4
  from datetime import datetime
5
  from dateutil.relativedelta import relativedelta, MO
6
-
7
 
8
  from functools import partial
9
  from src.search import Search_Papers
10
 
 
 
 
 
 
 
 
 
 
11
  def load_categories():
12
  f = open("categories_general.txt", "r")
13
  list_categories = f.read().splitlines()
@@ -133,7 +142,7 @@ def update_header():
133
 
134
  print("Used categories:", buttons_to_add, flush=True)
135
  run_code(None)
136
- main_body = update_mainTLDR()
137
  # Update the filter list options to exclude buttons that are already in the header
138
  filter_list.options = [option for option in entered_options if option not in buttons_to_add]
139
 
@@ -165,7 +174,7 @@ def remove_from_header(event):
165
  template = pn.template.FastListTemplate(
166
  title="EasySciRead",
167
  header=[pn.Row(header_buttons, width=800, sizing_mode='fixed'), pn.Row(filter_list, width=250), pn.Row(add_to_header_button, width=55)],
168
- main= main_body,
169
  sidebar=[buttons],
170
  accent_base_color="#88d8b0",
171
  header_background="#FFFFFF",
 
3
  from datetime import date
4
  from datetime import datetime
5
  from dateutil.relativedelta import relativedelta, MO
6
+ import param
7
 
8
  from functools import partial
9
  from src.search import Search_Papers
10
 
11
+ class MainBody(param.Parameterized):
12
+ main_body = param.List(default=[])
13
+
14
+ @param.depends("main_body")
15
+ def update(self):
16
+ return self.main_body
17
+
18
+ main_body_instance = MainBody()
19
+
20
  def load_categories():
21
  f = open("categories_general.txt", "r")
22
  list_categories = f.read().splitlines()
 
142
 
143
  print("Used categories:", buttons_to_add, flush=True)
144
  run_code(None)
145
+ main_body_instance.main_body = update_mainTLDR()
146
  # Update the filter list options to exclude buttons that are already in the header
147
  filter_list.options = [option for option in entered_options if option not in buttons_to_add]
148
 
 
174
  template = pn.template.FastListTemplate(
175
  title="EasySciRead",
176
  header=[pn.Row(header_buttons, width=800, sizing_mode='fixed'), pn.Row(filter_list, width=250), pn.Row(add_to_header_button, width=55)],
177
+ main= main_body_instance.update,
178
  sidebar=[buttons],
179
  accent_base_color="#88d8b0",
180
  header_background="#FFFFFF",