Skip to content

Commit eadfc95

Browse files
authored
Merge pull request #171 from desultory/dev
fix unescaped strings, color consistency
2 parents 88fa821 + 3290641 commit eadfc95

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Log lines info (20) level or greater should be formatted such that:
1414
Variables should generally be colored using the following scheme:
1515

1616
* `cyan` for autodetected values
17-
* `green` for written files
17+
* `blue` for config/stage info
18+
* `green` for writted/read files
1819
* `magenta` for kernel/kmod related things
1920
* `yellow` when cleaning files/build directories
2021
* `red` for overrides or warnings

src/ugrd/base/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def readvar(self) -> str:
179179
def check_var(self) -> str:
180180
"""Returns a bash function that checks the value of a variable.
181181
if it's not set, tries to read the cmdline."""
182-
return """
182+
return r"""
183183
if [ -z "$(readvar "$1")" ]; then # preferably the variable is set, because this is slower
184184
cmdline=$(awk -F '--' '{print $1}' /proc/cmdline) # Get everything before '--'
185185
if grep -qE "(^|\s)$1(\s|$)" <<< "$cmdline"; then
@@ -259,7 +259,7 @@ def klog(self) -> str:
259259
# To feel more at home
260260
def edebug(self) -> str:
261261
"""Returns a bash function like edebug."""
262-
return """
262+
return r"""
263263
if check_var quiet; then
264264
return
265265
fi

src/ugrd/initramfs_dict.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "desultory"
2-
__version__ = "2.3.0"
2+
__version__ = "2.3.1"
33

44
from collections import UserDict
55
from pathlib import Path
@@ -226,7 +226,7 @@ def _process_imports(self, import_type: str, import_value: dict) -> None:
226226
self["imports"]["custom_init"] = function_list[0]
227227
self.logger.info(
228228
"Registered custom init function: %s"
229-
% colorize(function_list[0].__name__, "magenta", bold=True)
229+
% colorize(function_list[0].__name__, "blue", bold=True)
230230
)
231231
continue
232232

0 commit comments

Comments
 (0)