From f2cfb6c17d9c4941242a86d2a761c1e7a8084af8 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 18 Jun 2023 22:07:46 +0100 Subject: [PATCH] Fix typos and grammar issues --- README.md | 2 +- app/blueprints/github/__init__.py | 4 ++-- app/flatpages/help/copyright.md | 6 +++--- app/flatpages/help/editors.md | 4 ++-- app/flatpages/help/faq.md | 2 +- app/flatpages/help/game_support.md | 2 +- app/flatpages/help/non_free.md | 2 +- app/flatpages/help/ranks_permissions.md | 4 ++-- app/flatpages/help/release_webhooks.md | 2 +- app/flatpages/policy_and_guidance.md | 2 +- app/maillogger.py | 2 +- app/tasks/forumtasks.py | 2 +- app/tasks/minetestcheck/__init__.py | 2 +- app/tasks/minetestcheck/tree.py | 10 +++++----- app/templates/admin/send_bulk_email.html | 2 +- app/templates/users/email_sent.html | 4 ++-- app/templates/users/unsubscribe.html | 2 +- docs/dev_intro.md | 2 +- docs/getting_started.md | 2 +- 19 files changed, 29 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index f1644e3d..256ac155 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ See [Developer Intro](docs/dev_intro.md) for an overview of the code organisatio * (optional) Install the [Docker extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) * Install the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) - * Click no to installing pylint (we don't want it to be installed outside of a virtual env) + * Click no to installing pylint (we don't want it to be installed outside a virtual env) * Set up a virtual env * Replace `psycopg2` with `psycopg2_binary` in requirements.txt (because postgresql won't be installed on the system) * `python3 -m venv env` diff --git a/app/blueprints/github/__init__.py b/app/blueprints/github/__init__.py index f4370234..4f657eba 100644 --- a/app/blueprints/github/__init__.py +++ b/app/blueprints/github/__init__.py @@ -46,12 +46,12 @@ def callback(oauth_token): flash(gettext("Authorization failed [err=gh-oauth-login-failed]"), "danger") return redirect(url_for("users.login")) - # Get Github username + # Get GitGub username url = "https://api.github.com/user" r = requests.get(url, headers={"Authorization": "token " + oauth_token}) username = r.json()["login"] - # Get user by github username + # Get user by GitHub username userByGithub = User.query.filter(func.lower(User.github_username) == func.lower(username)).first() # If logged in, connect diff --git a/app/flatpages/help/copyright.md b/app/flatpages/help/copyright.md index 53c4ac38..b52b108d 100644 --- a/app/flatpages/help/copyright.md +++ b/app/flatpages/help/copyright.md @@ -24,7 +24,7 @@ licenses, although you should actually read the text as well. If you use code from other sources (such as mods or games), you'll need to make sure you follow their license. A common one is attribution, you should do this by adding a comment next to the -code and crediting the author in your README / LICENSE file. +code and crediting the author in your LICENSE file. It's sometimes fine to copy trivial/small amounts of code under fair use, but this is a bit of a grey area. It's better to understand the solution and rewrite it yourself. @@ -74,7 +74,7 @@ Your Name, CC BY-SA 4.0: * [OpenGameArt](https://opengameart.org/) - everything * [Kenney game assets](https://www.kenney.nl/assets) - everything * [Free Sound](https://freesound.org/) - sounds -* [PolyHaven](https://polyhaven.com/) - 3d models and textures. +* [PolyHaven](https://polyhaven.com/) - 3d models and textures. * Other Minetest mods/games Don't assume the author has correctly licensed their work. @@ -87,7 +87,7 @@ Your Name, CC BY-SA 4.0: ### I made it myself, using X as a guide Copying by hand is still copying, the law doesn't distinguish this from copy+paste. -Make your own art without copying colors or patterns from existing games/art. +Make your own art without copying colors or patterns from existing games/art. If you need a good set of colors, see [LOSPEC](https://lospec.com/palette-list). diff --git a/app/flatpages/help/editors.md b/app/flatpages/help/editors.md index 21a31ecf..3f9ef3fe 100644 --- a/app/flatpages/help/editors.md +++ b/app/flatpages/help/editors.md @@ -36,7 +36,7 @@ interface, and can be configured separately in Emails and Notifications. ## Crash Course to being an Editor -The [Package Inclusion Policy and Guidance](/policy_and_guidance/) is our go to resource for making decisions in +The [Package Inclusion Policy and Guidance](/policy_and_guidance/) is our go-to resource for making decisions in changes needed, similar to how lua_api.txt is the doc for modders to consult. In the [Editor console](/todo/), the two most important tabs are the Editor Work Queue and the Forum @@ -50,7 +50,7 @@ A simplified process for reviewing a package is as follows: 1. scan the package image if present for any obvious closed source assets. 2. if right to a name warning is present, check its validity and if the package meets the exceptions. -3. if the forums topic missing warning is present, feel free to check it, but its +3. if the forums topic missing warning is present, feel free to check it, but it's usually incorrect. 4. check source, etc links to make sure they work and are correct. 5. verify that the package has license file that matches what is on the contentdb fields diff --git a/app/flatpages/help/faq.md b/app/flatpages/help/faq.md index c084db2f..6092c4ce 100644 --- a/app/flatpages/help/faq.md +++ b/app/flatpages/help/faq.md @@ -12,7 +12,7 @@ be done using a GitHub account or a random string in your forum account signatur If you don't, then you can just sign up using an email address and password. -GitHub can only be used to login, not to register. +GitHub can only be used to log in, not to register. Register diff --git a/app/flatpages/help/game_support.md b/app/flatpages/help/game_support.md index da6c6af6..14ddf68c 100644 --- a/app/flatpages/help/game_support.md +++ b/app/flatpages/help/game_support.md @@ -24,7 +24,7 @@ Both of these are comma-separated lists of game technical ids. Any `_game` suffi supported_games = minetest_game, repixture unsupported_games = lordofthetest, nodecore, whynot -If your package supports all games by default, you can put "*` in supported_games. +If your package supports all games by default, you can put "*" in supported_games. You can still use unsupported_games to mark games as unsupported. You can also specify games that you've tested in supported_games. diff --git a/app/flatpages/help/non_free.md b/app/flatpages/help/non_free.md index 91eee459..64a27560 100644 --- a/app/flatpages/help/non_free.md +++ b/app/flatpages/help/non_free.md @@ -55,7 +55,7 @@ Here's a quick summary related to Minetest content: Non-free packages are hidden in the client by default, partly in order to comply with the rules of various Linux distributions. -Users can opt-in to showing non-free software, if they wish: +Users can opt in to showing non-free software, if they wish: 1. In the main menu, go to Settings > All settings 2. Search for "ContentDB Flag Blacklist". diff --git a/app/flatpages/help/ranks_permissions.md b/app/flatpages/help/ranks_permissions.md index e39e99e3..8bd8409e 100644 --- a/app/flatpages/help/ranks_permissions.md +++ b/app/flatpages/help/ranks_permissions.md @@ -2,8 +2,8 @@ title: Ranks and Permissions ## Overview -* **New Members** - mostly untrusted, cannot change package meta data or publish releases without approval. -* **Members** - Trusted to change the meta data of their own packages', but cannot approve their own packages. +* **New Members** - mostly untrusted, cannot change package metadata or publish releases without approval. +* **Members** - Trusted to change the metadata of their own packages', but cannot approve their own packages. * **Trusted Members** - Same as above, but can approve their own releases. * **Approvers** - Responsible for approving new packages, screenshots, and releases. * **Editors** - Same as above, and can edit any package or release. diff --git a/app/flatpages/help/release_webhooks.md b/app/flatpages/help/release_webhooks.md index c5dc1fdf..14500f32 100644 --- a/app/flatpages/help/release_webhooks.md +++ b/app/flatpages/help/release_webhooks.md @@ -6,7 +6,7 @@ A webhook is a notification from one service to another. Put simply, a webhook is used to notify ContentDB that the git repository has changed. ContentDB offers the ability to automatically create releases using webhooks -from either Github or Gitlab. If you're not using either of those services, +from either GitHub or GitLab. If you're not using either of those services, you can also use the [API](../api) to create releases. ContentDB also offers the ability to poll a Git repo and check for updates diff --git a/app/flatpages/policy_and_guidance.md b/app/flatpages/policy_and_guidance.md index f68d5375..be0fc340 100644 --- a/app/flatpages/policy_and_guidance.md +++ b/app/flatpages/policy_and_guidance.md @@ -131,7 +131,7 @@ Public domain is not a valid license in many countries, please use CC0 or MIT in ## 5. Promotions and Advertisements (inc. asking for donations) -You may not place any promotions or advertisements in any meta data including +You may not place any promotions or advertisements in any metadata including screenshots. This includes asking for donations, promoting online shops, or linking to personal websites and social media. Please instead use the fields provided on your user profile page to place links to websites and diff --git a/app/maillogger.py b/app/maillogger.py index 1377fc0f..52fb6214 100644 --- a/app/maillogger.py +++ b/app/maillogger.py @@ -64,7 +64,7 @@ class FlaskMailHandler(logging.Handler): def getSubject(self, record): fmt = FlaskMailSubjectFormatter(self.subject_template) subject = fmt.format(record) - # Since templates can cause header problems, and we rather have a incomplete email then an error, we fix this + # Since templates can cause header problems, and we rather have an incomplete email then an error, we fix this if _is_bad_subject(subject): subject="FlaskMailHandler log-entry from ContentDB [original subject is replaced, because it would result in a bad header]" return subject diff --git a/app/tasks/forumtasks.py b/app/tasks/forumtasks.py index 1f75d7ac..1aea4310 100644 --- a/app/tasks/forumtasks.py +++ b/app/tasks/forumtasks.py @@ -46,7 +46,7 @@ def checkForumAccount(forums_username): user.forums_username = forums_username db.session.add(user) - # Get github username + # Get GitHub username github_username = profile.get("github") if github_username is not None and github_username.strip() != "": print("Updated GitHub username for " + user.display_name + " to " + github_username) diff --git a/app/tasks/minetestcheck/__init__.py b/app/tasks/minetestcheck/__init__.py index ca842203..5d8e4ddc 100644 --- a/app/tasks/minetestcheck/__init__.py +++ b/app/tasks/minetestcheck/__init__.py @@ -18,7 +18,7 @@ class ContentType(Enum): def validate_same(self, other): """ - Whether or not `other` is an acceptable type for this + Whether `other` is an acceptable type for this """ assert other diff --git a/app/tasks/minetestcheck/tree.py b/app/tasks/minetestcheck/tree.py index aade1a81..c16f23f1 100644 --- a/app/tasks/minetestcheck/tree.py +++ b/app/tasks/minetestcheck/tree.py @@ -203,22 +203,22 @@ class PackageTreeNode: self.children.append(child) def getModNames(self): - return self.fold("name", type=ContentType.MOD) + return self.fold("name", type_=ContentType.MOD) # attr: Attribute name # key: Key in attribute # retval: Accumulator - # type: Filter to type - def fold(self, attr, key=None, retval=None, type=None): + # type_: Filter to type + def fold(self, attr, key=None, retval=None, type_=None): if retval is None: retval = set() # Iterate through children for child in self.children: - child.fold(attr, key, retval, type) + child.fold(attr, key, retval, type_) # Filter on type - if type and type != self.type: + if type_ and type_ != self.type: return retval # Get attribute diff --git a/app/templates/admin/send_bulk_email.html b/app/templates/admin/send_bulk_email.html index 39998e1b..20e98ae0 100644 --- a/app/templates/admin/send_bulk_email.html +++ b/app/templates/admin/send_bulk_email.html @@ -9,7 +9,7 @@

BE VERY CAREFUL. - This will send an email to all users with email addresses. + This will email all users with email addresses.

{% from "macros/forms.html" import render_field, render_submit_field %} diff --git a/app/templates/users/email_sent.html b/app/templates/users/email_sent.html index b676ab8b..35691bd0 100644 --- a/app/templates/users/email_sent.html +++ b/app/templates/users/email_sent.html @@ -8,7 +8,7 @@

{{ self.title() }}

- {{ _("We've sent an email to the address you specified.") }} + {{ _("We've emailed the address you specified.") }} {{ _("You'll need to click the link in the email to confirm it.") }}

@@ -22,4 +22,4 @@ {{ _("My email never arrived") }}

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/app/templates/users/unsubscribe.html b/app/templates/users/unsubscribe.html index 3bef34e1..07083bba 100644 --- a/app/templates/users/unsubscribe.html +++ b/app/templates/users/unsubscribe.html @@ -37,7 +37,7 @@

- {{ _("Unsubscribing may prevent you from being able to sign into the account '%(display_name)s'", display_name=user.display_name) }} + {{ _("Unsubscribing may prevent you from being able to log into the account '%(display_name)s'", display_name=user.display_name) }} .

diff --git a/docs/dev_intro.md b/docs/dev_intro.md index 02b611b9..55279717 100644 --- a/docs/dev_intro.md +++ b/docs/dev_intro.md @@ -5,7 +5,7 @@ ContentDB is a Python [Flask](https://flask.palletsprojects.com/en/2.0.x/) webservice. There's a PostgreSQL database, manipulated using the [SQLAlchemy ORM](https://docs.sqlalchemy.org/en/14/). -When a user makes a request, Python Flask will direct the request to a *route* in an *blueprint*. +When a user makes a request, Python Flask will direct the request to a *route* in a *blueprint*. A [blueprint](https://flask.palletsprojects.com/en/2.0.x/blueprints/) is a Flask construct to hold a set of routes. Routes are implemented using Python, and likely to respond by using database *models* and rendering HTML *templates*. diff --git a/docs/getting_started.md b/docs/getting_started.md index 129a1fd4..a3b7daaf 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -16,7 +16,7 @@ Docker is the recommended way to develop and deploy ContentDB. Make sure to set `USER_ENABLE_EMAIL` to True. 4. (Optional) Set up GitHub integration - 1. Make a Github OAuth Client at : + 1. Make a GitHub OAuth Client at : 2. Homepage URL - `http://localhost:5123/` 3. Authorization callback URL - `http://localhost:5123/user/github/callback/` 4. Put client id and client secret in `GITHUB_CLIENT_ID` and `GITHUB_CLIENT_SECRET` in config.cfg.