[PATCH] Add a test for disadvised words.

Chris Lumens clumens at redhat.com
Wed Aug 6 19:12:14 UTC 2014


> +# {'bad re': 'suggestion'}
> +# All the crazy looking underscores are to catch strings with arbitrary
> +# gtk accelerators set. (?i) makes the re case-insensitive
> +bad_strings = {'(?i)b_?o_?o_?t_?l_?o_?a_?d_?e_?r': 'boot loader',
> +               '(?i)f_?i_?l_?e_?s_?y_?s_?t_?e_?m': 'file system',
> +               '(?i)u_?s_?e_?r_?n_?a_?m_?e':       'user name',
> +               '[Vv]_?l_?a_?n':                    'VLAN',
> +               '(?i)h_?o_?s_?t_?n_?a_?m_?e':       'hostname',
> +               'Z_?F_?C_?P':                       'zFCP',
> +               'z_?f_?c_?p':                       'zFCP',
> +               'B_?T_?R_?F_?S':                    'Btrfs',
> +               'b_?t_?r_?f_?s':                    'Btrfs',
> +               '[Cc]an not':                       'can not',
> +               '(?i)m_?o_?u_?n_?t_?p_?o_?i_?n_?t': 'mount point'}

I don't know if it helps, but you can use pango to remove underscores:

>>> from gi.repository import Pango
>>> Pango.parse_markup("boot_loader", -1, "_")
(True, <PangoAttrList at 0x1157360>, 'bootloader', 'l')

- Chris


More information about the anaconda-patches mailing list