Skip to content

Commit e261fc0

Browse files
committed
README: markup and line wrapping
Bash doesn't do anything special for a command with '#', but at least zsh treat it as a comment. It's better to quote such a commandline.
1 parent 8659af2 commit e261fc0

File tree

1 file changed

+28
-23
lines changed

1 file changed

+28
-23
lines changed

README.md

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ python-systemd
33

44
Python module for native access to the systemd facilities. Functionality
55
is separated into a number of modules:
6-
- systemd.journal supports sending of structured messages to the journal
6+
- `systemd.journal` supports sending of structured messages to the journal
77
and reading journal files,
8-
- systemd.daemon wraps parts of libsystemd useful for writing daemons
8+
- `systemd.daemon` wraps parts of `libsystemd` useful for writing daemons
99
and socket activation,
10-
- systemd.id128 provides functions for querying machine and boot identifiers
10+
- `systemd.id128` provides functions for querying machine and boot identifiers
1111
and a lists of message identifiers provided by systemd,
12-
- systemd.login wraps parts of libsystemd used to query logged in users
12+
- `systemd.login` wraps parts of `libsystemd` used to query logged in users
1313
and available seats and machines.
1414

1515
Installation
@@ -35,12 +35,12 @@ To build from source
3535
On CentOS, RHEL, and Fedora with Python 2:
3636

3737
dnf install git python-pip gcc python-devel systemd-devel
38-
pip install git+https://github.com/systemd/python-systemd.git#egg=systemd-python
38+
pip install 'git+https://github.com/systemd/python-systemd.git#egg=systemd-python'
3939

4040
On Fedora with Python 3:
4141

4242
dnf install git python3-pip gcc python3-devel systemd-devel
43-
pip3 install git+https://github.com/systemd/python-systemd.git#egg=systemd-python
43+
pip3 install 'git+https://github.com/systemd/python-systemd.git#egg=systemd-python'
4444

4545
On Debian or Ubuntu with Python 2:
4646

@@ -62,7 +62,7 @@ Quick example:
6262
journal.send('Hello, again, world', FIELD2='Greetings!', FIELD3='Guten tag')
6363
journal.send('Binary message', BINARY=b'\xde\xad\xbe\xef')
6464

65-
There is one required argument -- the message, and additional fields
65+
There is one required argument the message, and additional fields
6666
can be specified as keyword arguments. Following the journald API, all
6767
names are uppercase.
6868

@@ -119,7 +119,12 @@ Show entries by a specific executable (`journalctl /usr/bin/vim`):
119119
for entry in j:
120120
print(entry['MESSAGE'])
121121

122-
- Note: matches can be added from many different fields, for example entries from a specific process ID can be matched with the `_PID` field, and entries from a specific unit (ie. `journalctl -u systemd-udevd.service`) can be matched with `_SYSTEMD_UNIT`. See all fields available at the [systemd.journal-fields docs](https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html).
122+
- Note: matches can be added from many different fields, for example
123+
entries from a specific process ID can be matched with the `_PID`
124+
field, and entries from a specific unit (ie. `journalctl -u
125+
systemd-udevd.service`) can be matched with `_SYSTEMD_UNIT`.
126+
See all fields available at the
127+
[systemd.journal-fields docs](https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html).
123128

124129
Show kernel ring buffer (`journalctl -k`):
125130

@@ -149,13 +154,13 @@ Read entries in reverse (`journalctl _EXE=/usr/bin/vim -r`):
149154
Notes
150155
-----
151156

152-
* Unlike the native C version of journald's sd_journal_send(),
153-
printf-style substitution is not supported. Perform any
154-
substitution using Python's % operator or .format() capabilities
155-
first.
156-
* A ValueError is raised if sd_journald_sendv() results in an error.
157-
This might happen if there are no arguments or one of them is
158-
invalid.
157+
* Unlike the native C version of journald's `sd_journal_send()`,
158+
printf-style substitution is not supported. Perform any
159+
substitution using Python's f-strings first (or .format()
160+
capabilities or `%` operator).
161+
* A `ValueError` is raised if `sd_journald_sendv()` results in an
162+
error. This might happen if there are no arguments or one of them
163+
is invalid.
159164

160165
A handler class for the Python logging framework is also provided:
161166

@@ -165,16 +170,16 @@ A handler class for the Python logging framework is also provided:
165170
logger.addHandler(journal.JournalHandler(SYSLOG_IDENTIFIER='custom_unit_name'))
166171
logger.warning("Some message: %s", 'detail')
167172

168-
libsystemd version compatibility
169-
-------------------------------
173+
`libsystemd` version compatibility
174+
----------------------------------
170175

171-
This module may be compiled against any version of libsystemd. At
176+
This module may be compiled against any version of `libsystemd`. At
172177
compilation time, any functionality that is not available in that
173-
version of systemd is disabled, and the resulting binary module will
174-
depend on symbols that were available at compilation time. This means
175-
that the resulting binary module is compatible with that or any later
176-
version of libsystemd. To obtain maximum possible functionality, this
177-
module must be compile against suitably recent libsystemd.
178+
version is disabled, and the resulting binary module will depend on
179+
symbols that were available at compilation time. This means that the
180+
resulting binary module is compatible with that or any later version
181+
of `libsystemd`. To obtain maximum possible functionality, this module
182+
must be compile against suitably recent libsystemd.
178183

179184
Documentation
180185
=============

0 commit comments

Comments
 (0)