Spaces:
Sleeping
Sleeping
Commit
·
7cdc6d9
1
Parent(s):
264e9fe
Update app.py
Browse files
app.py
CHANGED
@@ -38,20 +38,25 @@ if paste_data:
|
|
38 |
messages = [row[0] for row in reader]
|
39 |
|
40 |
row_count = 0
|
41 |
-
|
42 |
-
if show_notes:
|
43 |
-
note_delimiter = "//note//"
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
note, message = split_message[1].strip(), split_message[2].strip()
|
48 |
-
else:
|
49 |
-
note = message
|
50 |
|
|
|
|
|
|
|
51 |
st.session_state[f"note{row_count}"] = note
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
-
|
54 |
-
row_count += 1
|
55 |
|
56 |
st.session_state.row_count = row_count
|
57 |
|
|
|
38 |
messages = [row[0] for row in reader]
|
39 |
|
40 |
row_count = 0
|
41 |
+
note_flag = show_notes # flag to check if we should add to note or message
|
|
|
|
|
42 |
|
43 |
+
for i, message in enumerate(messages):
|
44 |
+
note_delimiter = "//note//"
|
|
|
|
|
|
|
45 |
|
46 |
+
if note_delimiter in message:
|
47 |
+
split_message = message.split(note_delimiter)
|
48 |
+
note, message = split_message[1].strip(), split_message[2].strip()
|
49 |
st.session_state[f"note{row_count}"] = note
|
50 |
+
st.session_state[f"message{row_count}"] = message
|
51 |
+
row_count += 1
|
52 |
+
else:
|
53 |
+
if note_flag:
|
54 |
+
st.session_state[f"note{row_count}"] = message
|
55 |
+
else:
|
56 |
+
st.session_state[f"message{row_count}"] = message
|
57 |
+
row_count += 1
|
58 |
|
59 |
+
note_flag = not note_flag # flip the flag for next iteration
|
|
|
60 |
|
61 |
st.session_state.row_count = row_count
|
62 |
|