Skip to content

Commit b994fa8

Browse files
committed
some improvements
1 parent 99ed98a commit b994fa8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/redturtle/rsync/scripts/rsync.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ def log_info(self, msg, type="info"):
9898
style = ""
9999
if type == "error":
100100
style = "padding:5px;background-color:red;color:#fff"
101-
msg = f"[{datetime.now()}] {msg}"
101+
if type == "warning":
102+
style = "padding:5px;background-color:#ff9d00;color:#fff"
103+
msg = f"[{datetime.now().strftime('%d-%m-%Y %H:%M:%S')}] {msg}"
102104
self.logdata.append(f'<p style="{style}">{self.autolink(msg)}</p>')
103105

104106
# print the message
@@ -162,7 +164,7 @@ def get_data(self):
162164
return None
163165
if not data:
164166
msg = "No data to sync."
165-
self.log_info(msg=msg, type="error")
167+
self.log_info(msg=msg, type="warning")
166168
return None
167169
return data
168170

@@ -173,6 +175,9 @@ def create_item(self, row, options):
173175
try:
174176
res = self.adapter.create_item(row=row, options=self.options)
175177
except Exception as e:
178+
import pdb
179+
180+
pdb.set_trace()
176181
msg = f"[Error] Unable to create item {row}: {e}"
177182
self.log_info(msg=msg, type="error")
178183
return

0 commit comments

Comments
 (0)