def _putToDict(): oddPortError = odd() lstPortErrLines = self.strPorterrshow.split('\n') for intPortNum in self._allSWPort: lstErrInfo = _getErrorAsList(intPortNum, lstPortErrLines) oddPortError[str(intPortNum)] = lstErrInfo self._dicPartPortError = oddPortError
def _dict_string_to_int(self, dicPE): dicIntPE = odd() if dicPE: for i in range(len(dicPE.values())): port = dicPE.keys()[i] lstPortError = dicPE.values()[i] dicIntPE[port] = self.list_string_to_int(lstPortError) return dicIntPE
def _get_oddCommand(intTraceLevel): oddCMD = odd() if intTraceLevel == 1 or intTraceLevel == 2 or intTraceLevel == 3: oddCMD['Trace'] = 'ftpprep trace' if intTraceLevel == 2 or intTraceLevel == 3: oddCMD['Primary'] = 'ftpprep coredump primary all' if intTraceLevel == 3: oddCMD['Secondary'] = 'ftpprep coredump secondary all' return oddCMD else: print('Trace level must be: 1 or 2 or 3, please refer "Config.ini" ')
#!/usr/bin/python import sys import re from sys import argv from collections import OrderedDict as odd #Add sample id to the master strawberry table. Only perfect case-blind matches accepted. script, crown_rot_tb, samples_tb = argv crown_rot = odd() #Read in the list of the cultivars in the crown rot GWAS table. with open(crown_rot_tb) as crown_rot_tb_h: for line in crown_rot_tb_h: fields = line.strip().split("\t") #Convert to lower-case: search_token = fields[0].lower() crown_rot[search_token] = line.strip() #read in the samples table samples = dd() with open(samples_tb) as samples_tb_h: for line in samples_tb_h: lines = line.strip().split("\t") samples[line.lower()] = lines #print crown_rot.keys() #print the results matching_ids = dd(list) for my_id in crown_rot.keys(): for my_sample in samples.keys(): if re.search(my_id, my_sample): matching_ids[my_id].append(samples[my_sample][0])