list_or_* functions (e.g. list_or_string) will now always return a list,
however will accept lists or indivitual values. Also added a list_or()
generator function, similar to what already exists for list_of().
- Do not try to use a pager if it explicitly disabled with PAGER='' in
the environment.
- If terminal size is identified as (0, 0), fall back to default (80,
25).
Since a command would still be running on time out, it would prevent
issuing subsequent commands in the same SSH shell, make it look like
the device has become unresponsive.
If a timeout condition is his, send ^C to kill the current foreground
process and make the shell available for subsequent commands.
The key file must only be readable by the owner. If the specified key
file has different access permissions, create a temporary copy with the
right permissions and use that.
- adding missing cpu id conversion to set_cpu_min_freq
- adding "exact" parameter to set_cpu_frequency; only produce an error
when the specified frequency is not supported by the cpu if "axact"
is set; (otherwise let cpufreq decide what the actual frequency will
be).
- list_to_range and range_to_list convert between lists of integers
and corresponding range strings, e.g. between [0,1,2,4] and '0-2,4'
- list_to_mask and mask_to_list convert between lists of integers and
corresponding integer masks, e.g. between [0,1,2,4] and 0x17
Conflicts:
wlauto/utils/misc.py
- added caseless_string type. This behaves exactly like a string, except
this ignores case in comparisons. It does, however, preserve case. E.g.
>>> s = caseless_string('Test')
>>> s == 'test'
True
>>> print s
Test
- added list_of type generating function. This allows to dynamically
generate type-safe list types based on an existing type. E.g.
>>> list_of_bool = list_of(bool)
>>> list_of_bool(['foo', 0, 1, '', True])
[True, False, True, False, True]
- Update core_names Device Parameter to be of type caseless_string
When the merging logic was updated to preserve duplicates within the
same list, it inadvertently broke the logic that removed items marked
for removal with a '~'. This commit rectifies that.
Note to self: merging functions are doing *way* to much; they should be
refactored into several individual function and config should be
resolved in distinct stages.
If list parameter values contained duplicates, those got removed when
merging parameter values from different sources. This commit fixes that
behavor, so that duplcates that appear within the *same* list are
preserved.
Very old versions of IPython do not have IPython.version_info attribute
that the ultls module relied on. This commit changes it to use the more
standard __version__ attriute that is present in all versions.
Adding a parater to wlauto.utils.misc.check_output to specify that it
should ignore certain error codes when they are returned by the
subprocess and not raise them as errors.
run_cell() becomes more complicated when we add ipython version 3
support which upsets pylint because there are "too many
branches (15/12)". Factor out part of the function to make pylint
happy.
The kernel may go idle before it processes the next input, which break
the while=True loop in run_cell() early. Wait for an acknowledgement
of the input we've sent to the kernel before considering an idle
message to mean that the cell has been parsed.
The internal ABI for ipython has changed between ipython version 2 and
3. In its current state, the result processor only works with IPython
version 2, so fail if the user wants to use the result processor with
the wrong version.
Abstract the ipython interface to a file so that we can make it support
versions 2 and 3 at the same time.
- connect() to device before issuing the initial reboot, as soft reset
requires a device connection.
- boot() has been implemented to wait properly for the device to reboot
after reset.
- port now defaults to 22 rather than being left unset, as need
something to connect to when polling for device after reboot.
- Only use -P option for scp when port is *not* 22; as that option
appears to cause intermittent issues with default scp on Ubuntu 12.04
On some devices, sudo presents a different prompt when asking for a
password. All the prompt to be specified in device configruation to
handle such cases.
terminalsize was loaded from a location added to sys.path during
bootstrap. This appeared to be causing import issues. There is no longer
a good reason for terminalsize to be loaded that way, so just moved it
under wlauto.utils so that it can be loaded normally.
- UEFI config can be specified as a device_config parameter
- The same config is used to create a missing UEFI entry, and
to re-create the entry when flashing. UEFI config now wholy
resides within the device and is not specified for vexpress
flasher.