-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from theletterd/python3
Python 3 support!
- Loading branch information
Showing
122 changed files
with
1,103 additions
and
1,214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
google_appengine | ||
virtualenv_ | ||
lib | ||
.tox | ||
env | ||
.git | ||
tmp | ||
loveapp/config-example.py | ||
YelpLove.egg-info | ||
*.pyc | ||
tests/ | ||
testing/ | ||
.pytest_cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,5 @@ tmp | |
import/*.csv | ||
import/*.json | ||
venv | ||
env | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,12 @@ | ||
service: default | ||
runtime: python27 | ||
api_version: 1 | ||
threadsafe: true | ||
runtime: python311 | ||
app_engine_apis: true | ||
|
||
handlers: | ||
- url: /api/.* | ||
script: main.app | ||
secure: always | ||
- url: /keys/?.* | ||
script: main.app | ||
login: admin | ||
secure: always | ||
- url: /subscriptions/?.* | ||
script: main.app | ||
login: admin | ||
secure: always | ||
- url: /aliases/?.* | ||
script: main.app | ||
login: admin | ||
secure: always | ||
- url: /robots.txt | ||
static_files: static/robots.txt | ||
upload: static/robots.txt | ||
secure: optional | ||
- url: /static | ||
static_dir: static | ||
secure: always | ||
- url: /_themes/(.*)/img/(.*) | ||
static_files: themes/\1/static/img/\2 | ||
upload: themes/(.*)/static/img/(.*) | ||
secure: always | ||
login: optional | ||
- url: .* # Anything not explicitly listed above | ||
script: main.app | ||
login: required | ||
secure: always | ||
|
||
builtins: | ||
- remote_api: on | ||
|
||
libraries: | ||
- name: ssl | ||
version: latest | ||
|
||
skip_files: | ||
- ^(.*/)?#.*#$ | ||
- ^(.*/)?.*/RCS/.*$ | ||
- ^(.*/)?.*\.py[co]$ | ||
- ^(.*/)?.*~$ | ||
- ^(.*/)?\..*$ | ||
- ^YelpLove.egg-info(/.*)?$ | ||
- ^config-example.py$ | ||
- ^google_appengine(/.*)?$ | ||
- ^tmp(/.*)?$ | ||
- ^virtualenv_.*$ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# -*- coding: utf-8 -*- | ||
import flask_themes2 | ||
from flask import Blueprint | ||
from flask import current_app | ||
from flask import Flask | ||
from flask_themes2 import Themes | ||
from flask_themes2 import ThemeTemplateLoader | ||
from google.appengine.api import wrap_wsgi_app | ||
|
||
import loveapp.config as config | ||
from loveapp import views | ||
from loveapp.util.auth import is_admin | ||
from loveapp.util.company_values import linkify_company_values | ||
from loveapp.util.converter import RegexConverter | ||
from loveapp.util.csrf import generate_csrf_token | ||
|
||
|
||
def create_app(theme_loaders=()): | ||
if current_app: | ||
return current_app | ||
app = Flask(__name__.split('.')[0]) | ||
app.wsgi_app = wrap_wsgi_app(app.wsgi_app) | ||
|
||
app.secret_key = config.SECRET_KEY | ||
app.url_map.converters['regex'] = RegexConverter | ||
app.jinja_env.globals['config'] = config | ||
app.jinja_env.globals['csrf_token'] = generate_csrf_token | ||
app.jinja_env.globals['is_admin'] = is_admin | ||
app.jinja_env.filters['linkify_company_values'] = linkify_company_values | ||
|
||
app.register_blueprint(views.web.web_app) | ||
app.register_blueprint(views.api.api_app) | ||
app.register_blueprint(views.tasks.tasks_app) | ||
|
||
# flask_themes2 is storing themes_blueprint at the global level | ||
# https://github.com/sysr-q/flask-themes2/blob/master/flask_themes2/__init__.py#L280C1-L281C58 | ||
# which means on some parametrized test runs, we run into errors re-adding urls on the blueprint. | ||
# Forcing the reset of themes_blueprint here seems to work | ||
flask_themes2.themes_blueprint = Blueprint('_themes', __name__) | ||
flask_themes2.themes_blueprint.jinja_loader = ThemeTemplateLoader(True) | ||
Themes(app, app_identifier='yelplove', loaders=theme_loaders) | ||
|
||
# if debug property is present, let's use it | ||
try: | ||
app.debug = config.DEBUG | ||
except AttributeError: | ||
app.debug = False | ||
|
||
return app |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
username,first_name,last_name,office,department,photo_url | ||
duncan,Duncan,Cook,Awesomeness Office,Department Of Awesome,https://placehold.it/100x100 | ||
hbomb,Harrison,Cook,,,https://placehold.it/100x100 | ||
niffs,Jennifer,Cook,,,https://placehold.it/100x100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
username,first_name,last_name,department,office,photo_url | ||
john,John,Doe,,,https://placehold.it/100x100 | ||
janet,Janet,Doe,,,https://placehold.it/100x100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.