aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-02-22 15:05:10 +0100
committerMattias Andrée <m@maandree.se>2026-02-22 15:05:10 +0100
commit1d94cfcf04b8d4ce97fdd738e085911713dbe494 (patch)
treeb299019ec58e49f6d048e99f15709f27d7de14ed
parentUpdate e-mail (diff)
downloaddlu-1d94cfcf04b8d4ce97fdd738e085911713dbe494.tar.gz
dlu-1d94cfcf04b8d4ce97fdd738e085911713dbe494.tar.bz2
dlu-1d94cfcf04b8d4ce97fdd738e085911713dbe494.tar.xz
m fixes
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r--Makefile9
-rw-r--r--README4
-rw-r--r--dlu.14
-rwxr-xr-xdlu.py12
-rw-r--r--example/Makefile2
-rw-r--r--example/README10
6 files changed, 23 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index 33e5c28..177852e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+.POSIX:
+
PREFIX = /usr
BINDIR = $(PREFIX)/bin
DATADIR = $(PREFIX)/share
@@ -17,15 +19,15 @@ install-copyright: install-license
install-cmd:
mkdir -p -- "$(DESTDIR)$(BINDIR)"
- install -m755 -- dlu.py "$(DESTDIR)$(BINDIR)/$(COMMAND)"
+ cp -- dlu.py "$(DESTDIR)$(BINDIR)/$(COMMAND)"
install-man:
mkdir -p -- "$(DESTDIR)$(MAN1DIR)"
- install -m644 -- dlu.1 "$(DESTDIR)$(MAN1DIR)/$(COMMAND).1"
+ cp -- dlu.1 "$(DESTDIR)$(MAN1DIR)/$(COMMAND).1"
install-license:
mkdir -p -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
- install -m644 -- LICENSE "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE"
+ cp -- LICENSE "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE"
uninstall:
-rm -- "$(DESTDIR)$(BINDIR)/$(COMMAND)"
@@ -36,5 +38,6 @@ uninstall:
-rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
clean:
+ @:
.PHONY: all clean
diff --git a/README b/README
index 934b424..a6a989c 100644
--- a/README
+++ b/README
@@ -14,7 +14,7 @@ DESCRIPTION
Returns a list of all dictionaries.
load_dictionary(dictionary : str) -> bool
- Sets the fuction get() or a variable that get() reads
+ Sets the function get() or a variable that get() reads
to identify which dictionary has been selected. The
function shall return True if the dictionary exists,
and False otherwise.
@@ -30,7 +30,7 @@ DESCRIPTION
Modifies and returns a word so that it can be used
to compare against known words in the dictionary.
- The default implemention of this function covers the
+ The default implementation of this function converts the
word to lower case using Python's string class's
lower() function.
diff --git a/dlu.1 b/dlu.1
index 23ca185..ab4d5bd 100644
--- a/dlu.1
+++ b/dlu.1
@@ -23,7 +23,7 @@ a Python 3 file which defines the functions:
Returns a list of all dictionaries.
.TP
.BR load_dictionary "(\fIdictionary\fP : str) -> bool"
-Sets the fuction
+Sets the function
.BR get ()
or a variable that
.BR get ()
@@ -55,7 +55,7 @@ Modifies and returns a
so that it can be used to compare against known words
in the dictionary.
-The default implemention of this function covers the
+The default implementation of this function converts the
.I word
to lower case using Python's string class's
.BR lower ()
diff --git a/dlu.py b/dlu.py
index 8783e7d..3711a66 100755
--- a/dlu.py
+++ b/dlu.py
@@ -32,7 +32,7 @@ else:
dictionary_name = sys.argv[i]
sought_word = sys.argv[i + 1]
-# Default functions, can be overriden by configurations on call to load_dictionary.
+# Default functions, can be overridden by configurations on call to load_dictionary.
if not f_list:
display_envs = ['MDS_DISPLAY', 'MIR_DISPLAY', 'WAYLAND_DISPLAY', 'DISPLAY']
x_reads = [
@@ -50,7 +50,7 @@ if not f_list:
for command_lambda in reads[disps[0]]:
command = command_lambda(filename, str(page));
os.execvp(command[0], command)
- print("%s: could find any viewer to use." % sys.argv[0], file = sys.stderr)
+ print("%s: could not find any viewer to use" % sys.argv[0], file = sys.stderr)
print("%s: file to open: %s" % (sys.argv[0], filename), file = sys.stderr)
print("%s: page to open: %i" % (sys.argv[0], page), file = sys.stderr)
sys.exit(1)
@@ -77,10 +77,10 @@ for file in ('$XDG_CONFIG_HOME/%/%rc', '$HOME/.config/%/%rc', '$HOME/.%rc', '$~/
else:
file = None
break
- # Proceed if there where no errors.
+ # Proceed if there were no errors.
if file is not None:
- # With use $~ (instead of ~) for the user's proper home
- # directroy. HOME should be defined, but it could be missing.
+ # We use $~ (instead of ~) for the user's proper home
+ # directory. HOME should be defined, but it could be missing
# It could also be set to another directory.
if file.startswith('$~'):
import pwd
@@ -100,7 +100,7 @@ if config_file is not None:
# Read configuration script file.
with open(config_file, 'rb') as script:
code = script.read()
- # Decode configurion script file and add a line break
+ # Decode configuration script file and add a line break
# at the end to ensure that the last line is empty.
# If it is not, we will get errors.
code = code.decode('utf-8', 'strict') + '\n'
diff --git a/example/Makefile b/example/Makefile
index 0df1ef6..d6d0b05 100644
--- a/example/Makefile
+++ b/example/Makefile
@@ -1,3 +1,5 @@
+.POSIX:
+
all: dict.pdf
dict.pdf: dict.tex
diff --git a/example/README b/example/README
index 9e12b3a..90dace4 100644
--- a/example/README
+++ b/example/README
@@ -1,8 +1,8 @@
Step 1) cd into this directory.
Step 2) Run `make`.
-Step 3) If ~/.config/dlu already exists move it.
-Step 4) Run `ln -s ~/.config/dlu .`.
-Step 5) You can know run ../dlu.py.
-Step 6) Run `rm ~/.config/dlu`
+Step 3) If ~/.config/dlu already exists, move it.
+Step 4) Run `ln -s -- ~/.config/dlu .`.
+Step 5) You can now run ../dlu.py.
+Step 6) Run `rm -- ~/.config/dlu`.
Step 7) If ~/.config/dlu already existed, restore it.
-Step 8) If ~/.config/dlu didn't exist, install dlu and set it up.
+Step 8) If ~/.config/dlu did not exist, install dlu and set it up.