optimuslib 0.0.41__tar.gz → 0.0.45__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {optimuslib-0.0.41 → optimuslib-0.0.45}/PKG-INFO +1 -1
- {optimuslib-0.0.41 → optimuslib-0.0.45}/optimuslib/optimuslib.py +23 -1
- {optimuslib-0.0.41 → optimuslib-0.0.45}/pyproject.toml +1 -1
- {optimuslib-0.0.41 → optimuslib-0.0.45}/README.md +0 -0
- {optimuslib-0.0.41 → optimuslib-0.0.45}/optimuslib/__init__.py +0 -0
|
@@ -1379,7 +1379,29 @@ def sendDiscordBotFile(botToken,channelId,filePath):
|
|
|
1379
1379
|
log.info('Discord Bot Message Send Failure Error Description: %s', responseJson['description'])
|
|
1380
1380
|
getVarInfo('responseJson',responseJson)
|
|
1381
1381
|
return False
|
|
1382
|
-
|
|
1382
|
+
|
|
1383
|
+
|
|
1384
|
+
# format table for discord message
|
|
1385
|
+
def buildUnicodeTable(headers, rows):
|
|
1386
|
+
col_widths = [len(h) for h in headers]
|
|
1387
|
+
|
|
1388
|
+
for row in rows:
|
|
1389
|
+
for idx, cell in enumerate(row):
|
|
1390
|
+
col_widths[idx] = max(col_widths[idx], len(str(cell)))
|
|
1391
|
+
|
|
1392
|
+
top_border = '┌' + '┬'.join('─' * (w + 2) for w in col_widths) + '┐'
|
|
1393
|
+
header_row = '│ ' + ' │ '.join(headers[i].ljust(col_widths[i]) for i in range(len(headers))) + ' │'
|
|
1394
|
+
mid_border = '├' + '┼'.join('─' * (w + 2) for w in col_widths) + '┤'
|
|
1395
|
+
|
|
1396
|
+
data_rows = []
|
|
1397
|
+
for row in rows:
|
|
1398
|
+
data_row = '│ ' + ' │ '.join(str(row[i]).ljust(col_widths[i]) for i in range(len(row))) + ' │'
|
|
1399
|
+
data_rows.append(data_row)
|
|
1400
|
+
|
|
1401
|
+
bottom_border = '└' + '┴'.join('─' * (w + 2) for w in col_widths) + '┘'
|
|
1402
|
+
|
|
1403
|
+
table = [top_border, header_row, mid_border] + data_rows + [bottom_border]
|
|
1404
|
+
return '\n'.join(table)
|
|
1383
1405
|
# if(optimuslib.sendTelegramNotification(botToken, chatId,output)):
|
|
1384
1406
|
# print('Telegram Notification Sent.')
|
|
1385
1407
|
|
|
File without changes
|
|
File without changes
|