Ejemplo n.º 1
0
 def read(self):
     """"""
     try:
         with Io.rfile(self.path, False) as fi:
             csection = 'main'
             self.dic[csection] = {}
             for l in fi:
                 l = l.rstrip().lstrip()
                 if len(l) > 0 and not l[0]=='#' :
                     d = regsplit(' *= *', l , 1)
                     if len(d)> 1:
                         self.dic[csection][d[0]] = d[1] if d[1] is not None else ''
                     elif len(l)>0 and l[0]=='[':
                         csection = l.strip('[]')
                         self.dic[csection] = {}
     except IOError :
         pass
Ejemplo n.º 2
0
 def read(self):
     """"""
     try:
         call = ' '.join([Sys.executable, 'kirmah-cli.py', 'dec', '-qf', self.path+'.kmh', '-z', '-r', '-m', '-o', self.path, '-k', self.keyPath ])
         Sys.sysCall(call)            
         with Io.rfile(self.path, False) as fi:
             csection = 'main'
             self.dic[csection] = {}
             for l in fi:
                 l = l.rstrip().lstrip()
                 if len(l) > 0 and not l[0]=='#' :
                     d = regsplit(' *= *', l , 1)
                     if len(d)> 1:
                         self.dic[csection][d[0]] = d[1] if d[1] is not None else ''
                     elif len(l)>0 and l[0]=='[':
                         csection = l.strip('[]')
                         self.dic[csection] = {}
         Io.removeFile(self.path)
     except IOError :
         pass
                            final_location_arr.append(extracted_location_info)

                        if (provider_info_exists):
                            extracted_provider_info: List[
                                Dict] = provider_info_extract(provider_info)
                            if (location_info_exists):
                                final_location_arr[-1][
                                    "provider_list"] = extracted_provider_info
                            else:
                                final_location_arr[-1]["provider_list"] = [
                                    *final_location_arr[-1]["provider_list"],
                                    *extracted_provider_info
                                ]

                    else:
                        multi_org_split: List[str] = regsplit(r"NPI.*", text)
                        filter_org_split: List[str] = list(
                            filter(lambda item: item, multi_org_split))

                        org_lines_split: List[List[str]] = list(
                            map(lambda string: string.split("\n"),
                                multi_org_split))

                        cleaned_arrs: List[List[str]] = []

                        for org_info in org_lines_split:
                            cleaned_arrs.append(
                                list(
                                    filter(lambda string: string.strip() != "",
                                           org_info)))
Ejemplo n.º 4
0
def uid_to_rec(uid):
    rec = regsplit(r':|_|/', uid)
    return rec