Commit Graph

46 Commits

Author SHA1 Message Date
Sidney Kochman f447c4d35e Database refactor (#15) 2020-08-19 10:55:11 -04:00
Scoder12 6fb18b0f5e Make audio lint without errors (#12)
* Add new raises sections in docstring

* Fix issue #6

* Fix _async2sync to pass a correct self value

Initialize a _super variable in __init__ which is an instance of the async base class and is used as the self argument to async methods so that the class can await internal methods

* Add do_raise to AsyncJSONKey __slots__

* Add back duplicate sync code

For performance and my sanity, its actually easier to just have duplicate code rather than try fancy async stuff

* Remove nest_asyncio

* Fix bug with auth.signed_in

If header doesn't exist, name will be None, which is not equal to an empty string making signed_in pass. Changed to bool because None and empty string are both falsey

* Ignore S201: debug=True warning

* Add new debug method to run the app in debug mode

* Add init method and nice_jinja setting

* Handle unset watch_files value

* Obey D402

* Remove unnecessarily duplicated methods

* Add getitem and setitem to sync JSONKey

* Remove whitespace from blank line

* Add new shorthands

* Add key() method

* Rename key() as it conflicts with key variable; fix docsting

* Fix accidentally quoted variable

* Make ReplitDb inherit from AsyncReplitDb

* Fix linting errors

* Fix a couple more errors

* Add keys method and change read arg name

* Add missing arg to docstring

* Fix more lint errors

* Add find function

* Add chain_decorators function

* Run black

* Add mutability to keys (WIP)

* Import new utils in maqpy init

* Fix liniting errors in maqpy.html

* Add missing colon

* Pass proper dtype

* Fix typo

* Check for instance of ReplitDb before loading to allow passing dict as db

* Set data variable to read if not loading

* Convert string to f-string in type mismatch msg

* Don't check datatype in keys

* Allow dictionary syntax if dtype is Any

* Allow __getitem__ if dtype is Any

* Don't double json encode, make top-level db be self so data gets written

* Be more pythonic by not checking dtype

* Add more magic methods: add and iadd

* In audio test, fix imports and prevent linting

* Don't lint audio.types

* Add todo line

* Make JSONKey getitem use keys

* Comment out bad tests for now
2020-08-14 14:18:52 -07:00
Manitej Boorgu f20c8bb9bc Added in Changes 2020-08-06 23:35:10 +00:00
Scoder12 47ccdb8f77 Use new sign_in over old signin util 2020-08-04 12:39:58 -07:00
Scoder12 7674192f1f Put imports in correct order 2020-08-04 12:39:29 -07:00
Scoder12 8ce9d9903e Import new utils functions in maqpy init 2020-08-04 12:36:23 -07:00
Scoder12 7854e5e2c1 Add authed ratelimit 2020-08-03 18:01:41 -07:00
Scoder12 6f590fdf12 Bugfix: Use signin() for needs_sign_in default
Without this, sign in button was created in page head making it invisible
2020-08-03 17:35:43 -07:00
Scoder12 0a33fd77f7 Rename signin to sign_in 2020-08-03 17:33:38 -07:00
Scoder12 ac43d0e3e3 Move local_redirect to utils 2020-08-03 15:38:08 -07:00
Scoder12 ba08aff346 Add flask proxies and local_redirect function 2020-08-03 15:34:21 -07:00
Scoder12 850e3aa29b Change make_response to Response to fix bug 2020-07-30 13:00:22 -07:00
Scoder12 9beecd1311 Pass missing args to view function
Used by static files
2020-07-29 12:52:57 -07:00
Scoder12 f45c760d83 Don't pass unexpected args to loginwall handler 2020-07-29 12:42:30 -07:00
Scoder12 a05dc35e0d Use request.args instead of non-existant request.query 2020-07-29 11:39:04 -07:00
Scoder12 e1e9a77d25 Handle src paramater correctly 2020-07-29 11:37:27 -07:00
Scoder12 2ad93fed96 Add default for needs_params src 2020-07-29 11:26:38 -07:00
Scoder12 936bf12db9 Add src paramater to needs_params 2020-07-29 11:22:23 -07:00
Scoder12 7da2a97832 Fix bad annotation 2020-07-29 11:09:45 -07:00
Scoder12 f175159e97 Import needs_params in maqpy init 2020-07-29 11:06:44 -07:00
Scoder12 d1cadd7f37 Add code for needs_params 2020-07-29 10:57:57 -07:00
Scoder12 f595fa94ba Remove unused import 2020-07-28 17:46:18 -07:00
Scoder12 3d4bf9fb98 Remove call referencing old class 2020-07-28 17:40:05 -07:00
Scoder12 5cba0a7517 Delete FileCache in favor of simple dict 2020-07-28 17:38:35 -07:00
Scoder12 b67d1d4e27 Fix type annotations in needs_params again 2020-07-28 17:37:21 -07:00
Scoder12 8e8da86391 Fix type annotations in needs_params 2020-07-28 17:36:24 -07:00
Scoder12 0cdea584d8 Fix file load bug 2020-07-28 17:30:35 -07:00
Scoder12 04cb0f6d23 Remove trailing whitespace 2020-07-28 17:16:35 -07:00
Scoder12 6bab22c596 Import files module 2020-07-28 17:16:18 -07:00
Scoder12 e2d5e55ca3 Initial code for needs_params 2020-07-28 17:11:39 -07:00
Scoder12 9249c4f2b5 Finish rename and rearrange imports 2020-07-28 16:59:04 -07:00
Scoder12 c08b64d3ec Fix bug in decorator: actually return handler 2020-07-28 16:33:13 -07:00
Scoder12 55234c2ab5 Rename kwarg in needs_signin, fix import order 2020-07-28 16:30:17 -07:00
Scoder12 3d5c6de37f Import needs_signin in maqpy init 2020-07-28 16:28:12 -07:00
Scoder12 6ebabbc51c Feat: Add needs_sigin decorator 2020-07-28 16:17:14 -07:00
Scoder12 dcbef77b75 Add missing space before HTML attributes 2020-07-28 12:52:52 -07:00
Scoder12 df795e35c9 Pass arguments to super properly 2020-07-28 12:42:33 -07:00
Scoder12 29e1b71e61 Pass rule to _request_handler 2020-07-28 12:39:18 -07:00
Scoder12 bcd7b1ade5 Fix loginwall and typo in module description 2020-07-28 12:36:53 -07:00
Scoder12 a9026f77e8 Switch to shorter login_wall
all_pages_sign_in was too long
2020-07-28 12:21:27 -07:00
Scoder12 03535d3e8d Add docstrings 2020-07-28 12:12:15 -07:00
Scoder12 b53503cb95 Rearrange imports 2020-07-28 12:07:39 -07:00
Scoder12 b27e2b8354 Import new HTML class 2020-07-28 12:05:52 -07:00
Scoder12 4395f30290 Refactor maqpy.html and make it easy to use 2020-07-28 12:04:43 -07:00
Scoder12 338471b53e Feat: add all_pages_sign_in 2020-07-28 11:26:24 -07:00
Scoder12 1b26d1a8f8 Rename all instances of maqpi to maqpy 2020-07-27 17:50:24 -07:00