Added extra line breaks to match upstream code

This commit is contained in:
2Shirt 2018-12-27 22:11:09 -07:00
parent 5a7a16588a
commit e2fcacf579
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 9 additions and 0 deletions

View file

@ -8,6 +8,7 @@ import requests
from functions.common import * from functions.common import *
# Functions # Functions
def export_io_graph(disk): def export_io_graph(disk):
"""Exports PNG graph using gnuplot, returns file path as str.""" """Exports PNG graph using gnuplot, returns file path as str."""
@ -49,6 +50,7 @@ def export_io_graph(disk):
return out_path return out_path
def upload_to_imgur(image_path): def upload_to_imgur(image_path):
"""Upload image to Imgur and return image url as str.""" """Upload image to Imgur and return image url as str."""
image_data = None image_data = None
@ -80,6 +82,7 @@ def upload_to_imgur(image_path):
image_link = json_data['data']['link'] image_link = json_data['data']['link']
return image_link return image_link
def upload_to_nextcloud(image_path, ticket_number, dev_name): def upload_to_nextcloud(image_path, ticket_number, dev_name):
"""Upload image to Nextcloud server and return folder url as str.""" """Upload image to Nextcloud server and return folder url as str."""
image_data = None image_data = None
@ -107,6 +110,7 @@ def upload_to_nextcloud(image_path, ticket_number, dev_name):
# Return folder link # Return folder link
return BENCHMARK_SERVER['Short Url'] return BENCHMARK_SERVER['Short Url']
if __name__ == '__main__': if __name__ == '__main__':
print("This file is not meant to be called directly.") print("This file is not meant to be called directly.")

View file

@ -6,15 +6,18 @@ from functions.data import *
from functions.io_graph import * from functions.io_graph import *
from settings.osticket import * from settings.osticket import *
# STATIC VARIABLES # STATIC VARIABLES
KNOWN_DEV_TYPES = ('CPU', 'Disk') KNOWN_DEV_TYPES = ('CPU', 'Disk')
# Regex # Regex
REGEX_BLOCK_GRAPH = re.compile(r'(▁|▂|▃|▄|▅|▆|▇|█)') REGEX_BLOCK_GRAPH = re.compile(r'(▁|▂|▃|▄|▅|▆|▇|█)')
REGEX_NVME_SMART_ATTRIBUTES = re.compile(r'^\s*(\d+) / (\w+): (.{28})(.*)$') REGEX_NVME_SMART_ATTRIBUTES = re.compile(r'^\s*(\d+) / (\w+): (.{28})(.*)$')
REGEX_TEMPS = re.compile(r'^\s*(.*?)\s+(idle.*)$') REGEX_TEMPS = re.compile(r'^\s*(.*?)\s+(idle.*)$')
REGEX_SENSOR = re.compile(r'^(.*?)(\s*)$') REGEX_SENSOR = re.compile(r'^(.*?)(\s*)$')
# Classes # Classes
class osTicket(): class osTicket():
"""Class to track osTicket data and functions.""" """Class to track osTicket data and functions."""
@ -469,6 +472,7 @@ class osTicket():
# Done # Done
self.disconnect() self.disconnect()
# Functions # Functions
def pad_with_dots(s, pad_right=False): def pad_with_dots(s, pad_right=False):
"""Replace space padding with dots, returns str.""" """Replace space padding with dots, returns str."""
@ -480,6 +484,7 @@ def pad_with_dots(s, pad_right=False):
s = '.' + s s = '.' + s
return s return s
if __name__ == '__main__': if __name__ == '__main__':
print("This file is not meant to be called directly.") print("This file is not meant to be called directly.")