Skip to content
Snippets Groups Projects
Commit 03f7868a authored by Loraine Guéguen's avatar Loraine Guéguen Committed by Loraine Gueguen
Browse files

debug get picture

parent da219475
No related branches found
No related tags found
1 merge request!28WIP: Fix empty strain sex
...@@ -144,17 +144,18 @@ def get_sp_picture(sp_dict_list): ...@@ -144,17 +144,18 @@ def get_sp_picture(sp_dict_list):
for sp in sp_dict_list: for sp in sp_dict_list:
genus_species = get_gspecies_string_from_sp_dict(sp) genus_species = get_gspecies_string_from_sp_dict(sp)
logging.debug("picture path for {0} {1}: {2}".format(genus_species, # logging.debug("picture path for {0} {1}: {2}".format(genus_species,
sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_STRAIN], # sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_STRAIN],
sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH])) # sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH]))
# no picture stored yet for this genus_species # no picture stored yet for this genus_species
if genus_species not in sp_picture_dict.keys() \ if genus_species not in sp_picture_dict.keys() \
or (genus_species in sp_picture_dict.keys() or (genus_species in sp_picture_dict.keys()
and sp_picture_dict[genus_species] == None): and sp_picture_dict[genus_species] == None):
if constants.ORG_PARAM_DESC_PICTURE_PATH in sp[constants.ORG_PARAM_DESC].keys() and \ if constants.ORG_PARAM_DESC_PICTURE_PATH in sp[constants.ORG_PARAM_DESC].keys() \
sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH] != None: and sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH] != None \
and sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH] != "":
sp_picture_dict[genus_species] = sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH] sp_picture_dict[genus_species] = sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH]
else: else:
sp_picture_dict[genus_species] = None sp_picture_dict[genus_species] = None
...@@ -163,11 +164,12 @@ def get_sp_picture(sp_dict_list): ...@@ -163,11 +164,12 @@ def get_sp_picture(sp_dict_list):
if (constants.ORG_PARAM_DESC_MAIN_SPECIES in sp[constants.ORG_PARAM_DESC].keys() if (constants.ORG_PARAM_DESC_MAIN_SPECIES in sp[constants.ORG_PARAM_DESC].keys()
and sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_MAIN_SPECIES] == True )\ and sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_MAIN_SPECIES] == True )\
and (constants.ORG_PARAM_DESC_PICTURE_PATH in sp[constants.ORG_PARAM_DESC].keys() and (constants.ORG_PARAM_DESC_PICTURE_PATH in sp[constants.ORG_PARAM_DESC].keys()
and sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH] != None): and sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH] != None
and sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH] != ""):
sp_picture_dict[genus_species] = sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH] sp_picture_dict[genus_species] = sp[constants.ORG_PARAM_DESC][constants.ORG_PARAM_DESC_PICTURE_PATH]
logging.debug("picture dict: %s" % sp_picture_dict) # logging.debug("picture dict: %s" % sp_picture_dict)
return sp_picture_dict return sp_picture_dict
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment