Skip to content

Commit

Permalink
chore: remove extra content
Browse files Browse the repository at this point in the history
Signed-off-by: Dup4 <[email protected]>
  • Loading branch information
Dup4 committed Dec 8, 2023
1 parent 1ca8e7e commit bb611f5
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions cmd/handle_print_cmd/exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [[ -n "${SUBMIT_FILE_LIMIT}" ]]; then
fi
fi

SOURCE_CODE="$(cat -n "${FILE}")"
SOURCE_CODE="$(cat "${FILE}")"
# SOURCE_CODE="$(cat -n "${FILE}" | sed 's/\\n/\\\\n/g' | sed 's/\\r/\\\\r/g')"

if [[ "$(uname -a | grep -c "MacBookPro")" -ge 1 ]]; then
Expand All @@ -26,11 +26,6 @@ else
SUBMIT_TIME="$(date --rfc-3339=ns | sed 's/ /T/; s/\(\....\).*\([+-]\)/\1\2/g')"
fi

COMMENT_CHAR="//"
if [[ "${LANGUAGE}" == "py" ]] || [[ "${LANGUAGE}" == "py2" ]] || [[ "${LANGUAGE}" == "py3" ]]; then
COMMENT_CHAR="#"
fi

RES_MESSAGE=$(
python3 <<EOF
import json
Expand All @@ -48,17 +43,7 @@ p["TeamID"] = r"${TEAM_ID}"
p["LOCATION"] = r"${LOCATION}"
p["Language"] = r"${LANGUAGE}"
p["FileName"] = r"${ORIGINAL_FILE}"
p["SourceCode"] = r'''
${COMMENT_CHAR} ********************************
${COMMENT_CHAR} SubmitTime=${SUBMIT_TIME}
${COMMENT_CHAR} FileName=${ORIGINAL_FILE}
${COMMENT_CHAR} Language=${LANGUAGE}
${COMMENT_CHAR} TeamName=${TEAM_NAME}
${COMMENT_CHAR} Location=${LOCATION}
${COMMENT_CHAR} ********************************
${SOURCE_CODE}
'''
p["SourceCode"] = r'''${SOURCE_CODE}'''
url = "http://${DOMPRINTER_HOSTNAME:-127.0.0.1}:${DOMPRINTER_PORT:-8888}/print-task"
payload = json.dumps(body)
Expand Down

0 comments on commit bb611f5

Please sign in to comment.