From 3ea48331249e0d0129feee1e08a627bdccde36bb Mon Sep 17 00:00:00 2001 From: Brenden Tuck Date: Fri, 18 Sep 2020 18:45:50 -0400 Subject: [PATCH 01/20] expose onTabCreate() so other plugins can create blessed goldenlayout tabs --- .../web/webclient/static/webclient/js/plugins/goldenlayout.js | 1 + 1 file changed, 1 insertion(+) diff --git a/evennia/web/webclient/static/webclient/js/plugins/goldenlayout.js b/evennia/web/webclient/static/webclient/js/plugins/goldenlayout.js index cbf5217730..ec94917a98 100644 --- a/evennia/web/webclient/static/webclient/js/plugins/goldenlayout.js +++ b/evennia/web/webclient/static/webclient/js/plugins/goldenlayout.js @@ -535,6 +535,7 @@ let goldenlayout = (function () { onText: onText, getGL: function () { return myLayout; }, addKnownType: addKnownType, + onTabCreate: onTabCreate, } }()); window.plugin_handler.add("goldenlayout", goldenlayout); From 767165583dedc411957836bf951d29947ad5515e Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 10:48:58 +0200 Subject: [PATCH 02/20] Continue-on-error for coveralls action --- .github/workflows/pythonpackage.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 145ce09e17..6808f3d270 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -36,7 +36,6 @@ jobs: uses: mirromutth/mysql-action@v1.1 if: ${{ matrix.TESTING_DB == 'mysql'}} with: - mysql version: '5.7' character set server: 'utf8mb4' collation server: 'utf8mb4_unicode_ci' mysql database: 'evennia' @@ -73,7 +72,7 @@ jobs: if: ${{ github.ref == 'refs/heads/develop' }} run: pip install -r requirements_extra.txt - - name: Install and initialize evennia + - name: Initialize evennia run: | evennia --init testing_mygame cp .travis/${{ matrix.TESTING_DB }}_settings.py testing_mygame/server/conf/settings.py @@ -87,16 +86,21 @@ jobs: coverage run --source=../evennia --omit=*/migrations/*,*/urls.py,*/test*.py,*.sh,*.txt,*.md,*.pyc,*.service ../bin/unix/evennia test --settings=settings --keepdb evennia coverage xml - # we only want to run coverall once, so we only do it for one of the matrix combinations + # we only want to run coverall/codacy once, so we only do it for one of the matrix combinations + # it's also not critical if pushing to either service fails (happens for PRs since env is not + # available outside of the evennia org) - name: Send data to Coveralls if: ${{ matrix.TESTING_DB == 'sqlite3' && matrix.python-version == 3.7 }} + continue-on-error: true env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} run: | cd testing_mygame coveralls + - name: Send data to Codacy if: ${{ matrix.TESTING_DB == 'sqlite3' && matrix.python-version == 3.7 }} + continue-on-error: true uses: codacy/codacy-coverage-reporter-action@master with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} From 8f1aeab0cf1d71ab817bf7304139b10a44bdd124 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 11:56:25 +0200 Subject: [PATCH 03/20] Testing github action for mysql matrix test --- .github/workflows/pythonpackage.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 6808f3d270..7d835d7764 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -17,7 +17,7 @@ jobs: matrix: python-version: [3.7, 3.8] # TODO: mysql disabled, not able to connect to it so far - TESTING_DB: ['sqlite3', 'postgresql'] # , 'mysql'] + TESTING_DB: ['sqlite3', 'postgresql', 'mysql'] fail-fast: False steps: @@ -36,6 +36,7 @@ jobs: uses: mirromutth/mysql-action@v1.1 if: ${{ matrix.TESTING_DB == 'mysql'}} with: + host port: 3306 character set server: 'utf8mb4' collation server: 'utf8mb4_unicode_ci' mysql database: 'evennia' From 8e84a66bf15e3b3e6f5ee40d882c106c258ec2c5 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 12:01:02 +0200 Subject: [PATCH 04/20] Further test of github action --- .travis/mysql_settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis/mysql_settings.py b/.travis/mysql_settings.py index e654d5ea89..8a28faebf3 100644 --- a/.travis/mysql_settings.py +++ b/.travis/mysql_settings.py @@ -44,8 +44,8 @@ DATABASES = { "NAME": "evennia", "USER": "evennia", "PASSWORD": "password", - "HOST": "localhost", - "PORT": "", # use default port + "HOST": "127.0.0.1", + "PORT": "3306", # use default port "OPTIONS": { "charset": "utf8mb4", "init_command": "set collation_connection=utf8mb4_unicode_ci", From 261083c1b4768fb9927a11051821b084d8e7644c Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 12:12:14 +0200 Subject: [PATCH 05/20] Try to fix mysql test access --- .github/workflows/pythonpackage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 7d835d7764..24d0429bb2 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -18,7 +18,7 @@ jobs: python-version: [3.7, 3.8] # TODO: mysql disabled, not able to connect to it so far TESTING_DB: ['sqlite3', 'postgresql', 'mysql'] - fail-fast: False + # fail-fast: false steps: @@ -39,7 +39,7 @@ jobs: host port: 3306 character set server: 'utf8mb4' collation server: 'utf8mb4_unicode_ci' - mysql database: 'evennia' + mysql database: 'default' mysql user: 'evennia' mysql password: 'password' From 84579174bfa016b5baf68dcfe3f5873758dd4c47 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 12:24:31 +0200 Subject: [PATCH 06/20] Some more tests --- .github/workflows/pythonpackage.yml | 4 ++-- .travis/mysql_settings.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 24d0429bb2..8b488377d6 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -18,7 +18,7 @@ jobs: python-version: [3.7, 3.8] # TODO: mysql disabled, not able to connect to it so far TESTING_DB: ['sqlite3', 'postgresql', 'mysql'] - # fail-fast: false + fail-fast: true steps: @@ -39,7 +39,7 @@ jobs: host port: 3306 character set server: 'utf8mb4' collation server: 'utf8mb4_unicode_ci' - mysql database: 'default' + mysql database: 'evennia' mysql user: 'evennia' mysql password: 'password' diff --git a/.travis/mysql_settings.py b/.travis/mysql_settings.py index 8a28faebf3..0dc167ffa7 100644 --- a/.travis/mysql_settings.py +++ b/.travis/mysql_settings.py @@ -45,7 +45,7 @@ DATABASES = { "USER": "evennia", "PASSWORD": "password", "HOST": "127.0.0.1", - "PORT": "3306", # use default port + "PORT": "", # use default port "OPTIONS": { "charset": "utf8mb4", "init_command": "set collation_connection=utf8mb4_unicode_ci", @@ -54,8 +54,8 @@ DATABASES = { "NAME": "default", "OPTIONS": { "charset": "utf8mb4", - # 'init_command': 'set collation_connection=utf8mb4_unicode_ci' - "init_command": "SET NAMES 'utf8mb4'", + 'init_command': 'set collation_connection=utf8mb4_unicode_ci' + # "init_command": "SET NAMES 'utf8mb4'", }, }, } From b0c85c16b2f59ffc4d6ddf8c030ceea79afd4554 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 12:26:55 +0200 Subject: [PATCH 07/20] Workflow typo --- .github/workflows/pythonpackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 8b488377d6..b9893f3d02 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -18,7 +18,7 @@ jobs: python-version: [3.7, 3.8] # TODO: mysql disabled, not able to connect to it so far TESTING_DB: ['sqlite3', 'postgresql', 'mysql'] - fail-fast: true + fail-fast: True steps: From da3d945366ed0d99e0cd60b1f5e7afc8164a160b Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 12:27:38 +0200 Subject: [PATCH 08/20] Workflow typo --- .github/workflows/pythonpackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index b9893f3d02..8a4b51c123 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -18,7 +18,7 @@ jobs: python-version: [3.7, 3.8] # TODO: mysql disabled, not able to connect to it so far TESTING_DB: ['sqlite3', 'postgresql', 'mysql'] - fail-fast: True + # fail-fast: false steps: From 8fafd9160cc7f95e1576ead0c8a8cb6baa621ceb Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 12:49:11 +0200 Subject: [PATCH 09/20] More test with mysql --- .github/workflows/pythonpackage.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 8a4b51c123..1e4c0e1119 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -40,8 +40,8 @@ jobs: character set server: 'utf8mb4' collation server: 'utf8mb4_unicode_ci' mysql database: 'evennia' - mysql user: 'evennia' - mysql password: 'password' + mysql root password: 'password' + # mysql password: 'password' # wait for db to activage, get logs from their start - name: Wait / sleep From 550f675014bfb3a2d8aa8281add22d4f82c9a0b8 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 12:54:32 +0200 Subject: [PATCH 10/20] More test with mysql --- .github/workflows/pythonpackage.yml | 4 ++-- .travis/mysql_settings.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 1e4c0e1119..8a4b51c123 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -40,8 +40,8 @@ jobs: character set server: 'utf8mb4' collation server: 'utf8mb4_unicode_ci' mysql database: 'evennia' - mysql root password: 'password' - # mysql password: 'password' + mysql user: 'evennia' + mysql password: 'password' # wait for db to activage, get logs from their start - name: Wait / sleep diff --git a/.travis/mysql_settings.py b/.travis/mysql_settings.py index 0dc167ffa7..db08859439 100644 --- a/.travis/mysql_settings.py +++ b/.travis/mysql_settings.py @@ -51,7 +51,7 @@ DATABASES = { "init_command": "set collation_connection=utf8mb4_unicode_ci", }, "TEST": { - "NAME": "default", + "NAME": "evennia", "OPTIONS": { "charset": "utf8mb4", 'init_command': 'set collation_connection=utf8mb4_unicode_ci' From 341fc8f48cc208050bfe0bb48cef3fb749048986 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 13:08:15 +0200 Subject: [PATCH 11/20] MySQL action working, doing cleanup --- ...npackage.yml => github_evennia_action.yml} | 5 +- .github/workflows/mysql_settings.py | 70 +++++++++++++++++++ .github/workflows/postgresql_settings.py | 60 ++++++++++++++++ .github/workflows/sqlite3_settings.py | 47 +++++++++++++ .travis/mysql_settings.py | 1 - 5 files changed, 179 insertions(+), 4 deletions(-) rename .github/workflows/{pythonpackage.yml => github_evennia_action.yml} (94%) create mode 100644 .github/workflows/mysql_settings.py create mode 100644 .github/workflows/postgresql_settings.py create mode 100644 .github/workflows/sqlite3_settings.py diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/github_evennia_action.yml similarity index 94% rename from .github/workflows/pythonpackage.yml rename to .github/workflows/github_evennia_action.yml index 8a4b51c123..53ccb62c07 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/github_evennia_action.yml @@ -16,9 +16,8 @@ jobs: strategy: matrix: python-version: [3.7, 3.8] - # TODO: mysql disabled, not able to connect to it so far TESTING_DB: ['sqlite3', 'postgresql', 'mysql'] - # fail-fast: false + fail-fast: false steps: @@ -76,7 +75,7 @@ jobs: - name: Initialize evennia run: | evennia --init testing_mygame - cp .travis/${{ matrix.TESTING_DB }}_settings.py testing_mygame/server/conf/settings.py + cp .github/workflows/${{ matrix.TESTING_DB }}_settings.py testing_mygame/server/conf/settings.py cd testing_mygame evennia migrate evennia collectstatic --noinput diff --git a/.github/workflows/mysql_settings.py b/.github/workflows/mysql_settings.py new file mode 100644 index 0000000000..a3465b3cc6 --- /dev/null +++ b/.github/workflows/mysql_settings.py @@ -0,0 +1,70 @@ +""" +Evennia settings file. + +The available options are found in the default settings file found +here: + +/home/griatch/Devel/Home/evennia/evennia/evennia/settings_default.py + +Remember: + +Don't copy more from the default file than you actually intend to +change; this will make sure that you don't overload upstream updates +unnecessarily. + +When changing a setting requiring a file system path (like +path/to/actual/file.py), use GAME_DIR and EVENNIA_DIR to reference +your game folder and the Evennia library folders respectively. Python +paths (path.to.module) should be given relative to the game's root +folder (typeclasses.foo) whereas paths within the Evennia library +needs to be given explicitly (evennia.foo). + +If you want to share your game dir, including its settings, you can +put secret game- or server-specific settings in secret_settings.py. + +""" + +import os + +# Use the defaults from Evennia unless explicitly overridden +from evennia.settings_default import * + +###################################################################### +# Evennia base server config +###################################################################### + +# This is the name of your game. Make it catchy! +SERVERNAME = "testing_mygame" + +# Testing database types + +DATABASES = { + "default": { + "ENGINE": "django.db.backends.mysql", + "NAME": "evennia", + "USER": "evennia", + "PASSWORD": "password", + "HOST": "127.0.0.1", + "PORT": "", # use default port + "OPTIONS": { + "charset": "utf8mb4", + "init_command": "set collation_connection=utf8mb4_unicode_ci", + }, + "TEST": { + "NAME": "evennia", + "OPTIONS": { + "charset": "utf8mb4", + 'init_command': 'set collation_connection=utf8mb4_unicode_ci' + }, + }, + } +} + + +###################################################################### +# Settings given in secret_settings.py override those in this file. +###################################################################### +try: + from server.conf.secret_settings import * +except ImportError: + print("secret_settings.py file not found or failed to import.") diff --git a/.github/workflows/postgresql_settings.py b/.github/workflows/postgresql_settings.py new file mode 100644 index 0000000000..c12927af3a --- /dev/null +++ b/.github/workflows/postgresql_settings.py @@ -0,0 +1,60 @@ +""" +Evennia settings file. + +The available options are found in the default settings file found +here: + +/home/griatch/Devel/Home/evennia/evennia/evennia/settings_default.py + +Remember: + +Don't copy more from the default file than you actually intend to +change; this will make sure that you don't overload upstream updates +unnecessarily. + +When changing a setting requiring a file system path (like +path/to/actual/file.py), use GAME_DIR and EVENNIA_DIR to reference +your game folder and the Evennia library folders respectively. Python +paths (path.to.module) should be given relative to the game's root +folder (typeclasses.foo) whereas paths within the Evennia library +needs to be given explicitly (evennia.foo). + +If you want to share your game dir, including its settings, you can +put secret game- or server-specific settings in secret_settings.py. + +""" + +import os + +# Use the defaults from Evennia unless explicitly overridden +from evennia.settings_default import * + +###################################################################### +# Evennia base server config +###################################################################### + +# This is the name of your game. Make it catchy! +SERVERNAME = "testing_mygame" + +# Testing database types + +DATABASES = { + "default": { + "ENGINE": "django.db.backends.postgresql", + "NAME": "evennia", + "USER": "evennia", + "PASSWORD": "password", + "HOST": "localhost", + "PORT": "", # use default + "TEST": {"NAME": "default"}, + } +} + + +###################################################################### +# Settings given in secret_settings.py override those in this file. +###################################################################### +try: + from server.conf.secret_settings import * +except ImportError: + print("secret_settings.py file not found or failed to import.") diff --git a/.github/workflows/sqlite3_settings.py b/.github/workflows/sqlite3_settings.py new file mode 100644 index 0000000000..cc4bae81c8 --- /dev/null +++ b/.github/workflows/sqlite3_settings.py @@ -0,0 +1,47 @@ +""" +Evennia settings file. + +The available options are found in the default settings file found +here: + +/home/griatch/Devel/Home/evennia/evennia/evennia/settings_default.py + +Remember: + +Don't copy more from the default file than you actually intend to +change; this will make sure that you don't overload upstream updates +unnecessarily. + +When changing a setting requiring a file system path (like +path/to/actual/file.py), use GAME_DIR and EVENNIA_DIR to reference +your game folder and the Evennia library folders respectively. Python +paths (path.to.module) should be given relative to the game's root +folder (typeclasses.foo) whereas paths within the Evennia library +needs to be given explicitly (evennia.foo). + +If you want to share your game dir, including its settings, you can +put secret game- or server-specific settings in secret_settings.py. + +""" + +import os + +# Use the defaults from Evennia unless explicitly overridden +from evennia.settings_default import * + +###################################################################### +# Evennia base server config +###################################################################### + +# This is the name of your game. Make it catchy! +SERVERNAME = "testing_mygame" + +# Using default sqlite3 settings + +###################################################################### +# Settings given in secret_settings.py override those in this file. +###################################################################### +try: + from server.conf.secret_settings import * +except ImportError: + print("secret_settings.py file not found or failed to import.") diff --git a/.travis/mysql_settings.py b/.travis/mysql_settings.py index db08859439..a3465b3cc6 100644 --- a/.travis/mysql_settings.py +++ b/.travis/mysql_settings.py @@ -55,7 +55,6 @@ DATABASES = { "OPTIONS": { "charset": "utf8mb4", 'init_command': 'set collation_connection=utf8mb4_unicode_ci' - # "init_command": "SET NAMES 'utf8mb4'", }, }, } From 1d26f5547adf06765060e2bbe3b0068d8a69b454 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 13:09:12 +0200 Subject: [PATCH 12/20] Set fail-fast False --- .github/workflows/github_evennia_action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github_evennia_action.yml b/.github/workflows/github_evennia_action.yml index 53ccb62c07..3eb6c50324 100644 --- a/.github/workflows/github_evennia_action.yml +++ b/.github/workflows/github_evennia_action.yml @@ -17,7 +17,7 @@ jobs: matrix: python-version: [3.7, 3.8] TESTING_DB: ['sqlite3', 'postgresql', 'mysql'] - fail-fast: false + fail-fast: False steps: From 758ba837eb45684af169b4700426b03893a1abac Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 13:10:22 +0200 Subject: [PATCH 13/20] Set fail-fast true --- .github/workflows/github_evennia_action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github_evennia_action.yml b/.github/workflows/github_evennia_action.yml index 3eb6c50324..d56b564696 100644 --- a/.github/workflows/github_evennia_action.yml +++ b/.github/workflows/github_evennia_action.yml @@ -17,7 +17,7 @@ jobs: matrix: python-version: [3.7, 3.8] TESTING_DB: ['sqlite3', 'postgresql', 'mysql'] - fail-fast: False + fail-fast: true steps: From 4283549a0f8d5cd8eba54f6c01c389af221f1354 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 13:11:03 +0200 Subject: [PATCH 14/20] Another form of fail-fast --- .github/workflows/github_evennia_action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github_evennia_action.yml b/.github/workflows/github_evennia_action.yml index d56b564696..a8986e93e2 100644 --- a/.github/workflows/github_evennia_action.yml +++ b/.github/workflows/github_evennia_action.yml @@ -17,7 +17,7 @@ jobs: matrix: python-version: [3.7, 3.8] TESTING_DB: ['sqlite3', 'postgresql', 'mysql'] - fail-fast: true + fail-fast: True steps: From 1efc6f3b23d726801ae99471ddcf34cfc0ee1954 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 13:15:13 +0200 Subject: [PATCH 15/20] Fix indent for fail-fast --- .github/workflows/github_evennia_action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github_evennia_action.yml b/.github/workflows/github_evennia_action.yml index a8986e93e2..5a27f81399 100644 --- a/.github/workflows/github_evennia_action.yml +++ b/.github/workflows/github_evennia_action.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: python-version: [3.7, 3.8] TESTING_DB: ['sqlite3', 'postgresql', 'mysql'] - fail-fast: True steps: From ab49e3695e0f72d657e4aa31c859ba4572221467 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 13:23:50 +0200 Subject: [PATCH 16/20] Remove travis, use only github actions --- .travis.yml | 51 ------------------------- .travis/my.conf | 1 - .travis/mysql_settings.py | 70 ---------------------------------- .travis/postgresql_settings.py | 60 ----------------------------- .travis/sqlite3_settings.py | 47 ----------------------- 5 files changed, 229 deletions(-) delete mode 100644 .travis.yml delete mode 100644 .travis/my.conf delete mode 100644 .travis/mysql_settings.py delete mode 100644 .travis/postgresql_settings.py delete mode 100644 .travis/sqlite3_settings.py diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3d3714c4f7..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,51 +0,0 @@ -dist: xenial -language: python -cache: pip - -services: - - postgresql - - mysql - -python: - - "3.7" - - "3.8" - -env: - - TESTING_DB=sqlite3 - - TESTING_DB=postgresql - - TESTING_DB=mysql - -before_install: - - # - psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE evennia TO evennia;" - - psql --version - - psql -U postgres -c "CREATE DATABASE evennia;" - - psql -U postgres -c "CREATE USER evennia WITH PASSWORD 'password';" - - psql -U postgres -c "ALTER USER evennia CREATEDB;" - - mysql --version - - mysql -u root -e "CREATE DATABASE evennia CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" - - mysql -u root -e "CREATE USER 'evennia'@'localhost' IDENTIFIED BY 'password';" - - mysql -u root -e "GRANT ALL ON *.* TO 'evennia'@'localhost' IDENTIFIED BY 'password';" - -install: - - pip install psycopg2-binary - - pip install mysqlclient - - pip install coveralls - - pip install codacy-coverage - - pip install -e . - -before_script: - - make format - - evennia --init testing_mygame - - cp .travis/${TESTING_DB}_settings.py testing_mygame/server/conf/settings.py - - cd testing_mygame - - evennia migrate - - evennia collectstatic --noinput - -script: - - coverage run --source=../evennia --omit=*/migrations/*,*/urls.py,*/test*.py,*.sh,*.txt,*.md,*.pyc,*.service ../bin/unix/evennia test --settings=settings --keepdb evennia - -after_success: - - coveralls - - coverage xml - - python-codacy-coverage -r coverage.xml diff --git a/.travis/my.conf b/.travis/my.conf deleted file mode 100644 index 51b810ecc7..0000000000 --- a/.travis/my.conf +++ /dev/null @@ -1 +0,0 @@ -init_connect='SET collation_connection = utf8_general_ci; SET NAMES utf8;' diff --git a/.travis/mysql_settings.py b/.travis/mysql_settings.py deleted file mode 100644 index a3465b3cc6..0000000000 --- a/.travis/mysql_settings.py +++ /dev/null @@ -1,70 +0,0 @@ -""" -Evennia settings file. - -The available options are found in the default settings file found -here: - -/home/griatch/Devel/Home/evennia/evennia/evennia/settings_default.py - -Remember: - -Don't copy more from the default file than you actually intend to -change; this will make sure that you don't overload upstream updates -unnecessarily. - -When changing a setting requiring a file system path (like -path/to/actual/file.py), use GAME_DIR and EVENNIA_DIR to reference -your game folder and the Evennia library folders respectively. Python -paths (path.to.module) should be given relative to the game's root -folder (typeclasses.foo) whereas paths within the Evennia library -needs to be given explicitly (evennia.foo). - -If you want to share your game dir, including its settings, you can -put secret game- or server-specific settings in secret_settings.py. - -""" - -import os - -# Use the defaults from Evennia unless explicitly overridden -from evennia.settings_default import * - -###################################################################### -# Evennia base server config -###################################################################### - -# This is the name of your game. Make it catchy! -SERVERNAME = "testing_mygame" - -# Testing database types - -DATABASES = { - "default": { - "ENGINE": "django.db.backends.mysql", - "NAME": "evennia", - "USER": "evennia", - "PASSWORD": "password", - "HOST": "127.0.0.1", - "PORT": "", # use default port - "OPTIONS": { - "charset": "utf8mb4", - "init_command": "set collation_connection=utf8mb4_unicode_ci", - }, - "TEST": { - "NAME": "evennia", - "OPTIONS": { - "charset": "utf8mb4", - 'init_command': 'set collation_connection=utf8mb4_unicode_ci' - }, - }, - } -} - - -###################################################################### -# Settings given in secret_settings.py override those in this file. -###################################################################### -try: - from server.conf.secret_settings import * -except ImportError: - print("secret_settings.py file not found or failed to import.") diff --git a/.travis/postgresql_settings.py b/.travis/postgresql_settings.py deleted file mode 100644 index c12927af3a..0000000000 --- a/.travis/postgresql_settings.py +++ /dev/null @@ -1,60 +0,0 @@ -""" -Evennia settings file. - -The available options are found in the default settings file found -here: - -/home/griatch/Devel/Home/evennia/evennia/evennia/settings_default.py - -Remember: - -Don't copy more from the default file than you actually intend to -change; this will make sure that you don't overload upstream updates -unnecessarily. - -When changing a setting requiring a file system path (like -path/to/actual/file.py), use GAME_DIR and EVENNIA_DIR to reference -your game folder and the Evennia library folders respectively. Python -paths (path.to.module) should be given relative to the game's root -folder (typeclasses.foo) whereas paths within the Evennia library -needs to be given explicitly (evennia.foo). - -If you want to share your game dir, including its settings, you can -put secret game- or server-specific settings in secret_settings.py. - -""" - -import os - -# Use the defaults from Evennia unless explicitly overridden -from evennia.settings_default import * - -###################################################################### -# Evennia base server config -###################################################################### - -# This is the name of your game. Make it catchy! -SERVERNAME = "testing_mygame" - -# Testing database types - -DATABASES = { - "default": { - "ENGINE": "django.db.backends.postgresql", - "NAME": "evennia", - "USER": "evennia", - "PASSWORD": "password", - "HOST": "localhost", - "PORT": "", # use default - "TEST": {"NAME": "default"}, - } -} - - -###################################################################### -# Settings given in secret_settings.py override those in this file. -###################################################################### -try: - from server.conf.secret_settings import * -except ImportError: - print("secret_settings.py file not found or failed to import.") diff --git a/.travis/sqlite3_settings.py b/.travis/sqlite3_settings.py deleted file mode 100644 index cc4bae81c8..0000000000 --- a/.travis/sqlite3_settings.py +++ /dev/null @@ -1,47 +0,0 @@ -""" -Evennia settings file. - -The available options are found in the default settings file found -here: - -/home/griatch/Devel/Home/evennia/evennia/evennia/settings_default.py - -Remember: - -Don't copy more from the default file than you actually intend to -change; this will make sure that you don't overload upstream updates -unnecessarily. - -When changing a setting requiring a file system path (like -path/to/actual/file.py), use GAME_DIR and EVENNIA_DIR to reference -your game folder and the Evennia library folders respectively. Python -paths (path.to.module) should be given relative to the game's root -folder (typeclasses.foo) whereas paths within the Evennia library -needs to be given explicitly (evennia.foo). - -If you want to share your game dir, including its settings, you can -put secret game- or server-specific settings in secret_settings.py. - -""" - -import os - -# Use the defaults from Evennia unless explicitly overridden -from evennia.settings_default import * - -###################################################################### -# Evennia base server config -###################################################################### - -# This is the name of your game. Make it catchy! -SERVERNAME = "testing_mygame" - -# Using default sqlite3 settings - -###################################################################### -# Settings given in secret_settings.py override those in this file. -###################################################################### -try: - from server.conf.secret_settings import * -except ImportError: - print("secret_settings.py file not found or failed to import.") From 96c5f8480b7e21b3209f2f8dc6b0c523d0468dbc Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 13:33:10 +0200 Subject: [PATCH 17/20] Update README with new icons --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0383c98034..399e00e37e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Evennia MUD/MU\* Creation System ![evennia logo][logo] -[![Build Status][travisimg]][travislink] [![Coverage Status][coverimg]][coverlink] +[![Build Status][unittestciimg]][unittestcilink] [![Coverage Status][coverimg]][coverlink] + *Evennia* is a modern library for creating [online multiplayer text games][wikimudpage] (MUD, MUSH, MUX, MUCK, MOO etc) in pure Python. It @@ -69,8 +70,8 @@ Welcome! [wiki]: https://github.com/evennia/evennia/wiki [screenshot]: https://user-images.githubusercontent.com/294267/30773728-ea45afb6-a076-11e7-8820-49be2168a6b8.png [logo]: https://github.com/evennia/evennia/blob/master/evennia/web/website/static/website/images/evennia_logo.png -[travisimg]: https://travis-ci.org/evennia/evennia.svg?branch=master -[travislink]: https://travis-ci.org/evennia/evennia +[unittestciimg]: https://github.com/evennia/evennia/workflows/Evennia%20test-suite%20and%20coveralls/badge.svg +[unittestcilink]: https://github.com/evennia/evennia/actions?query=workflow%3A%22Evennia+test-suite+and+coveralls%22 [coverimg]: https://coveralls.io/repos/github/evennia/evennia/badge.svg?branch=master [coverlink]: https://coveralls.io/github/evennia/evennia?branch=master [introduction]: https://github.com/evennia/evennia/wiki/Evennia-Introduction From 6cca656c87a2a18eecd59c9054117421d9a37707 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 13:42:39 +0200 Subject: [PATCH 18/20] Rename action --- .github/workflows/github_evennia_action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github_evennia_action.yml b/.github/workflows/github_evennia_action.yml index 5a27f81399..4ad8914985 100644 --- a/.github/workflows/github_evennia_action.yml +++ b/.github/workflows/github_evennia_action.yml @@ -1,7 +1,7 @@ # This Evennia workflow will install Python dependencies, run tests with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: Evennia test-suite and coveralls +name: test-suite on: push: From b090b369adb717df439f726554d3cb1db07d993b Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 13:52:02 +0200 Subject: [PATCH 19/20] Change badge link --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 399e00e37e..73bb35181c 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,8 @@ Welcome! [wiki]: https://github.com/evennia/evennia/wiki [screenshot]: https://user-images.githubusercontent.com/294267/30773728-ea45afb6-a076-11e7-8820-49be2168a6b8.png [logo]: https://github.com/evennia/evennia/blob/master/evennia/web/website/static/website/images/evennia_logo.png -[unittestciimg]: https://github.com/evennia/evennia/workflows/Evennia%20test-suite%20and%20coveralls/badge.svg -[unittestcilink]: https://github.com/evennia/evennia/actions?query=workflow%3A%22Evennia+test-suite+and+coveralls%22 +[unittestciimg]: https://github.com/evennia/evennia/workflows/test-suite/badge.svg +[unittestcilink]: https://github.com/evennia/evennia/actions?query=workflow%3Atest-suite [coverimg]: https://coveralls.io/repos/github/evennia/evennia/badge.svg?branch=master [coverlink]: https://coveralls.io/github/evennia/evennia?branch=master [introduction]: https://github.com/evennia/evennia/wiki/Evennia-Introduction From eaf768204412a452a8307564cb4dbe4688ecb1e3 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 19 Sep 2020 14:02:03 +0200 Subject: [PATCH 20/20] Run black on sources --- .github/workflows/mysql_settings.py | 2 +- evennia/commands/default/building.py | 1 + evennia/commands/default/comms.py | 1 - evennia/commands/default/system.py | 4 +- evennia/commands/default/tests.py | 1 - evennia/contrib/tests.py | 2 +- .../tutorial_examples/example_batch_code.py | 6 +-- evennia/prototypes/prototypes.py | 46 ++++++++----------- evennia/prototypes/tests.py | 15 +++--- evennia/scripts/tickerhandler.py | 6 ++- evennia/server/connection_wizard.py | 14 +++--- evennia/server/evennia_launcher.py | 7 ++- evennia/server/portal/telnet.py | 1 + evennia/server/portal/webclient.py | 1 + evennia/utils/evmore.py | 3 +- evennia/utils/utils.py | 8 ++-- 16 files changed, 58 insertions(+), 60 deletions(-) diff --git a/.github/workflows/mysql_settings.py b/.github/workflows/mysql_settings.py index a3465b3cc6..b5525dcd74 100644 --- a/.github/workflows/mysql_settings.py +++ b/.github/workflows/mysql_settings.py @@ -54,7 +54,7 @@ DATABASES = { "NAME": "evennia", "OPTIONS": { "charset": "utf8mb4", - 'init_command': 'set collation_connection=utf8mb4_unicode_ci' + "init_command": "set collation_connection=utf8mb4_unicode_ci", }, }, } diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py index 8006130336..e79b0d3cce 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -3077,6 +3077,7 @@ class CmdScript(COMMAND_DEFAULT_CLASS): elif not self.switches: # view all scripts from evennia.commands.default.system import ScriptEvMore + ScriptEvMore(self.caller, scripts.order_by("id"), session=self.session) return elif "start" in self.switches: diff --git a/evennia/commands/default/comms.py b/evennia/commands/default/comms.py index 55e96ecd4e..ed7ff7ba73 100644 --- a/evennia/commands/default/comms.py +++ b/evennia/commands/default/comms.py @@ -40,7 +40,6 @@ __all__ = ( "CmdIRCStatus", "CmdRSS2Chan", "CmdGrapevine2Chan", - ) _DEFAULT_WIDTH = settings.CLIENT_DEFAULT_WIDTH diff --git a/evennia/commands/default/system.py b/evennia/commands/default/system.py index d323cb24e1..6ba160e489 100644 --- a/evennia/commands/default/system.py +++ b/evennia/commands/default/system.py @@ -439,7 +439,7 @@ class ScriptEvMore(EvMore): "|wdesc|n", align="r", border="tablecols", - width=self.width + width=self.width, ) for script in scripts: @@ -570,7 +570,7 @@ class CmdScripts(COMMAND_DEFAULT_CLASS): caller.msg(string) else: # No stopping or validation. We just want to view things. - ScriptEvMore(caller, scripts.order_by('id'), session=self.session) + ScriptEvMore(caller, scripts.order_by("id"), session=self.session) class CmdObjects(COMMAND_DEFAULT_CLASS): diff --git a/evennia/commands/default/tests.py b/evennia/commands/default/tests.py index 739f5f9a34..8227de27bf 100644 --- a/evennia/commands/default/tests.py +++ b/evennia/commands/default/tests.py @@ -1239,7 +1239,6 @@ class TestBuilding(CommandTest): ) def test_spawn(self): - def get_object(commandTest, obj_key): # A helper function to get a spawned object and # check that it exists in the process. diff --git a/evennia/contrib/tests.py b/evennia/contrib/tests.py index d0eda87ea2..a4e50a29f7 100644 --- a/evennia/contrib/tests.py +++ b/evennia/contrib/tests.py @@ -895,7 +895,7 @@ class TestDice(CommandTest): # Test email-login -from evennia.contrib import email_login # noqa +from evennia.contrib import email_login # noqa class TestEmailLogin(CommandTest): diff --git a/evennia/contrib/tutorial_examples/example_batch_code.py b/evennia/contrib/tutorial_examples/example_batch_code.py index 7aeca3f3a0..edb2483468 100644 --- a/evennia/contrib/tutorial_examples/example_batch_code.py +++ b/evennia/contrib/tutorial_examples/example_batch_code.py @@ -39,7 +39,7 @@ # -#HEADER +# HEADER # everything in this block will be appended to the beginning of # all other #CODE blocks when they are executed. @@ -51,7 +51,7 @@ from evennia import DefaultObject limbo = search_object("Limbo")[0] -#CODE +# CODE # This is the first code block. Within each block, Python # code works as normal. Note how we make use if imports and @@ -67,7 +67,7 @@ red_button = create_object( # we take a look at what we created caller.msg("A %s was created." % red_button.key) -#CODE +# CODE # this code block has 'table' and 'chair' set as deletable # objects. This means that when the batchcode processor runs in diff --git a/evennia/prototypes/prototypes.py b/evennia/prototypes/prototypes.py index 75410f20d3..cd5fde5739 100644 --- a/evennia/prototypes/prototypes.py +++ b/evennia/prototypes/prototypes.py @@ -167,8 +167,9 @@ for mod in settings.PROTOTYPE_MODULES: if "prototype_locks" in prot else "use:all();edit:false()" ), - "prototype_tags": list(set(list( - make_iter(prot.get("prototype_tags", []))) + ["module"])), + "prototype_tags": list( + set(list(make_iter(prot.get("prototype_tags", []))) + ["module"]) + ), } ) _MODULE_PROTOTYPES[actual_prot_key] = prot @@ -392,35 +393,23 @@ def search_prototype(key=None, tags=None, require_single=False, return_iterators # exact match on tag(s) tags = make_iter(tags) tag_categories = ["db_prototype" for _ in tags] - db_matches = DbPrototype.objects.get_by_tag( - tags, tag_categories) + db_matches = DbPrototype.objects.get_by_tag(tags, tag_categories) else: db_matches = DbPrototype.objects.all() if key: # exact or partial match on key - exact_match = ( - db_matches - .filter( - Q(db_key__iexact=key)) - .order_by("db_key") - ) + exact_match = db_matches.filter(Q(db_key__iexact=key)).order_by("db_key") if not exact_match: # try with partial match instead - db_matches = ( - db_matches - .filter( - Q(db_key__icontains=key)) - .order_by("db_key") - ) + db_matches = db_matches.filter(Q(db_key__icontains=key)).order_by("db_key") else: db_matches = exact_match # convert to prototype db_ids = db_matches.values_list("id", flat=True) db_matches = ( - Attribute.objects - .filter(scriptdb__pk__in=db_ids, db_key="prototype") + Attribute.objects.filter(scriptdb__pk__in=db_ids, db_key="prototype") .values_list("db_value", flat=True) .order_by("scriptdb__db_key") ) @@ -501,7 +490,7 @@ class PrototypeEvMore(EvMore): else: # get the correct slice, adjusted for the db-prototypes pageno = max(0, pageno - self._npages_db) - return modprot_list[pageno * self.height: pageno * self.height + self.height] + return modprot_list[pageno * self.height : pageno * self.height + self.height] def page_formatter(self, page): """Input is a queryset page from django.Paginator""" @@ -517,7 +506,7 @@ class PrototypeEvMore(EvMore): "|wDesc|n", border="tablecols", crop=True, - width=self.width + width=self.width, ) for prototype in page: @@ -554,8 +543,9 @@ class PrototypeEvMore(EvMore): return str(table) -def list_prototypes(caller, key=None, tags=None, show_non_use=False, - show_non_edit=True, session=None): +def list_prototypes( + caller, key=None, tags=None, show_non_use=False, show_non_edit=True, session=None +): """ Collate a list of found prototypes based on search criteria and access. @@ -581,10 +571,14 @@ def list_prototypes(caller, key=None, tags=None, show_non_use=False, return None # get specific prototype (one value or exception) - return PrototypeEvMore(caller, (dbprot_query, modprot_list), - session=session, - show_non_use=show_non_use, - show_non_edit=show_non_edit) + return PrototypeEvMore( + caller, + (dbprot_query, modprot_list), + session=session, + show_non_use=show_non_use, + show_non_edit=show_non_edit, + ) + def validate_prototype( prototype, protkey=None, protparents=None, is_prototype_base=True, strict=True, _flags=None diff --git a/evennia/prototypes/tests.py b/evennia/prototypes/tests.py index 755d7f2e13..f7eac5d912 100644 --- a/evennia/prototypes/tests.py +++ b/evennia/prototypes/tests.py @@ -630,10 +630,8 @@ class TestPrototypeStorage(EvenniaTest): # partial match with mock.patch("evennia.prototypes.prototypes._MODULE_PROTOTYPES", {}): - self.assertCountEqual( - protlib.search_prototype("prot"), [prot1b, prot2, prot3]) - self.assertCountEqual( - protlib.search_prototype(tags="foo1"), [prot1b, prot2, prot3]) + self.assertCountEqual(protlib.search_prototype("prot"), [prot1b, prot2, prot3]) + self.assertCountEqual(protlib.search_prototype(tags="foo1"), [prot1b, prot2, prot3]) self.assertTrue(str(str(protlib.list_prototypes(self.char1)))) @@ -1078,6 +1076,7 @@ class TestOLCMenu(TestEvMenu): ], ] + class PrototypeCrashTest(EvenniaTest): # increase this to 1000 for optimization testing @@ -1089,9 +1088,9 @@ class PrototypeCrashTest(EvenniaTest): # print(f"Creating {num} additional prototypes...") for x in range(num): prot = { - 'prototype_key': str(uuid.uuid4()), - 'some_attributes': [str(uuid.uuid4()) for x in range(10)], - 'prototype_tags': list(sample(['demo', 'test', 'stuff'], 2)), + "prototype_key": str(uuid.uuid4()), + "some_attributes": [str(uuid.uuid4()) for x in range(10)], + "prototype_tags": list(sample(["demo", "test", "stuff"], 2)), } protlib.save_prototype(prot) @@ -1101,5 +1100,5 @@ class PrototypeCrashTest(EvenniaTest): self.create(num_prototypes) # print("Attempting to list prototypes...") # start_time = time() - self.char1.execute_cmd('spawn/list') + self.char1.execute_cmd("spawn/list") # print(f"Prototypes listed in {time()-start_time} seconds.") diff --git a/evennia/scripts/tickerhandler.py b/evennia/scripts/tickerhandler.py index 47dc9f02b3..239d8a2509 100644 --- a/evennia/scripts/tickerhandler.py +++ b/evennia/scripts/tickerhandler.py @@ -344,8 +344,10 @@ class TickerHandler(object): raise TypeError(f"{callback} is not a callable function or method.") if outobj and not inherits_from(outobj, "evennia.typeclasses.models.TypedObject"): - raise TypeError(f"{callback} is a method on a normal object - it must " - "be either a method on a typeclass, or a stand-alone function.") + raise TypeError( + f"{callback} is a method on a normal object - it must " + "be either a method on a typeclass, or a stand-alone function." + ) return outobj, outpath, outcallfunc diff --git a/evennia/server/connection_wizard.py b/evennia/server/connection_wizard.py index cce74fb703..38c658f95f 100644 --- a/evennia/server/connection_wizard.py +++ b/evennia/server/connection_wizard.py @@ -176,17 +176,14 @@ def node_start(wizard): node_game_index_start, {}, ), - "2": ("MSSP setup (for mud-list crawlers)", - node_mssp_start, {} - ), + "2": ("MSSP setup (for mud-list crawlers)", node_mssp_start, {}), # "3": ("Add Grapevine listing", # node_grapevine_start, {}), # "4": ("Add IRC link", # "node_irc_start", {}), # "5" ("Add RSS feed", # "node_rss_start", {}), - "s": ("View and (optionally) Save created settings", - node_view_and_apply_settings, {}), + "s": ("View and (optionally) Save created settings", node_view_and_apply_settings, {}), "q": ("Quit", lambda *args: sys.exit(), {}), } @@ -263,7 +260,7 @@ def node_game_index_fields(wizard, status=None): return True wizard.display(text) - wizard.game_index_listing['game_name'] = wizard.ask_input( + wizard.game_index_listing["game_name"] = wizard.ask_input( default=name_default, validator=name_validator ) @@ -494,8 +491,9 @@ def node_view_and_apply_settings(wizard): # game index game_index_save_text = "" - game_index_listing = (wizard.game_index_listing if - hasattr(wizard, "game_index_listing") else None) + game_index_listing = ( + wizard.game_index_listing if hasattr(wizard, "game_index_listing") else None + ) if not game_index_listing and settings.GAME_INDEX_ENABLED: game_index_listing = settings.GAME_INDEX_LISTING if game_index_listing: diff --git a/evennia/server/evennia_launcher.py b/evennia/server/evennia_launcher.py index 69517fa38e..e4467f0800 100644 --- a/evennia/server/evennia_launcher.py +++ b/evennia/server/evennia_launcher.py @@ -1278,8 +1278,11 @@ def check_main_evennia_dependencies(): # only the main version (1.5, not 1.5.4.0) dversion_main = ".".join(dversion.split(".")[:2]) if LooseVersion(dversion) < LooseVersion(DJANGO_MIN): - print(ERROR_DJANGO_MIN.format(dversion=dversion_main, django_min=DJANGO_MIN, - django_lt=DJANGO_LT)) + print( + ERROR_DJANGO_MIN.format( + dversion=dversion_main, django_min=DJANGO_MIN, django_lt=DJANGO_LT + ) + ) error = True elif LooseVersion(DJANGO_LT) <= LooseVersion(dversion_main): print(NOTE_DJANGO_NEW.format(dversion=dversion_main, django_rec=DJANGO_LT)) diff --git a/evennia/server/portal/telnet.py b/evennia/server/portal/telnet.py index 8f43cacd2a..494b8569c1 100644 --- a/evennia/server/portal/telnet.py +++ b/evennia/server/portal/telnet.py @@ -85,6 +85,7 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session): super().dataReceived(data) except ValueError as err: from evennia.utils import logger + logger.log_err(f"Malformed telnet input: {err}") def connectionMade(self): diff --git a/evennia/server/portal/webclient.py b/evennia/server/portal/webclient.py index 155599c7a0..b00a36d6d9 100644 --- a/evennia/server/portal/webclient.py +++ b/evennia/server/portal/webclient.py @@ -42,6 +42,7 @@ GOING_AWAY = WebSocketServerProtocol.CLOSE_STATUS_CODE_GOING_AWAY STATE_CLOSING = WebSocketServerProtocol.STATE_CLOSING + class WebSocketClient(WebSocketServerProtocol, Session): """ Implements the server-side of the Websocket connection. diff --git a/evennia/utils/evmore.py b/evennia/utils/evmore.py index f992446979..702b523d60 100644 --- a/evennia/utils/evmore.py +++ b/evennia/utils/evmore.py @@ -331,7 +331,6 @@ class EvMore(object): # goto top of the text self.page_top() - # default paginators - responsible for extracting a specific page number def paginator_index(self, pageno): @@ -343,7 +342,7 @@ class EvMore(object): Paginate by slice. This is done with an eye on memory efficiency (usually for querysets); to avoid fetching all objects at the same time. """ - return self._data[pageno * self.height: pageno * self.height + self.height] + return self._data[pageno * self.height : pageno * self.height + self.height] def paginator_django(self, pageno): """ diff --git a/evennia/utils/utils.py b/evennia/utils/utils.py index bd5d460b5b..541d516b9f 100644 --- a/evennia/utils/utils.py +++ b/evennia/utils/utils.py @@ -1918,9 +1918,11 @@ def at_search_result(matches, caller, query="", quiet=False, **kwargs): # we need to consider Commands, where .aliases is a list aliases = result.aliases.all() if hasattr(result.aliases, "all") else result.aliases # remove any pluralization aliases - aliases = [alias for alias in aliases if - hasattr(alias, "category") - and alias.category not in ("plural_key", )] + aliases = [ + alias + for alias in aliases + if hasattr(alias, "category") and alias.category not in ("plural_key",) + ] error += _MULTIMATCH_TEMPLATE.format( number=num + 1, name=result.get_display_name(caller)