From 5e9a501382b9086b91c22d289f2bbf790c4d9934 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Fri, 24 Nov 2023 13:12:35 +0800 Subject: [PATCH] Fix typos Found via `typos --hidden --format brief` --- Readme.md | 6 +++--- elodie.py | 2 +- elodie/{compatability.py => compatibility.py} | 2 +- elodie/external/pyexiftool.py | 6 +++--- elodie/filesystem.py | 6 +++--- elodie/geolocation.py | 8 ++++---- elodie/media/media.py | 4 ++-- elodie/plugins/plugins.py | 2 +- elodie/tests/geolocation_test.py | 4 ++-- elodie/tests/helper.py | 2 +- elodie/tests/media/photo_test.py | 4 ++-- elodie/tools/add_original_name.py | 2 +- 12 files changed, 24 insertions(+), 24 deletions(-) rename elodie/{compatability.py => compatibility.py} (97%) diff --git a/Readme.md b/Readme.md index a9589a7b..06a7513a 100644 --- a/Readme.md +++ b/Readme.md @@ -66,7 +66,7 @@ I only do 3 things. * Firstly I organize your existing collection of photos into a customizable folder structure. * Second I help make it easy for all the photos you haven't taken yet to flow into the exact location they belong. -* Third but not least I promise to do all this without a yucky propietary database that some friends of mine use. +* Third but not least I promise to do all this without a yucky proprietary database that some friends of mine use. *NOTE: make sure you've installed everything I need before running the commands below. [Instructions](#quickstart-guide) at the top of this page.* @@ -193,7 +193,7 @@ You can add a custom folder structure by editing your `config.ini` file (which s #### Custom folder examples -Sometimes examples are easier to understand than explainations so I'll start there. If you'd like to understand my magic I explain it in more detail below these examples. You customize your folder structure in the `Directory` section of your `config.ini`. For details of the supported formats see [strftime.org](http://strftime.org/) +Sometimes examples are easier to understand than explanations so I'll start there. If you'd like to understand my magic I explain it in more detail below these examples. You customize your folder structure in the `Directory` section of your `config.ini`. For details of the supported formats see [strftime.org](http://strftime.org/) ``` [Directory] @@ -377,7 +377,7 @@ When I organize photos I look at the embedded metadata. Here are the details of | Location (video, audio) | XMP:GPSLatitude, Composite:GPSLatitude, XMP:GPSLongitude, Composite:GPSLongitude | Composite tags are read-only | | Title (photo) | XMP:Title | | | Title (video, audio) | XMP:DisplayName | | -| Album | XMP-xmpDM:Album, XMP:Album | XMP:Album is user defined in `configs/ExifTool_config` for backwards compatability | +| Album | XMP-xmpDM:Album, XMP:Album | XMP:Album is user defined in `configs/ExifTool_config` for backwards compatibility | | Camera Make (photo, video) | EXIF:Make, QuickTime:Make | | | Camera Model (photo, video) | EXIF:Model, QuickTime:Model | | diff --git a/elodie.py b/elodie.py index 521548c2..1149ece9 100755 --- a/elodie.py +++ b/elodie.py @@ -18,7 +18,7 @@ from elodie import constants from elodie import geolocation from elodie import log -from elodie.compatability import _decode +from elodie.compatibility import _decode from elodie.config import load_config from elodie.filesystem import FileSystem from elodie.localstorage import Db diff --git a/elodie/compatability.py b/elodie/compatibility.py similarity index 97% rename from elodie/compatability.py rename to elodie/compatibility.py index bc6f5f3a..d4e8dd5b 100644 --- a/elodie/compatability.py +++ b/elodie/compatibility.py @@ -70,7 +70,7 @@ def _copyfile(src, dst): pass -# If you want cross-platform overwriting of the destination, +# If you want cross-platform overwriting of the destination, # use os.replace() instead of rename(). # https://docs.python.org/3/library/os.html#os.rename def _rename(src, dst): diff --git a/elodie/external/pyexiftool.py b/elodie/external/pyexiftool.py index d09aa2a2..973aade3 100644 --- a/elodie/external/pyexiftool.py +++ b/elodie/external/pyexiftool.py @@ -128,7 +128,7 @@ def strip_nl (s): # Error checking function -# Note: They are quite fragile, beacsue teh just parse the output text from exiftool +# Note: They are quite fragile, beacsue the just parse the output text from exiftool def check_ok (result): """Evaluates the output from a exiftool write operation (e.g. `set_tags`) @@ -166,7 +166,7 @@ class ExifTool(object, with_metaclass(Singleton)): """Run the `exiftool` command-line tool and communicate to it. You can pass two arguments to the constructor: - - ``addedargs`` (list of strings): contains additional paramaters for + - ``addedargs`` (list of strings): contains additional parameters for the stay-open instance of exiftool - ``executable`` (string): file name of the ``exiftool`` executable. The default value ``exiftool`` will only work if the executable @@ -193,7 +193,7 @@ class ExifTool(object, with_metaclass(Singleton)): options will be silently ignored by exiftool, so there's not much that can be done in that regard. You should avoid passing non-existent files to any of the methods, since this will lead - to undefied behaviour. + to undefined behaviour. .. py:attribute:: running diff --git a/elodie/filesystem.py b/elodie/filesystem.py index 92d7807e..cb862483 100644 --- a/elodie/filesystem.py +++ b/elodie/filesystem.py @@ -11,7 +11,7 @@ import shutil import time -from elodie import compatability +from elodie import compatibility from elodie import geolocation from elodie import log from elodie.config import load_config @@ -180,7 +180,7 @@ def get_file_name(self, metadata): this_value = os.path.splitext(metadata['original_name'])[0] else: # We didn't always store original_name so this is - # for backwards compatability. + # for backwards compatibility. # We want to remove the hardcoded date prefix we used # to add to the name. # This helps when re-running the program on file @@ -583,7 +583,7 @@ def process_file(self, _file, destination, media, **kwargs): # Move the exif _original back to the initial source file shutil.move(exif_original_file, _file) else: - compatability._copyfile(_file, dest_path) + compatibility._copyfile(_file, dest_path) # Set the utime based on what the original file contained # before we made any changes. diff --git a/elodie/geolocation.py b/elodie/geolocation.py index 28e215f9..42c6e843 100644 --- a/elodie/geolocation.py +++ b/elodie/geolocation.py @@ -48,7 +48,7 @@ def coordinates_by_name(name): # geocodeQuality=city. geolocation_result = geolocation_info['results'][0] use_location = geolocation_result['locations'][0]['latLng'] - # Loop over the locations to see if we come accross a + # Loop over the locations to see if we come across a # geocodeQuality=city. # If we find a city we set that to the use_location and break for location in geolocation_result['locations']: @@ -147,7 +147,7 @@ def place_name(lat, lon): # Try to get cached location first db = Db() - # 3km distace radious for a match + # 3km distance radious for a match cached_place_name = db.get_location_name(lat, lon, 3000) # We check that it's a dict to coerce an upgrade of the location # db from a string location to a dictionary. See gh-160. @@ -159,7 +159,7 @@ def place_name(lat, lon): if(geolocation_info is not None and 'address' in geolocation_info): address = geolocation_info['address'] # gh-386 adds support for town - # taking precedence after city for backwards compatability + # taking precedence after city for backwards compatibility for loc in ['city', 'town', 'state', 'country']: if(loc in address): lookup_place_name[loc] = address[loc] @@ -246,7 +246,7 @@ def parse_result(result): def parse_result_address(result): # We want to store the city, state and country # The only way determined to identify an unfound address is - # that none of the indicies were found + # that none of the indices were found if( 'results' not in result or len(result['results']) == 0 or 'locations' not in result['results'][0] or diff --git a/elodie/media/media.py b/elodie/media/media.py index 788b670d..2d02cfd7 100644 --- a/elodie/media/media.py +++ b/elodie/media/media.py @@ -84,7 +84,7 @@ def get_coordinate(self, type='latitude'): # The lat/lon _keys array has an order of precedence. # The first key is writable and we will give the writable - # key precence when reading. + # key presence when reading. direction_multiplier = 1.0 for key in self.latitude_keys + self.longitude_keys: if key not in exif: @@ -252,7 +252,7 @@ def set_location(self, latitude, longitude): # The lat/lon _keys array has an order of precedence. # The first key is writable and we will give the writable - # key precence when reading. + # key presence when reading. tags = { self.latitude_keys[0]: latitude, self.longitude_keys[0]: longitude, diff --git a/elodie/plugins/plugins.py b/elodie/plugins/plugins.py index bbf16f81..6e6c5b4b 100644 --- a/elodie/plugins/plugins.py +++ b/elodie/plugins/plugins.py @@ -15,7 +15,7 @@ from sys import exc_info from traceback import format_exc -from elodie.compatability import _bytes +from elodie.compatibility import _bytes from elodie.config import load_config_for_plugin, load_plugin_config from elodie.constants import application_directory from elodie import log diff --git a/elodie/tests/geolocation_test.py b/elodie/tests/geolocation_test.py index 551ac0f1..6fed192b 100644 --- a/elodie/tests/geolocation_test.py +++ b/elodie/tests/geolocation_test.py @@ -130,7 +130,7 @@ def test_lookup_debug_mapquest_url(): @mock.patch('elodie.constants.location_db', '%s/location.json-cached' % gettempdir()) def test_place_name_deprecated_string_cached(): - # See gh-160 for backwards compatability needed when a string is stored instead of a dict + # See gh-160 for backwards compatibility needed when a string is stored instead of a dict helper.reset_dbs() with open('%s/location.json-cached' % gettempdir(), 'w') as f: f.write(""" @@ -156,7 +156,7 @@ def test_place_name_cached(): assert place_name['city'] == 'UNITTEST', place_name def test_place_name_no_default(): - # See gh-160 for backwards compatability needed when a string is stored instead of a dict + # See gh-160 for backwards compatibility needed when a string is stored instead of a dict helper.reset_dbs() place_name = geolocation.place_name(123456.000, 123456.000) helper.restore_dbs() diff --git a/elodie/tests/helper.py b/elodie/tests/helper.py index 01ed0007..0753a19d 100644 --- a/elodie/tests/helper.py +++ b/elodie/tests/helper.py @@ -14,7 +14,7 @@ from datetime import datetime from datetime import timedelta -from elodie.compatability import _rename +from elodie.compatibility import _rename from elodie.external.pyexiftool import ExifTool from elodie.dependencies import get_exiftool from elodie import constants diff --git a/elodie/tests/media/photo_test.py b/elodie/tests/media/photo_test.py index dd391ee1..bf09cb96 100644 --- a/elodie/tests/media/photo_test.py +++ b/elodie/tests/media/photo_test.py @@ -375,7 +375,7 @@ def _test_photo_type_get(type, date): if not photo_file: photo_file = helper.download_file(photo_name, folder) if not photo_file or not os.path.isfile(photo_file): - raise SkipTest('{} file not downlaoded'.format(type)) + raise SkipTest('{} file not downloaded'.format(type)) # downloading for each test is costly so we save it in the working directory file_path_save_as = helper.get_file_path(photo_name) @@ -401,7 +401,7 @@ def _test_photo_type_set(type, date): if not photo_file: photo_file = helper.download_file(photo_name, folder) if not photo_file or not os.path.isfile(photo_file): - raise SkipTest('{} file not downlaoded'.format(type)) + raise SkipTest('{} file not downloaded'.format(type)) shutil.copyfile(photo_file, origin) diff --git a/elodie/tools/add_original_name.py b/elodie/tools/add_original_name.py index 2f39a2b4..342e2fac 100644 --- a/elodie/tools/add_original_name.py +++ b/elodie/tools/add_original_name.py @@ -7,7 +7,7 @@ from elodie import constants from elodie import geolocation from elodie import log -from elodie.compatability import _decode +from elodie.compatibility import _decode from elodie.filesystem import FileSystem from elodie.localstorage import Db from elodie.media.base import Base, get_all_subclasses