fix encoding error, add support cl_page_offset and cl_page_count

develop
Спиридонов Денис 12 years ago
parent 4b418ba7f7
commit 53a9f67651

@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import time, os, sys
import time, os, sys, re
import subprocess
from OpenSSL import crypto
import shlex
@ -184,6 +184,15 @@ def show_view(view):
print "+====== show view! ======+"
def printTable(data, header=None ):
res = []
for row in data:
encode_row = map(lambda x: x.encode('utf-8'), row)
res.append(encode_row)
data = res
if type(header) == list:
header = map(lambda x: x.encode('utf-8'), header)
lens = [0]*len(data[0])
for row in data:
for numCol, column in enumerate(row):
@ -215,6 +224,7 @@ def show_table(table, item):
for line in table.body[0]:
if hasattr (line, 'string'):
data.append(line.string)
res = printTable(data, head)
sys.stdout.flush()
sys.stdout.write(res)
@ -265,12 +275,13 @@ def endGruop(item):
pass
def callView(item, sid):
return
print "\n\n",item.message
try:
view = client.service[0][item.message] (sid)
show_view (view)
except:
print _("Error")
pass
#################MESSAGE####################################
@ -296,7 +307,10 @@ def get_message(client, item, sid, pid):
if case('normal'):
# sys.stdout.flush()
# sys.stdout.write('\x1b[1;33m' + item.message + '\033[0m')
print item.message
p = re.compile(r'<b>|</b>')
print p.sub('', item.message)
# print item.message
return 1
if case('progress'):
get_Progress(client, sid, pid, item.id)

@ -124,7 +124,13 @@ def collect_object(client, param_object, view, args):
if field.element in ['check', 'check_tristate'] or \
field.element == 'radio' and field.type == 'bool':
param_object[field.name] = _getattr(args, field.name)
# if field.name:
elif field.element == 'input' and \
field.name in ['cl_page_offset','cl_page_count']:
val = _getattr(args, field.name)
if not val:
val = 0
param_object[field.name] = val
elif field.element in ['input', 'combo', 'comboEdit', 'openfile', \
'file', 'password', 'radio']:

Loading…
Cancel
Save