diff --git a/jenkins_backend/sync_jobs.py b/jenkins_backend/sync_jobs.py index 0e15d9c..c471a5f 100755 --- a/jenkins_backend/sync_jobs.py +++ b/jenkins_backend/sync_jobs.py @@ -5,22 +5,11 @@ Module for backend talk with Jenkins executed by the web/CGI from argparse import ArgumentParser from subprocess import run +import html from config import (jarargs, jobpath) -def html_escape(string): - """ - Function for escaping certain symbols to XML-compatible sequences. - """ - html_codes = [("'", '''), ('"', '"'), ('&', '&'), - ('<', '<'), ('>', '>')] - for i in html_codes: - string = string.replace(i[0], i[1]) - - return string - - def add_job(jobname): """ Function for adding a job to Jenkins. @@ -40,7 +29,7 @@ def add_job(jobname): zshcmd = 'load devuan %s' % (blendfile) command = "zsh -f -c 'source sdk && %s && build_image_dist'" % zshcmd - command = html_escape(command) + command = html.escape(command) replacements = [('DESC', desc), ('SDK', sdk),