236 Commits (84d599625f156f5a34e5d0d7ce331c0e11ed8c90)

Author SHA1 Message Date
Adriaan de Groot 84d599625f [libcalamares] Give Python jobs a warning()
- Add libcalamares.utils.warning() alongside debug() for
   Python modules to output warnings.
7 years ago
Adriaan de Groot dbbec4f76d [libcalamares] Use cDebug, polish messages 7 years ago
Adriaan de Groot d62c7b93c6 [libcalamares] Polish weird namespace use 7 years ago
Adriaan de Groot cf02f7aab5 [libcalamares] Avoid nullptr crashes
- The Python testmodule script can end up calling in to System
   methods (via System::instance()). This is unusual, and the
   System instance has not been created at that point.
   Now, create an instance and warn about it.
7 years ago
Adriaan de Groot df0d9dcb88 [libcalamares] Provide convenience functions for warning and error 7 years ago
Adriaan de Groot 79d81700b3 [libcalamares] Use -D for just debug-level setting
- Original flag -d sets debugging but also changes behavior
 - New -D just sets debugging
 - Simplify QStringList (use C++ 11)
7 years ago
Adriaan de Groot ae5511c2f3 [libcalamares] Rationalize logging
- Move logging-levels to an enum
 - (re-)Order logging-levels so that the normal debug statement is
   not the most-important (lowest level).
 - Drop using namespace std;
7 years ago
Adriaan de Groot 874514a4e4 i18n: drop orphaned #undefs (thanks Kevin Kofler) 7 years ago
Adriaan de Groot d27675d660 i18n: drop superfluous QObject* parent
These additional pointers were introduced for translations,
and needed their own tricks to get lupdate to recognize the
strings. Using QCoreApplication::translate() removes the
need to a QObject to provide context. Drop the now-unneeded
parameters.
7 years ago
Adriaan de Groot c71385e93f i18n: fix broken translation in CommandList 7 years ago
Adriaan de Groot f954496acf i18n: avoid translation tricks, use QCoreApplication::translate
Instead of using tr and some macro hacks to get lupdate to
recognize the translation, instead use QCoreApplication::translate()
which takes its own context for translation.
7 years ago
Adriaan de Groot aed904e3b4 Merge branch 'i897-timeout'
FIXES #897
7 years ago
Adriaan de Groot 2da430fa36 [libcalamares] Allow CommandLine to have unset timeout
- Introduce enum for the appropriate constant
 - If the timeout isn't set, then defer to the timeout set
   on the commandlist when running the commands.
7 years ago
Adriaan de Groot c641f5dec6 [libcalamares] Implement object-style command line
- handle command: and timeout: entries
 - test for setting the values
7 years ago
Adriaan de Groot fe2be46d3f [libcalamares] Extend command-list with timeouts
- Replace plain StringList with a list of <String, timeout> pairs,
   and run that instead. All code paths still use the default 10sec
   timeout and there's no way to change that.
7 years ago
Adriaan de Groot 778feb50e8 [libcalamares] Additional convenience for doubles 7 years ago
Adriaan de Groot 54a9bbb949 [libcalamares] Don't eat output on timeout.
- Copy stdout from timed-out process into the output variable,
   instead of just dumping it into the log file. This will
   improve the user experience, too, because they will get some
   feedback / explanation of what the process has done.
7 years ago
Adriaan de Groot 26dfd56f6d [libcalamares] Additional convenience function extracting int 7 years ago
Adriaan de Groot b828580464 Merge remote-tracking branch 'origin/simplify-plugin' 7 years ago
Adriaan de Groot 9a9c6da6db i18n: try to trick Transifex into recognizing these strings 7 years ago
Adriaan de Groot 97fb83c743 [libcalamares] Change debug logging of how job name is derived 7 years ago
Adriaan de Groot abc6914528 [libcalamares] Enforce singleton-ness of CalamaresPython::Helper
- unset instance pointer on destruction
 - make constructor private, and the instance accessor
   should create an instance if there isn't one.
7 years ago
Adriaan de Groot 86b899566e [libcalamares] Silence compiler warnings about PluginFactories
- d_ptr shadows QObject d_ptr, which clang complains about
 - rename, and don't use Q_D and similar because it messes with internals.
7 years ago
Adriaan de Groot 510af704d8 [libcalamares] Improve documentation
- reference to _WITH_JSON is bogus copy-replace from other code
 - fix style of sample code.
7 years ago
Adriaan de Groot 0020fd885c [libcalamares] Remove unused extern declaration 7 years ago
Adriaan de Groot a2bdc12f25 [libcalamares] Drop unused plugin defines
- Remove some superfluous intermediate defines
 - baseFactory was not used (always Calamares::PluginFactory)
 - Move DECLARATION and DEFINITIONS apart
 - CALAMARES_PLUGIN_FACTORY_DEFINITION was redefined (identically)
 - CALAMARES_PLUGIN_FACTORY_DECLARATION was redefined (identically)
 - __VA_ARGS__ was constant
