Commit Graph

11 Commits

Author SHA1 Message Date
Nicolas F d8e796f3e0 Move to Python 3.7 and update dependencies (#551)
* forms: replace re._pattern_type with re.Pattern

Python 3.7 removed re._pattern_type and replaced it with
re.Pattern.

* readme: update for Python 3.7

* Update requirements

Also remove some unused ones which were neither a direct dependency
nor a dependency of our dependencies.

* account: force ASCII usernames on login form

Our database doesn't like it when we check for unicode data in
a column that stores ASCII data, so let's stop it before it
gets that far.

* Move travis CI to Python 3.7

* travis: use xenial dist

* fix newer linter warnings

Apparently bare excepts are literally Hitler, and we have some
new import sorting rules. Hooray!

* requirements: remove six

This is a dependency for sqlalchemy-utils, but we ourselves don't
depend on it directly because we've never been on Python 2 ever.

* Update requirements.txt
2019-08-10 18:39:53 -07:00
Anna-Maria Meriniemi c5d705210d Read-only maintenance mode setting for config.py (#356)
Disables all POSTs, optionally allowing users to log in (without updating last login date)
Blocked POSTs will redirect to the GET endpoint if possible, otherwise to referrer or in last case, home page.
API requests will get a plaintext message with 405 status code.
2017-09-04 18:16:52 -04:00
Kfir Hadas 87dd95f1e0 Refactor into an app factory [2 of 2] (#322)
* Replace all `from nyaa import app` imports with `app = flask.current_app` (or `from flask import current_app as app` where possible)
* Add a separate config object for top-level and class statements as `nyaa.extensions.config`
Required because those codes don't have app context at the time of evaluation/execution.
* Remove `routes.py` file and register all blueprints in `nyaa/__init__.py`
* Refactor `nyaa/__init__.py` into an app factory
* Update tools
* Update tests (temporary, will be replaced)
2017-08-01 21:02:08 +03:00
Kfir Hadas b992467dad Apply isort & flake8 (#312)
* Update isort settings
* Apply import sorting (isort) on all files in nyaa/
* Fixed Flake8 errors in nyaa/ (see PR for list)
* Add isort to lint.sh and requirements.txt
2017-07-28 20:01:19 +03:00
Kfir Hadas 2424639bf9 Refactor routes.py 2017-07-27 14:14:00 +03:00
Kfir Hadas 9acdd14e81 Move /view/<int:torrent_id> route into 'torrents' blueprint
and update templates.
2017-07-27 14:14:00 +03:00
Kfir Hadas eccb0ebdff Move '/' and '/rss' routes into 'main' blueprint
and update templates.
2017-07-27 14:14:00 +03:00
Kfir Hadas 0887dde6fc Move /user/<user_name> route into a blueprint
Move supporting functions and variables into other files
* nyaa.utils:
  - cached_function
  - chain_get
* nyaa.search:
  - DEFAULT_MAX_SEARCH_RESULT
  - DEFAULT_PER_PAGE
  - SERACH_PAGINATE_DISPLAY_MSG
  - _generate_query_string
2017-07-27 14:14:00 +03:00
Kfir Hadas 3913d8cea2 Move admin routes into blueprint
and update templates

Routes:
* /reports
* /adminlog
2017-07-27 14:14:00 +03:00
Kfir Hadas f316353176 Move account routes into blueprint (#292)
and update templates,
and remove unused imports

Routes:
* /login
* /logout
* /register
* /profile
2017-07-27 14:14:00 +03:00
Kfir Hadas 911fbc317f Move static routes into a blueprint
and update templates

Routes:
* /help
* /rules
* /xmlns/nyaa
* /about (commented out)
2017-07-27 14:14:00 +03:00