Commit Graph

9 Commits

Author SHA1 Message Date
Cole Robinson
8917305a6e Don't use count() for substring checking
Use the idiomatic 'X in Y'
2018-02-14 11:08:09 -05:00
Radostin Stoyanov
978fb25ac7 Wrap keys(), values() in a list
In Python 3 dict.values() [1] , dict.keys() [2] and dict.items() [3]
return a view [4] of the dictionary’s values, keys and items.

In Python 2 these functions return a list. [5] [6] [7]

To resolve this we can convert the result of these function to a list.

[1] https://docs.python.org/3/library/stdtypes.html#dict.values
[2] https://docs.python.org/3/library/stdtypes.html#dict.keys
[3] https://docs.python.org/3/library/stdtypes.html#dict.items
[4] https://docs.python.org/3/library/stdtypes.html#dict-views
[5] https://docs.python.org/2/library/stdtypes.html#dict.items
[6] https://docs.python.org/2/library/stdtypes.html#dict.keys
[7] https://docs.python.org/2/library/stdtypes.html#dict.values
2018-02-06 18:49:17 -05:00
Jim Fehlig
9a9f9ecd2c virtinst: ignore comments in keymap conf files
On a host system with keyboard configured to en-US, it was noticed
that virt-install created install XML with keymap='de'. The host
system did not have /etc/vconsole.conf, so /etc/sysconfig/keyboard
was the next file to check, which contained the following

KEYTABLE=""

Currently the parsing code does not ignore comments and incorrectly
parsed a 'de' keymap. Fix by ignoring any lines that start with '#'
after trimming whitespace.
2017-10-18 17:46:41 -04:00
Cole Robinson
62feeb02a8 Switch to python3 style 'except X as Y' notation
Which also works with python2.7
2017-05-05 14:52:11 -04:00
Giuseppe Scrivano
2a040ccd17 mass update: remove double spaces from comments
Updated by this script:

find -name '*.py' -exec sed -i "s|^\(#.*[^.?\!]\)  \(.*[^#]\)$|\1 \2|g" \{\} \;

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:22:31 +01:00
Giuseppe Scrivano
b2e962fcf3 virtinst: Use the default keymap when running tests
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-03 16:49:45 +02:00
Cole Robinson
187ce92621 hostkeymap: Centralize parsing, don't be so noisy
And add /etc/vconsole.conf parsing to close bug 882183
2013-10-02 12:35:59 -04:00
Cole Robinson
41afdfd9aa hostkeymap: Globally cache the host lookup
Rather than make the callers worry about it
2013-07-13 20:58:09 -04:00
Cole Robinson
d5f466d558 virtinst: util: Move keymap stuff to its own file 2013-04-13 16:31:13 -04:00