diff options
| -rw-r--r-- | Makefile | 9 | ||||
| -rw-r--r-- | README | 4 | ||||
| -rw-r--r-- | dlu.1 | 4 | ||||
| -rwxr-xr-x | dlu.py | 12 | ||||
| -rw-r--r-- | example/Makefile | 2 | ||||
| -rw-r--r-- | example/README | 10 |
6 files changed, 23 insertions, 18 deletions
@@ -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 @@ -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. @@ -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 () @@ -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. |
