длинный текст в html текстовой области потерял ответ - PullRequest
0 голосов
/ 06 апреля 2020

Я хочу отправить длинный текст в виде html, когда текст короткий, он работал хорошо, но когда текст длинный, он теряет ответ.

<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<title>Get symap</title> 
</head>
<body>
<FORM ACTION="/cgi-bin/viewsymap.py" method="POST" enctype="multipart/form-data">
<br>
<br>

<br>
    <a><B>Axes background&nbsp;&nbsp;</B></a>
    <select name="style">
        <option VALUE="darkgrid"> darkgrid</option>
        <option VALUE="dark"> dark </option>
        <option VALUE="ticks"> ticks</option>
        <option VALUE="whitegrid"> whitegrid</option>
        <option VALUE="white"> white</option>
    </select>
<br>
    <a><B>Physical dot density&nbsp;&nbsp;</B></a>
    <select name="dpi">
        <option VALUE="300"> 300</option>
        <option VALUE="600"> 600 </option>
        <option VALUE="800"> 800</option>
        <option VALUE="1000"> 1000</option>

    </select>
<br>
    <a><B>Generate image of format&nbsp;&nbsp;</B></a>
    <select name="format">
        <option VALUE="pdf"> pdf</option>
        <option VALUE="svg"> svg </option>
        <option VALUE="svgz"> svgz</option>
        <option VALUE="png"> png </option>
        <option VALUE="eps"> eps </option>
        <option VALUE="ps"> ps </option>
        <option VALUE="emf"> emf </option>
        <option VALUE="raw"> raw </option>
        <option VALUE="rgba"> rgba </option>
    </select>
<br>
    <a><B>Font name&nbsp;&nbsp;</B></a>
    <select name="font">
        <option VALUE="Arial">Arial</option>
        <option VALUE="Helvetica"> Helvetica </option>
        <option VALUE="Palatino"> Palatino </option>
        <option VALUE="Schoolbook"> Schoolbook </option>
    </select>
<br>
    <a><B>Contrasting color scheme&nbsp;&nbsp;</B></a>
    <select name="diverge">
        <option VALUE="PiYG"> PiYG&nbsp;</option>
        <option VALUE="BrBG"> BrBG&nbsp;</option>
        <option VALUE="PRGn"> PRGn&nbsp;</option>
        <option VALUE="PuOr"> PuOr&nbsp;</option>
        <option VALUE="RdBu"> RdBu&nbsp;</option>
        <option VALUE="RdGy"> RdGy&nbsp;</option>
        <option VALUE="RdYlBu"> RdYlBu&nbsp;</option>
        <option VALUE="RdYlGn"> RdYlGn&nbsp;</option>
        <option VALUE="Spectral"> Spectral&nbsp;</option>
    </select>
<br>
    <a><B>Add scale bar to the plot&nbsp;&nbsp;</B></a>
    <select name="scalebar">
        <option VALUE="False"> False&nbsp;</option>
        <option VALUE="True"> True&nbsp;</option>
    </select>
<br>
    <a><B>Figure size `width`x`height` in inches&nbsp;&nbsp;</B></a>
    <select name="figsize">
    <option VALUE="8x7">8x7&nbsp;</option>
    </select>
<br>

<br>
Genes in the row were homologous to each others among different genomes or species.
<br>
<br>
<textarea wrap ="hard" Name="block" cols="70" rows="12">
TraesCS1A01G020800      TuG1812G0100000292
TraesCS1A01G024200LC    .
TraesCS1A01G020900      TuG1812G0100000293
TraesCS1A01G021000      TuG1812G0100000294
TraesCS1A01G021100      TuG1812G0100000296
TraesCS1A01G021200      TuG1812G0100000297
TraesCS1A01G024300LC    TuG1812G0100000298
TraesCS1A01G021300      TuG1812G0100000299
TraesCS1A01G024400LC    .
TraesCS1A01G021400      TuG1812G0100000300
TraesCS1A01G024500LC    TuG1812G0100000293
TraesCS1A01G024600LC    .
</textarea>
<br>
<br>
<textarea  Name="layout" cols="70" rows="12">
# x,   y, rotation,   ha,     va,   color, ratio,            label
0.5, 0.6,        0, left, center,       m,     1,       Chinese_Spring chr1A
0.55, 0.5,        0, left, center, #fc8d62,     0.5, Triticum_urartu Tu1
# edges
e, 0, 1
</textarea>
<br>
<br>
<INPUT TYPE="submit" VALUE="Search targets">
</FORM>
</body>
</html>

viewsymap.py


#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'xxxx'
__author_email__ = 'xxxx@icloud.com'

import sys
reload(sys)

sys.setdefaultencoding('utf-8')

print("Content-Type: text/html")
print ("")
print ("<html>")

try:
    import cgitb
    cgitb.enable()
except:
    pass
import cgi
import subprocess

import random

resultdir = '/var/www/html/symap/result/'

random_num = ''.join([str(random.randint(0,9)),str(random.randint(0,9)),str(random.randint(0,9))])


form = cgi.FieldStorage()

style = form["style"].value
dpi = form["dpi"].value
format1 = form["format"].value
font = form["font"].value
diverge = form["diverge"].value
scalebar = form["scalebar"].value
figsize = form["figsize"].value.strip()
name = form["block"].value.strip().split()[0]  
layout = form["layout"].value.strip().split()

blockfile = resultdir + 'block_' + random_num + '.txt'
layoutfile = resultdir + 'block_' + random_num + '.layout'
para = ' --scalebar ' + scalebar + ' --dpi=' + dpi + ' --format=' + format1 + ' --font=' + font + ' --diverge=' + diverge + ' --style=' + style + ' --figsize=' + str(figsize)

output = 'block_' + random_num + '.' + format1
try:
    print('test<br>')
    print(para + '<br>')
    print(output + '<br>')
except Exception as e:
    print('<br>Reason:', e)

, если ввести указанный ниже текст в текстовое поле с именем block, viewsymap.py не будет ответом.

TraesCS1A01G020800 TuG1812G0100000292

TraesCS1A01G024200L C.

TraesCS1A01G020900 TuG1812G0100000293

TraesCS1A01G021000 TuG1812G0100000294

TraesCS1A01G021100 TuG1812G0100000296

TraesCS1A01G021200 TuG1812G0100000297

1020 * TraesCS1A01G024300L C TuG1812G0100000298 1022 * TraesCS1A01G021300 TuG1812G0100000299 1024 * TraesCS1A01G024400L C. 1026 * TraesCS1A01G021400 TuG1812G0100000300 1028 * TraesCS1A01G024500L C TuG1812G0100000293 TraesCS1A01G024600L C. 1030 * TraesCS1A01G021300 TuG1812G0100000299 1032 * TraesCS1A01G024400L C. 1034 * TraesCS1A01G021400 TuG1812G0100000300 1036 * TraesCS1A01G024500L C TuG1812G0100000293 1038 * TraesCS1A01G024600L C.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...