← Back to team overview

openlp-core team mailing list archive

Re: [Merge] lp:~thelinuxguy/openlp/fix-newline-bug into lp:openlp

 

Review: Needs Fixing

One minor fix as I do not like the rename of the field

Diff comments:

> === modified file 'openlp/core/common/__init__.py'
> --- openlp/core/common/__init__.py	2018-02-24 16:10:02 +0000
> +++ openlp/core/common/__init__.py	2018-04-14 20:05:07 +0000
> @@ -471,15 +471,15 @@
>          log.exception('Error detecting file encoding')
>  
>  
> -def normalize_str(irreg_str):
> +def normalize_str(string):

String is a data type so should not be used as a variable..

>      """
>      Normalize the supplied string. Remove unicode control chars and tidy up white space.
>  
> -    :param str irreg_str: The string to normalize.
> +    :param str string: The string to normalize.
>      :return: The normalized string
>      :rtype: str
>      """
> -    irreg_str = irreg_str.translate(REPLACMENT_CHARS_MAP)
> -    irreg_str = CONTROL_CHARS.sub('', irreg_str)
> -    irreg_str = NEW_LINE_REGEX.sub('\n', irreg_str)
> -    return WHITESPACE_REGEX.sub(' ', irreg_str)
> +    string = string.translate(REPLACMENT_CHARS_MAP)
> +    string = CONTROL_CHARS.sub('', string)
> +    string = NEW_LINE_REGEX.sub('\n', string)
> +    return WHITESPACE_REGEX.sub(' ', string)


-- 
https://code.launchpad.net/~thelinuxguy/openlp/fix-newline-bug/+merge/343256
Your team OpenLP Core is subscribed to branch lp:openlp.


References