7 years ago
Adriaan de Groot f01c7cda6b [libcalamares] Fix debug output classname 7 years ago
Adriaan de Groot 913690650f [libcalamares] Move CommandList into libcalamares
- Move CommandList so it can be used from more modules than
   just ShellProcess
 - Allow a CommandList to run itself. This centralizes
   code for executing one or more commands and simplifies
   the ShellProcess module.

Various small cleanups:
 - mention instance id in log message
 - code formatting / style
7 years ago
Adriaan de Groot 60f4dd7b3b [libcalamares] Improve explanation of failed processes. 7 years ago
Adriaan de Groot 4ff1a0d5ea [libcalamares] another convenience for running commands
Back targetEnvCommand() with a more general runCommand()
that takes an argument selecting the location to run
the command in. This allows us also to use the same
API for running processes in the host during install,
as we do for running them in the target system.

One reason for this change is wanting to run (user-specified)
commands and independently from the global dontChroot setting,
run those commands in the live system or the target.

This changes the ABI of the DLL, since targetEnvCommand()
is no longer exported. Plugins will need to be recompiled.

 - refactor targetEnvCommand() into more general runCommand().
 - While here, allow host system commands to run even if
   there is no global storage.
 - provide convenience accessors for ProcessResult members
 - Move explanation of process errors out of ProcessJob
   - Move from ProcessJob to ProcessResult, so it can be
     reused outside of ProcessJob (e.g. from ShellProcessJob).
   - Add some convenience functions, too.
7 years ago
Adriaan de Groot f8a53f9646 [libcalamares] Refactor explanation of process-job errors 7 years ago
Adriaan de Groot 762ad54344 Documentation: change http links to GitHub to https 7 years ago
Adriaan de Groot 8a053f3c9b [libcalamares] Allow retrieving chroot mode from system (as well as settings) 7 years ago
Adriaan de Groot 298ff0cbeb Merge branch '3.1.x-stable' 7 years ago
Adriaan de Groot 517dbfab06 [libcalamares] The script namespace is actually a dict
Use dict methods, in particular d.get(k, v), to retrieve
the pretty_name() function (or None if it isn't there).
Using getattr() on a dict will not return values in the
dict.
7 years ago
Adriaan de Groot 0d413ba750 Merge branch '3.1.x-stable' 7 years ago
Adriaan de Groot 12369abaa4 [libcalamares] Refactor to reduce compiler warnings 7 years ago
Adriaan de Groot c284304872 [libcalamares] Adjust copyright lines 7 years ago
Adriaan de Groot cc195eb3d4 [libcalamares] Improve reporting of CalledProcessError
For called processes, replace the not-very-useful type message
with the command-explanation, and replace the value (previously
command-explanation) by the stderr of the failed command.

FIXES #865
7 years ago
Adriaan de Groot 9df796a3fd [libcalamares] Log earlier, warnings-- 7 years ago
Adriaan de Groot 1e27c6438a [libcalamares] Special-case CalledProcessError 7 years ago
Adriaan de Groot a0a8ab0048 [libcalamares] Refactor Python target_env calls
This is why the whole refactoring started: to get the process output
and exit code in one spot so we can attach the process output
to the (Python exception) CalledProcessError in all the code
paths, not just those that are explicitly looking for output.
7 years ago
Adriaan de Groot 6693d91152 [libcalamares] Refactor bp:list -> QStringList 7 years ago
Adriaan de Groot 9d31380980 [libcalamares] Refactor target-environment calls
- Add a more general targetEnvCommand() that returns both
   error code and process output.
 - Change existing targetEnvCall() and targetEnvOutput()
   to use general form while discarding some data.
7 years ago
Adriaan de Groot f5aec1ad8a [libcalamares] Add output to CalledProcessError
- Refactor, internal _handle_check_target_env_call_error doesn't need
   to be in header or visible.
 - Add optional output (of the command) to the Python exception.
7 years ago
Adriaan de Groot 1f3f6111f7 [libcalamares] Log output from failed commands 7 years ago
Adriaan de Groot b4d4351825 [libcalamares] Better Python traceback handling:
- log the whole error message as plain text
 - convert to HTML only for the ui
7 years ago
Adriaan de Groot 188050a77c Merge branch 'master' into usertracking 7 years ago
Adriaan de Groot e8e284f724 Merge remote-tracking branch 'origin/kcrash' 7 years ago
Adriaan de Groot 7a7e2b16cb [libcalamares] Some extra system-information functions 7 years ago