Finish python 2.6 support

This commit is contained in:
Thomas Applencourt 2015-03-26 19:36:52 +01:00
parent f1ca1c2dfb
commit 08220ea2f5
3 changed files with 7 additions and 8 deletions

View File

@ -84,11 +84,11 @@ if __name__ == '__main__':
if arguments["--average_mo_number"]:
for name, des, avg in l:
des_str = "{:<50}".format(des)
des_str = "{0:<50}".format(des)
print "- '{0}' ({1}) || {2}".format(name, avg, des_str)
else:
for name, des in l:
des_str = "{:<50}".format(des)
des_str = "{0:<50}".format(des)
print "- '{0}' || {1}".format(name, des_str)
# _ _ _ _____ _ _

View File

@ -261,7 +261,7 @@ class EMSL_dump:
name, des, basis_data = q_out.get()
q_out.task_done()
str_indice = '{:>3}'.format(i + 1)
str_indice = '{0:>3}'.format(i + 1)
str_ = '{0} / {1} | {2}'.format(str_indice, nb_basis, name)
# ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ #

View File

@ -68,7 +68,7 @@ def cond_sql_or(table_name, l_value, glob=False):
opr = "GLOB" if glob else "="
l_cmd = ['{} {} "{}"'.format(table_name, opr, val) for val in l_value]
l_cmd = ['{0} {1} "{2}"'.format(table_name, opr, val) for val in l_value]
return "({0})".format(" OR ".join(l_cmd))
@ -172,9 +172,8 @@ class EMSL_local(object):
if average_mo_number:
column_to_fech += ", data"
filter_where = " ({}) AND ({})".format(
cmd_filter_ele,
cmd_filter_basis)
filter_where = " ({0}) AND ({1})".format(cmd_filter_ele,
cmd_filter_basis)
cmd = """SELECT DISTINCT {0}
FROM output_tab
@ -192,7 +191,7 @@ class EMSL_local(object):
# ~#~#~#~#~#~#~ #
# If average_mo_number is asking
from collections import OrderedDict
from misc.collections import OrderedDict
dict_info = OrderedDict()
# Description : dict_info[name] = [description, nb_mo, nb_ele]