aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/mixins.py (follow)
Commit message (Collapse)AuthorAgeLines
* [Jams] Signups code is more or less done, just a few things leftGravatar Gareth Coles2018-05-19-1/+2
|
* Declaring the encoding to be utf-8 is not necessary in Python3 projects, as ↵Gravatar Leon Sandøy2018-04-27-1/+0
| | | | this is the default encoding. Encoding declarations are only useful in py3 if you want to declare it to be something _other_ than utf-8. This was, however, a very useful convention in py2. (#56)
* [#1eeu1] Hiphopify (#54)Gravatar Leon Sandøy2018-04-20-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Changed the dev-mode logic to be the same as prod for creating new tables if they don't exist. Also added a new feature where a table can be initialized with data if you create a JSON file in the pysite/database/table_init/ folder and fill it with a list of dicts where each dict represents a row in your table. Included a hiphoppers json so that I can actually test if it works in production. It will only init the table if the table is empty. * Not sure if this will solve it, but I think so. * Renamed the tables and primary keys, and alphabetized the dict. Now complies with the gdudes holy wishes. * Almost done with the initial build for this. Implemented GET and DELETE, in order to finish POST I need to expand the database.py interface class. * Alphabetized database convenience wrappers. * Fixed a few typehints and added the sample convenience wrapper to the database class. * Finishing up the POST method and adding a duration parser to the utils folder so we can handle strings like 2w3d and turn them into a timestamp. * Fixed API blueprint loading, which was broken by the setup method in the DBMixIn. I'd forgotten to remove the check for table_name attribute. Also adde some logging and got the DELETE route working. * Added timezone-sensitivity to the duration parser so it will work with rethink. renamed the json and fixed some bugs in the hiphopify API. * Added a utility to test if rdb timestamps are expired, and only returning data from the GET calls if it isn't expired. * changed some log wording * Setting up Lil Joseph as default image. Adding some rappers to the list. * Adding a bunch of logging * These tests no longer apply. New tests must be written in the long run, removing them for now. * Addressing review comments left by Volcyy * Fixed misleading comment.
* Initial data for tables and refactoring the dev-mode database handling to be ↵Gravatar Leon Sandøy2018-04-15-4/+0
| | | | | | | | | | similar to prod-mode. (#53) * Changed the dev-mode logic to be the same as prod for creating new tables if they don't exist. Also added a new feature where a table can be initialized with data if you create a JSON file in the pysite/database/table_init/ folder and fill it with a list of dicts where each dict represents a row in your table. Included a hiphoppers json so that I can actually test if it works in production. It will only init the table if the table is empty. * Not sure if this will solve it, but I think so. * Renamed the tables and primary keys, and alphabetized the dict. Now complies with the gdudes holy wishes.
* Easier debugging and optimised importsGravatar Gareth Coles2018-04-08-3/+2
| | | | Simply set FLASK_DEBUG=1 in your env to skip OAuth checks
* Don't create tables on route load by default.Gravatar Gareth Coles2018-04-07-1/+4
| | | | | * If "FLASK_DEBUG" is in your env vars, tables will be created on route load * If you run a query against a table not declared in database.py, a warning is emitted
* Flake8Gravatar Gareth Coles2018-03-30-1/+1
|
* Change to PyCharm importsGravatar Gareth Coles2018-03-30-1/+2
|
* Oauth (#45)Gravatar Nate the great2018-03-29-1/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Creating a OAUTH login for the site. We still need to have a way to fill in credentials however. Signed-off-by: Zwork101 <[email protected]> * How ya like me now Travis? Signed-off-by: Zwork101 <[email protected]> * Fix slight error in database insertion * Revert "Fix slight error in database insertion" (wrong branch) This reverts commit 9ac6cbb * Don't have snekchek working, but I'll try again. Signed-off-by: Zwork101 <[email protected]> * Please enter the commit message for your changes. Lines starting * Adding Oauth2 login to site. * Add prefix * Add prefix * This never happened * Flipping Travis I still can't get snekchek to work locally. * Added a whole bunch of stuff, ready to be used. Signed-off-by: Zwork101 <[email protected]> * Making sessions more secure, and future safe. Signed-off-by: Zwork101 <[email protected]> * Adding some quick stuff Signed-off-by: Zwork101 <[email protected]> * Appease the flake8 gods Signed-off-by: Zwork101 <[email protected]> * Appease the flake8 gods Signed-off-by: Zwork101 <[email protected]> * Whoops Signed-off-by: Zwork101 <[email protected]> * Add comments, fix user_data function. Signed-off-by: Zwork101 <[email protected]> * Whooops, forgot to flake :/ Signed-off-by: Zwork101 <[email protected]> * Make it look nicer, thanks Aperture. Signed-off-by: Zwork101 <[email protected]> * Fixing login issues and added button * Add a OauthMixin to allow for easy data access. Clean stuff up. Signed-off-by: Zwork101 <[email protected]> * Fix a test, and use self.assertEqual rather then self.assertEquals! Signed-off-by: Zwork101 <[email protected]> * Please don't ask how that happened. Signed-off-by: Zwork101 <[email protected]> * Added some tests, moved a bunch of stuff around. Mainly cleaned stuff up. Signed-off-by: Zwork101 <[email protected]> * Add a ton of tests, try to please the coverall gods :D, moved some code into a function for testing. Signed-off-by: Zwork101 <[email protected]> * Just some stupid stuff I missed. Signed-off-by: Zwork101 <[email protected]> * Fix an issue with the test, and add docs Signed-off-by: Zwork101 <[email protected]> * Remove pointless function. (join_user) Signed-off-by: Zwork101 <[email protected]> * Fix test consistency
* Add error messages (#30)Gravatar Joseph2018-02-28-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add error messages Signed-off-by: JoeBanks13 <[email protected]> * Remove un-used keyword arg from 404 * Assert for status code instead of full content * PEP8 * test lint * please coverage * oh * Exclude websockets.py from coverage * Move code output into terminal * Switch typewriter href protocol * Add tests for websockets.py * Abort previous commit, coveralls did not let coverage go down * Add more pauses and request => response * move css and js out, add typewriter JS to our own repo & add method for appending text in bulk. * Enable REPL on 4XX and change error descriptions * commas * /error path
* brings coverage to 90% (#24)Gravatar Christopher Baklid2018-02-26-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * brings coverage to 75% * satisfy flake8 * missing docstring added * one more test * artificially inflate coverage because python acts strange * testing decorators * fixed instantiation of test route * straggling newlines from debugging code * remove debug comments * restructure tests into logical class separations. more exlusions. more tests * testing websocket echo tests * added missing comment * convert single quotes to double quotes to satisfy docstrings
* typo in a comment was driving me nuts.Gravatar Leon Sandøy2018-02-18-1/+1
|
* Rename "Websocket" to "WS" to avoid confusion with the gevents-websocket ↵Gravatar Gareth Coles2018-02-18-1/+1
| | | | WebSocket class
* Integrate websockets into the Flask webappGravatar Gareth Coles2018-02-17-0/+63