diff --git a/changelog.md b/changelog.md index 69b9f3c..9a66243 100755 --- a/changelog.md +++ b/changelog.md @@ -8,6 +8,11 @@ Dates are in YYYY/MM/DD format, time is in America/Chicago (CDT/CST), UTC-0500/- ## Pre-release (0.X.X) 2023/07/17-... +### v0.2.1 (2024/01/16 21:25) +Fixes: +* Really weird code that doesnt serve HTML files from `{ page_dir }` properly. +* The return of the mysterious AttributeError. + ### v0.2.0 (2023/07/22 00:10) Features: * Async with `AsyncServer()` from `http_plus.asyncServer`. diff --git a/dist/http_plus_purplelemons_dev-0.2.0-py3-none-any.whl b/dist/http_plus_purplelemons_dev-0.2.0-py3-none-any.whl new file mode 100644 index 0000000..faffffd Binary files /dev/null and b/dist/http_plus_purplelemons_dev-0.2.0-py3-none-any.whl differ diff --git a/dist/http_plus_purplelemons_dev-0.2.0.tar.gz b/dist/http_plus_purplelemons_dev-0.2.0.tar.gz new file mode 100644 index 0000000..70887be Binary files /dev/null and b/dist/http_plus_purplelemons_dev-0.2.0.tar.gz differ diff --git a/dist/http_plus_purplelemons_dev-0.2.1-py3-none-any.whl b/dist/http_plus_purplelemons_dev-0.2.1-py3-none-any.whl new file mode 100644 index 0000000..ab7a417 Binary files /dev/null and b/dist/http_plus_purplelemons_dev-0.2.1-py3-none-any.whl differ diff --git a/dist/http_plus_purplelemons_dev-0.2.1.tar.gz b/dist/http_plus_purplelemons_dev-0.2.1.tar.gz new file mode 100644 index 0000000..4748c48 Binary files /dev/null and b/dist/http_plus_purplelemons_dev-0.2.1.tar.gz differ diff --git a/pyproject.toml b/pyproject.toml index 9119224..478470c 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "http_plus_purplelemons_dev" -version = "0.2.0" +version = "0.2.1" authors = [ {name = "PurpleLemons", email = "jsmith@cyberthing.dev"} ] diff --git a/readme.md b/readme.md index be71824..d86eb5d 100755 --- a/readme.md +++ b/readme.md @@ -4,7 +4,7 @@ hi welcome to http plus. It's a high-level, dynamic HTTP server for Python. Quic high-performance ones. ## Version -Pre-release version 0.2.0 +Pre-release version 0.2.1 (go check the [changelog](./changelog.md) for more info on versions plz i worked hard on it thx) diff --git a/src/http_plus_purplelemons_dev.egg-info/PKG-INFO b/src/http_plus_purplelemons_dev.egg-info/PKG-INFO old mode 100755 new mode 100644 index d34a578..5c56df9 --- a/src/http_plus_purplelemons_dev.egg-info/PKG-INFO +++ b/src/http_plus_purplelemons_dev.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 -Name: http-plus-purplelemons-dev -Version: 0.1.3 +Name: http_plus_purplelemons_dev +Version: 0.2.1 Summary: A high-level, dynamic HTTP server for Python. Quickly deploy simple servers, or customize complex, high-performance ones. Author-email: PurpleLemons License: GLPv3 @@ -27,7 +27,7 @@ hi welcome to http plus. It's a high-level, dynamic HTTP server for Python. Quic high-performance ones. ## Version -Pre-release version 0.1.3 +Pre-release version 0.2.1 (go check the [changelog](./changelog.md) for more info on versions plz i worked hard on it thx) diff --git a/src/http_plus_purplelemons_dev.egg-info/SOURCES.txt b/src/http_plus_purplelemons_dev.egg-info/SOURCES.txt index 85f99ef..560d2c9 100755 --- a/src/http_plus_purplelemons_dev.egg-info/SOURCES.txt +++ b/src/http_plus_purplelemons_dev.egg-info/SOURCES.txt @@ -2,6 +2,7 @@ LICENSE pyproject.toml readme.md src/http_plus_purplelemons_dev/__init__.py +src/http_plus_purplelemons_dev/asyncServer.py src/http_plus_purplelemons_dev/auth.py src/http_plus_purplelemons_dev/communications.py src/http_plus_purplelemons_dev/content_types.py diff --git a/src/http_plus_purplelemons_dev/__init__.py b/src/http_plus_purplelemons_dev/__init__.py index e7545f4..ce71abb 100755 --- a/src/http_plus_purplelemons_dev/__init__.py +++ b/src/http_plus_purplelemons_dev/__init__.py @@ -24,7 +24,7 @@ You can customize error pages by creating a folder in `./errors` with the name of the error code. """ -__version__ = "0.2.0" +__version__ = "0.2.1" NAME = "http_plus_purplelemons_dev" from http.server import HTTPServer, ThreadingHTTPServer diff --git a/src/http_plus_purplelemons_dev/communications.py b/src/http_plus_purplelemons_dev/communications.py index 998b571..4fe4e86 100755 --- a/src/http_plus_purplelemons_dev/communications.py +++ b/src/http_plus_purplelemons_dev/communications.py @@ -355,7 +355,13 @@ def method(self: "Handler"): # otherwise, assume html extension = "html" - if extension == "html" and self.brython: + if extension == "html" and not os.path.exists(f"{self.page_dir}{path}.py"): + filename = self.serve_filename(path, extension) + if filename is not None: + self.respond_file(200, filename) + return + + elif extension == "html" and self.brython: # check if python script in directory py_files = [] for file in os.listdir(f"{self.page_dir}{path}"): @@ -606,7 +612,8 @@ def get_auth(self, default=None) -> "str|None": try: return self.headers["Authorization"].split(" ", 1) except ( - KeyError + KeyError, + AttributeError, ): # note on commit 77290f6: i have no idea why the fuck it was AttributeError and furthermore have less of a clue as to why it was working fine return default