diff --git a/.bin/Scripts/functions/io_graph.py b/.bin/Scripts/functions/io_graph.py index fb909c9f..7a96d8aa 100644 --- a/.bin/Scripts/functions/io_graph.py +++ b/.bin/Scripts/functions/io_graph.py @@ -8,6 +8,7 @@ import requests from functions.common import * + # Functions def export_io_graph(disk): """Exports PNG graph using gnuplot, returns file path as str.""" @@ -49,6 +50,7 @@ def export_io_graph(disk): return out_path + def upload_to_imgur(image_path): """Upload image to Imgur and return image url as str.""" image_data = None @@ -80,6 +82,7 @@ def upload_to_imgur(image_path): image_link = json_data['data']['link'] return image_link + def upload_to_nextcloud(image_path, ticket_number, dev_name): """Upload image to Nextcloud server and return folder url as str.""" image_data = None @@ -107,6 +110,7 @@ def upload_to_nextcloud(image_path, ticket_number, dev_name): # Return folder link return BENCHMARK_SERVER['Short Url'] + if __name__ == '__main__': print("This file is not meant to be called directly.") diff --git a/.bin/Scripts/functions/osticket.py b/.bin/Scripts/functions/osticket.py index 13490e92..bbf78353 100644 --- a/.bin/Scripts/functions/osticket.py +++ b/.bin/Scripts/functions/osticket.py @@ -6,15 +6,18 @@ from functions.data import * from functions.io_graph import * from settings.osticket import * + # STATIC VARIABLES KNOWN_DEV_TYPES = ('CPU', 'Disk') + # Regex REGEX_BLOCK_GRAPH = re.compile(r'(▁|▂|▃|▄|▅|▆|▇|█)') REGEX_NVME_SMART_ATTRIBUTES = re.compile(r'^\s*(\d+) / (\w+): (.{28})(.*)$') REGEX_TEMPS = re.compile(r'^\s*(.*?)\s+(idle.*)$') REGEX_SENSOR = re.compile(r'^(.*?)(\s*)$') + # Classes class osTicket(): """Class to track osTicket data and functions.""" @@ -469,6 +472,7 @@ class osTicket(): # Done self.disconnect() + # Functions def pad_with_dots(s, pad_right=False): """Replace space padding with dots, returns str.""" @@ -480,6 +484,7 @@ def pad_with_dots(s, pad_right=False): s = '.' + s return s + if __name__ == '__main__': print("This file is not meant to be called directly.")