Changeset b3374f6 in OpenWorkouts-current for ow/tests/helpers.py


Ignore:
Timestamp:
Feb 12, 2019, 5:55:33 PM (5 years ago)
Author:
Borja Lopez <borja@…>
Branches:
current, feature/docs, master
Children:
c999b73e
Parents:
f713dbc
Message:

(#52) - Make map screenshot generation async and non-blocker of the dashboard
and user profile pages:

  • workout.map_screenshot is a property again, returns a string with the static path (suitable for use with request.static_url()) for the map screenshot file if exists, none otherwise
  • added a couple of helpers to build the proper screenshot name and full path on the filesystem
  • added a view to generate the map if needed, returning the full static url to the screenshot file in a json-encoded stream
  • added a new js ow tool that looks for workouts that still don't have a map screenshot, calling the view to generate that screenshot and updating the map screenshot when the file is ready
  • modified the dashboard and user profile templates, so a dummy/placeholder image is shown when no map screenshot is yet ready, plus setup and calls for the js tool that generates the maps.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/tests/helpers.py

    rf713dbc rb3374f6  
     1
    12def join(*args, **kwargs):
    2     """ Faked join method, for mocking purposes """
    3     return '/' + '/'.join([arg for arg in args])
     3    """
     4    Faked join method, for mocking purposes
     5    """
     6    return '/' + '/'.join([arg.strip('/') for arg in args])
Note: See TracChangeset for help on using the changeset viewer.