Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/general.py
AgeCommit message (Collapse)Author
2021-11-05Cleaned up all flake8 issues/warnings. Did some code cleaning as well, ↵Anton Hvornum
mostly how we called things in guided.py but also some SysCommand calls
2021-11-01Fixed general.py flake8 issues.Anton Hvornum
2021-09-06Merged in master.Anton Hvornum
2021-07-16Replace for loops with comprehensionsmonosans
2021-06-10Added wipe support to layout definitions. Also changed default start ↵Anton Hvornum
positions of partitions to 1MiB in.
2021-06-10Merging in latest changes from master.Anton Hvornum
2021-06-10Merge pull request #537 from archlinux/torxed-fix-517Anton Hvornum
Introduces the use of HTTP mirrors additionally
2021-06-10Merge pull request #538 from archlinux/torxed-fix-536Anton Hvornum
Attempt to fix issue regarding broken output
2021-06-06Added a json.dumps() helper that wraps JSON cls. Also tweaked the logic for ↵Anton Hvornum
the size creation so that they don't overlap
2021-06-02Wrong variable nameAnton Hvornum
2021-06-02Adding more granular debuggingAnton Hvornum
2021-06-02Attempt to fix issue regarding broken outputAnton Hvornum
Since pacman and some other commands these days write multiple lines and goes back and fourth, it's not reliable to say the "peaked" line is a single line. And if it's not, it will make the output look like garbage. So instead, we'll write any output - as is - and let the command deal with fancy printing.
2021-06-01Windows fix + Sorting based on listAnton Hvornum
This fix introduces changes so that development can be done (and tested) on other platforms than Linux. This is a convenience fix and shouldn't break anything (simply a few Linux-specific imports that have moved into the functions where they are used). This commit also introduces sorting based on a list of priorities (where the default will be last if not matched).
2021-05-22Since SysCommand() wraps SysCommandWorker(), but SysCommand() doesn't use ↵Anton Hvornum
contexts, we have to flush the output manually here to avoid newlines not being before the next output.
2021-05-20Use {installation.target} in custom commands handlerDylan Taylor
2021-05-20Extract custom-commands function into general.pyDylan Taylor
2021-05-19very minor whitespace fixesDylan Taylor
2021-05-19Added support for getting configuration from a config file (#364)Yash Tripathi
* added support for ingesting config * fixed condition to check key in dictionary * Removed redundant code, profile and desktop keys are now optional * Added base-config.json and support for pulling credentials from .env * added base config file and env file for users credentials * added silent install switch * added python-dotenv as a dependency * Updated Readme to include argparse changes as well as config ingestion * Updated Readme to include argparse changes as well as config ingestion * fixed typo in pyproject.toml * Replaced the magic __builtin__ global variable. This should fix mypy complaints while still retaining the same functionality, kinda. It's less automatic but it's also less of dark magic, which makes sense for anyone but me. * Fixes string index error. * Quotation error. * fixed initializing --script argument * added python-dotenv as a dependency * Installation can't be silent if config is not passed * fixed silent install help * fixed condition for ask_user_questions * reverted to creating profile object properly * Cleaned up and incorporated suggestions * added Profile import * added condition if Profile is null * fixed condition * updated parsing vars from argparse * removed loading users from .env * Reworking SysCommand & Moving to localectl for locale related activities (#4) * Moving to `localectl` rather than local file manipulation *(both for listing locales and setting them)*. * Swapped `loadkeys` for localectl. * Renamed `main` to `maim` in awesome profile. * Created `archinstall.Boot(<installation>)` which spawns a `systemd-nspawn` container against the installation target. * Exposing systemd.py's internals to archinstall global scope. * Re-worked `SysCommand` completely, it's now a wrapper for `SysCommandWorker` which supports interacting with the process in a different way. `SysCommand` should behave just like the old one, for backwards compatibility reasons. This fixes #68 and #69. * `SysCommand()` now has a `.decode()` function that defaults to `UTF-8`. * Adding back peak_output=True to pacstrap. Co-authored-by: Anton Hvornum <anton.feeds@gmail.com> Co-authored-by: Dylan Taylor <dylan@dylanmtaylor.com> Co-authored-by: Anton Hvornum <anton@hvornum.se> Co-authored-by: Anton Hvornum <anton.feeds@gmail.com> * fixed indent * removed redundant import * removed duplicate import * removed duplicate import Co-authored-by: Anton Hvornum <anton.feeds@gmail.com> Co-authored-by: Anton Hvornum <anton@hvornum.se> Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
2021-05-19Reworking SysCommand & Moving to localectl for locale related activitiesAnton Hvornum
* Moving to `localectl` rather than local file manipulation *(both for listing locales and setting them)*. * Swapped `loadkeys` for localectl. * Renamed `main` to `maim` in awesome profile. * Created `archinstall.Boot(<installation>)` which spawns a `systemd-nspawn` container against the installation target. * Exposing systemd.py's internals to archinstall global scope. * Re-worked `SysCommand` completely, it's now a wrapper for `SysCommandWorker` which supports interacting with the process in a different way. `SysCommand` should behave just like the old one, for backwards compatibility reasons. This fixes #68 and #69. * `SysCommand()` now has a `.decode()` function that defaults to `UTF-8`. * Adding back peak_output=True to pacstrap. Co-authored-by: Anton Hvornum <anton.feeds@gmail.com> Co-authored-by: Dylan Taylor <dylan@dylanmtaylor.com>
2021-05-15Perform refactoring to PEP 8 naming conventionsDylan Taylor
2021-05-15Fix mutable default argumentsDylan Taylor
https://docs.python-guide.org/writing/gotchas/#mutable-default-arguments
2021-05-15More formatting fixes to satisfy PEP 8Dylan Taylor
2021-05-15f-string fixesDylan Taylor
2021-05-15Whitespace changesDylan Taylor
2021-05-15Resolve a few more PEP issues in general.pyDylan Taylor
2021-05-15general.py formattingDylan Taylor
2021-05-15Many more manual changesDylan Taylor
2021-05-12some type hint fixes and a bad catch fixadvaithm
2021-04-27Moving away from custom log levels, to something that's well defined. (#360)Anton Hvornum
* Moving away from custom log levels, to something that's well defined. * Added backward compability to log() as well. * Added an option to force log messages out on screen even if the level is below the log level threashold. * Added force log messages when wrong notation is used. * Added some more length to the deprecated message * Swapped all log levels to use logging.<level> instead. Co-authored-by: Anton Hvornum <anton.feeds@gmail.com>
2021-04-17Merging in master to feature branch.Anton Hvornum
2021-04-13Modifying to enable piping in custom environment variables. This is ↵Anton Hvornum
required to disable systemd coloring and paging when querying for service states. Otherwise it returns unreliable data that can cause hanging.
2021-04-13Closing forked process PID in order to close any ramining open file handles.Anton Hvornum
2021-04-04Removed debugging, added an additional 'move back to beginning' and print ↵Anton Hvornum
the peak again. Added this to any pacstrap call.
2021-04-04Added some debuggingAnton Hvornum
2021-04-04Added stripping of peak output to avoid new lines forming.Anton Hvornum
2021-04-04Added error handling to sys_command's peak function.Anton Hvornum
2021-04-04Moved import due to circular imports.Anton Hvornum
2021-04-04Added functionality towards #155. It's not a progress bar per sae, but it ↵Anton Hvornum
will show the last line outputted by commands enabling peaking of the ongoing process.
2021-04-02Support passing commands as listskpcyrd
2021-03-23Also setting cwd (bad choice of name) to the workdir if one was specified. ↵Anton Hvornum
Which makes the trace.log to end up in the workdir as well.
2021-03-23Enabling archinstall.sys_command() to get a working directory when ↵Anton Hvornum
executing. The sys_command() is working pretty well for this very specific need, but this is an attempt to making it a bit more generic. A more general overhaul of the command should be done at some point.
2021-03-14Tweaked SysCallError() exception to include the exit code in a machine ↵Anton Hvornum
readable manner. Since it's useful as an indicator where calls might go wrong and for what reason.
2021-03-08Fixed the JSON_Encoder. The issue was that dictionaries are mutable, and ↵Anton Hvornum
dumping dictionaries and replacing keys also replaces the original value.
2021-02-17Testing auto-filter in the JSON encoder based on ! points markering ↵Anton Hvornum
sensitive data.
2021-01-25Added some more fields to the configuration output, as well as added a ↵Anton Hvornum
better fail safe for the logging output. Any exception during the installation will be caught by __exit__ in Installer(), hopefully.
2020-12-07Fixing a strip glitch in `sys_command()` causing certain output to get ↵Anton Hvornum
truncated in unwanted places (like fstab)
2020-11-04Fixed level issues on log output. Also tweaked it so that all log rows come ↵Anton Hvornum
to the log file, but not nessecarily the interactive screen (tty/journald). Also tweaked certain log messages to be printed vs not printed.
2020-11-04Added multiple log features.Anton Hvornum
* [Reintroduced](https://github.com/Torxed/archinstall/blob/f64a605449f59c677dff39962f1cb46616d893b7/archinstall.py#L57-L71) log levels * Created a global log file definition * Optional support for `python-systemd`'s journald handler. * Optional file output that has a globally configurable definition, that archinstall will honor in `archinstall.storage['logfile']`.
2020-10-19Fix some PEP-8 errors.Varun Madiath
2020-10-19Fix typo in function parameterVarun Madiath
`suppress_errors` was previously spelt `surpress_errors`