parameters: (in_file, out_file)
return_statement: return True
docstring: Process .po file
          in_file: path to input file
          :type in_file: str
          out_file: path to output file
          :type out_file: str
  
        Returns: True, of processing was done, False in case of error
          :return: bool
docstring_summary: Process .po file
          in_file: path to input file
          :type in_file: str
          out_file: path to output file
          :type out_file: str
docstring_tokens: Process . po file in_file : path to input file : type in_file : str out_file : path to output file : type out_file : str
function: def process_file(in_file, out_file):
      """
        Process .po file
          in_file: path to input file
          :type in_file: str
          out_file: path to output file
          :type out_file: str
  
        Returns: True, of processing was done, False in case of error
          :return: bool
      """
      _LOGGER.debug("Processing of file '%s' (output will be saved to '%s')",
                    in_file, out_file)
      _LOGGER.debug("Loading file '%s'", in_file)
      try:
          po = polib.pofile(in_file)
      except IOError as e:
          _LOGGER.error("Error while loading file '%s': %s", in_file, e)
          return False
      change_cnt = 0
      skip_cnt = 0
      wrapper = textwrap.TextWrapper(
          break_long_words=False,
          replace_whitespace=False,
          drop_whitespace=True)
      for entry in po:
          if _NL_STR in entry.msgid:
              if process_entry(entry, wrapper):
                  change_cnt += 1
              else:
                  skip_cnt += 1
          fix_nbsp(entry)
  
      _LOGGER.info("Changed: %d, skipped: %d", change_cnt, skip_cnt)
  
      _LOGGER.info("Saving to '%s'", out_file)
      try:
          po.save(out_file)
      except IOError as e:
          _LOGGER.error("Error while saving to file '%s': %s", out_file, e)
          return False
      return True
function_tokens: def process_file ( in_file , out_file ) : _LOGGER . debug ( "Processing of file '%s' (output will be saved to '%s')" , in_file , out_file ) _LOGGER . debug ( "Loading file '%s'" , in_file ) try : po = polib . pofile ( in_file ) except IOError as e : _LOGGER . error ( "Error while loading file '%s': %s" , in_file , e ) return False change_cnt = 0 skip_cnt = 0 wrapper = textwrap . TextWrapper ( break_long_words = False , replace_whitespace = False , drop_whitespace = True ) for entry in po : if _NL_STR in entry . msgid : if process_entry ( entry , wrapper ) : change_cnt += 1 else : skip_cnt += 1 fix_nbsp ( entry ) _LOGGER . info ( "Changed: %d, skipped: %d" , change_cnt , skip_cnt ) _LOGGER . info ( "Saving to '%s'" , out_file ) try : po . save ( out_file ) except IOError as e : _LOGGER . error ( "Error while saving to file '%s': %s" , out_file , e ) return False return True