diff --git a/script/local.py b/script/local.py index b076ac7..f655e4a 100755 --- a/script/local.py +++ b/script/local.py @@ -90,27 +90,27 @@ def hfit(ydata, xdata = None): -def elog(title, message, attachments = [], author = None, category = "Info", domain = "", logbook = "SwissFEL commissioning data", encoding=1): +def elogllrf(subject, message, system, subsystem, section, attachments = []): """ Add entry to ELOG. """ - if author is None: - author = "pshell" #controller.getUser().name - typ = "pshell" + author = "pshell/" + controller.getUser().name entry = "" - cmd = 'G_CS_ELOG_add -l "' + logbook+ '" ' + cmd = 'G_CS_ELOG_add -l "LLRF" ' cmd = cmd + '-a "Author=' + author + '" ' - cmd = cmd + '-a "Type=' + typ + '" ' cmd = cmd + '-a "Entry=' + entry + '" ' - cmd = cmd + '-a "Title=' + title + '" ' - cmd = cmd + '-a "Category=' + category + '" ' - cmd = cmd + '-a "Domain=' + domain + '" ' + cmd = cmd + '-a "Subject=' + subject + '" ' + cmd = cmd + '-a "Section=' + section + '" ' + cmd = cmd + '-a "System=' + system + '" ' + cmd = cmd + '-a "Subsystem=' + subsystem + '" ' + cmd = cmd + '-a "Machine=SwissFEL" ' + cmd = cmd + '-a "Domain=All"' for attachment in attachments: cmd = cmd + '-f "' + attachment + '" ' - cmd = cmd + '-n ' + str(encoding) + cmd = cmd + '-x -n 1' cmd = cmd + ' "' + message + '"' - #print cmd + print cmd #os.system (cmd) #print os.popen(cmd).read() import subprocess @@ -120,6 +120,7 @@ def elog(title, message, attachments = [], author = None, category = "Info", dom raise Exception(err) print out + def get_plot_snapshots(title = None, file_type = "jpg", temp_path = controller.setup.getContextPath()): """ Returns list with file names of plots snapshots from a plotting context.